@wix/agent-skills 1.26.0 → 1.27.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 +7 -5
- package/skills/wix-app/references/DASHBOARD_PAGE.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-headless-kit/SKILL.md +31 -14
- package/skills/wix-headless-kit/guides/existing-site.md +12 -5
- package/skills/wix-headless-kit/install/attach.mjs +55 -10
- package/skills/wix-headless-kit/install/check.mjs +5 -5
- package/skills/wix-headless-kit/install/deploy.mjs +7 -3
- package/skills/wix-headless-kit/install/templates.mjs +21 -17
- 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 +349 -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 +95 -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 +466 -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 +95 -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 +466 -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 +90 -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 +376 -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 +44 -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 +187 -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 +187 -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 +262 -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,614 @@
|
|
|
1
|
+
// Booking rules, request builders, and DTO mapping — transport-agnostic, imported by BOTH transports:
|
|
2
|
+
// ./booking.ts (the SDK) and the REST twin in templates/bookings/rest/booking.ts (fetch). The
|
|
3
|
+
// availability request bodies, the slot identity + mapper, the calendar-events bodies (sessions,
|
|
4
|
+
// recurring MASTER events → offered days and course seats), the add-on rules, the form-field rules,
|
|
5
|
+
// the createBooking body, the cart body, and the checkout-or-place decision live HERE, once — these
|
|
6
|
+
// are the payloads that are exact and easy to get subtly wrong. Raw entities may carry `_id` (SDK)
|
|
7
|
+
// or `id` (REST). Imports are type-only so a strip to JS emits no imports.
|
|
8
|
+
import type {
|
|
9
|
+
AddOn,
|
|
10
|
+
AddOnGroup,
|
|
11
|
+
BookingFormField,
|
|
12
|
+
BookingResult,
|
|
13
|
+
BookingsSettings,
|
|
14
|
+
CourseAvailability,
|
|
15
|
+
ServiceDetail,
|
|
16
|
+
ServiceLocation,
|
|
17
|
+
Session,
|
|
18
|
+
Slot,
|
|
19
|
+
SlotsPage,
|
|
20
|
+
Weekday,
|
|
21
|
+
} from "./types";
|
|
22
|
+
|
|
23
|
+
export type Raw = Record<string, any>;
|
|
24
|
+
|
|
25
|
+
export const rawId = (raw: Raw | undefined | null): string => raw?._id ?? raw?.id ?? "";
|
|
26
|
+
|
|
27
|
+
// Copies of services-core's ids (same values) so this file stands alone when stripped.
|
|
28
|
+
/** The Wix Bookings app id — the cart line's catalogReference.appId and the events filter. */
|
|
29
|
+
export const BOOKINGS_APP_ID = "13d21c63-b5ec-5912-8397-c3a5ddb27a97";
|
|
30
|
+
/** Staff-member resource type id (ANY_RESOURCE fallback + staff filtering). */
|
|
31
|
+
export const STAFF_RESOURCE_TYPE_ID = "1cd44cf8-756f-41c3-bd90-3e2ffcaf1155";
|
|
32
|
+
/** One availability page: Wix's headless package pages 1000 and follows the cursor; 100 truncates a busy week. */
|
|
33
|
+
export const SLOTS_PAGE_LIMIT = 1000;
|
|
34
|
+
/** Next-availability defaults: 3 upcoming times, clamped to 1..6, scanned to the end of the month 6 months out. */
|
|
35
|
+
export const NEXT_AVAILABLE_DEFAULT = 3;
|
|
36
|
+
export const NEXT_AVAILABLE_MAX = 6;
|
|
37
|
+
export const NEXT_AVAILABLE_MONTHS = 6;
|
|
38
|
+
/** Sessions list page size (Wix's viewer shows 7 upcoming sessions per page). */
|
|
39
|
+
export const SESSIONS_PAGE_SIZE = 7;
|
|
40
|
+
|
|
41
|
+
const WEEKDAYS: Weekday[] = ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"];
|
|
42
|
+
|
|
43
|
+
const pad = (n: number) => String(n).padStart(2, "0");
|
|
44
|
+
/** Local wall-clock "YYYY-MM-DDThh:mm:ss" (NO Z) — the format the availability and calendar APIs require. */
|
|
45
|
+
export function toLocalDateString(d: Date): string {
|
|
46
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
|
47
|
+
}
|
|
48
|
+
/** Midnight at the start of the given day (local). */
|
|
49
|
+
export const startOfDay = (d: Date): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
50
|
+
const addDays = (d: Date, n: number): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n, d.getHours(), d.getMinutes(), d.getSeconds());
|
|
51
|
+
|
|
52
|
+
/** The visitor's IANA time zone — used only when the site shows times in the CUSTOMER's zone. */
|
|
53
|
+
export const defaultTimeZone = (): string => Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The display-zone POLICY → the `timeZone` the availability and calendar requests send: the
|
|
57
|
+
* visitor's zone under CUSTOMER_TIME_ZONE; `undefined` (omit the param) under the Wix default,
|
|
58
|
+
* BUSINESS_TIME_ZONE — the server then computes in the business zone and echoes it back.
|
|
59
|
+
*/
|
|
60
|
+
export function resolveDisplayTimeZone(settings: Pick<BookingsSettings, "displayTimeZone">): string | undefined {
|
|
61
|
+
return settings.displayTimeZone === "CUSTOMER" ? defaultTimeZone() : undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** "Eastern Time (EDT)" for a zone at a date (the abbreviation is date-dependent); "" when it can't be formatted. */
|
|
65
|
+
export function timeZoneLabel(timeZone: string | null | undefined, referenceDate = new Date(), locale?: string): string {
|
|
66
|
+
if (!timeZone) return "";
|
|
67
|
+
try {
|
|
68
|
+
const part = (style: "longGeneric" | "short") =>
|
|
69
|
+
new Intl.DateTimeFormat(locale, { timeZone, timeZoneName: style }).formatToParts(referenceDate).find((p) => p.type === "timeZoneName")?.value ?? "";
|
|
70
|
+
const generic = part("longGeneric");
|
|
71
|
+
const abbr = part("short");
|
|
72
|
+
if (!generic) return abbr;
|
|
73
|
+
if (!abbr || abbr === generic) return generic;
|
|
74
|
+
return `${generic} (${abbr})`;
|
|
75
|
+
} catch {
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ---- availability ----------------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
export interface SlotsWindow {
|
|
83
|
+
from?: Date;
|
|
84
|
+
days?: number;
|
|
85
|
+
/** IANA zone to compute in; undefined = omit → the business zone (see resolveDisplayTimeZone). */
|
|
86
|
+
timeZone?: string;
|
|
87
|
+
staffId?: string;
|
|
88
|
+
/** A follow-up page (from the previous response's cursor). */
|
|
89
|
+
cursor?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** [start of `from`'s day, start of the day `days` later) as the local strings both time-slot APIs take. */
|
|
93
|
+
export function slotsRange({ from = new Date(), days = 7 }: SlotsWindow): { fromLocalDate: string; toLocalDate: string } {
|
|
94
|
+
const start = startOfDay(from);
|
|
95
|
+
return { fromLocalDate: toLocalDateString(start), toLocalDate: toLocalDateString(addDays(start, days)) };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The List Availability Time Slots body for an APPOINTMENT service: bookable slots only, the staff
|
|
100
|
+
* resources included on each slot, optionally narrowed to one staff member, one 1000-slot page at a
|
|
101
|
+
* time (the transport follows `cursorPagingMetadata.cursors.next`). No `timeZone` key when none is
|
|
102
|
+
* resolved — the server computes in the business zone and echoes it.
|
|
103
|
+
*/
|
|
104
|
+
export function appointmentSlotsRequest(serviceId: string, { timeZone, staffId, cursor, ...window }: SlotsWindow): Raw {
|
|
105
|
+
return {
|
|
106
|
+
serviceId,
|
|
107
|
+
...slotsRange(window),
|
|
108
|
+
...(timeZone ? { timeZone } : {}),
|
|
109
|
+
bookable: true,
|
|
110
|
+
cursorPaging: cursor ? { limit: SLOTS_PAGE_LIMIT, cursor } : { limit: SLOTS_PAGE_LIMIT },
|
|
111
|
+
includeResourceTypeIds: [STAFF_RESOURCE_TYPE_ID],
|
|
112
|
+
...(staffId ? { resourceTypes: [{ resourceTypeId: STAFF_RESOURCE_TYPE_ID, resourceIds: [staffId] }] } : {}),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The List Event Time Slots body for a CLASS service: its sessions INCLUDING full ones (they render
|
|
118
|
+
* disabled as "Full" instead of vanishing), optionally one staff member's, paged like appointments
|
|
119
|
+
* (the cursor rides `pagingMetadata.cursors.next` on this API).
|
|
120
|
+
*/
|
|
121
|
+
export function classSlotsRequest(serviceId: string, { timeZone, staffId, cursor, ...window }: SlotsWindow): Raw {
|
|
122
|
+
return {
|
|
123
|
+
serviceIds: [serviceId],
|
|
124
|
+
...slotsRange(window),
|
|
125
|
+
...(timeZone ? { timeZone } : {}),
|
|
126
|
+
includeNonBookable: true,
|
|
127
|
+
cursorPaging: cursor ? { limit: SLOTS_PAGE_LIMIT, cursor } : { limit: SLOTS_PAGE_LIMIT },
|
|
128
|
+
...(staffId ? { eventFilter: { "resources.id": { $hasSome: [staffId] } } } : {}),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** The next page's cursor out of either time-slots response (they name the metadata differently); null at the end. */
|
|
133
|
+
export const nextSlotsCursor = (res: Raw | null | undefined): string | null =>
|
|
134
|
+
res?.cursorPagingMetadata?.cursors?.next ?? res?.pagingMetadata?.cursors?.next ?? null;
|
|
135
|
+
|
|
136
|
+
export interface NextAvailableOptions {
|
|
137
|
+
limit?: number;
|
|
138
|
+
staffId?: string;
|
|
139
|
+
timeZone?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Start of today → end of the last day of the month NEXT_AVAILABLE_MONTHS ahead (Wix's scan window). */
|
|
143
|
+
export function nextAvailableRange(now = new Date()): { fromLocalDate: string; toLocalDate: string } {
|
|
144
|
+
const lastDay = new Date(now.getFullYear(), now.getMonth() + NEXT_AVAILABLE_MONTHS + 1, 0, 23, 59, 59);
|
|
145
|
+
return { fromLocalDate: toLocalDateString(startOfDay(now)), toLocalDate: toLocalDateString(lastDay) };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export const clampNextAvailable = (n: number | undefined): number => Math.min(Math.max(n ?? NEXT_AVAILABLE_DEFAULT, 1), NEXT_AVAILABLE_MAX);
|
|
149
|
+
|
|
150
|
+
/** The next-availability body: the same two APIs, bookable slots only, the first `limit` of them. */
|
|
151
|
+
export function nextAvailableRequest(service: Pick<ServiceDetail, "id" | "type">, { limit, staffId, timeZone }: NextAvailableOptions = {}): Raw {
|
|
152
|
+
const cursorPaging = { limit: clampNextAvailable(limit) };
|
|
153
|
+
if (service.type === "CLASS") {
|
|
154
|
+
return {
|
|
155
|
+
serviceIds: [service.id],
|
|
156
|
+
...nextAvailableRange(),
|
|
157
|
+
...(timeZone ? { timeZone } : {}),
|
|
158
|
+
includeNonBookable: false,
|
|
159
|
+
cursorPaging,
|
|
160
|
+
...(staffId ? { eventFilter: { "resources.id": { $hasSome: [staffId] } } } : {}),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
serviceId: service.id,
|
|
165
|
+
...nextAvailableRange(),
|
|
166
|
+
...(timeZone ? { timeZone } : {}),
|
|
167
|
+
bookable: true,
|
|
168
|
+
cursorPaging,
|
|
169
|
+
includeResourceTypeIds: [STAFF_RESOURCE_TYPE_ID],
|
|
170
|
+
...(staffId ? { resourceTypes: [{ resourceTypeId: STAFF_RESOURCE_TYPE_ID, resourceIds: [staffId] }] } : {}),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Next-availability is shown only where a plain time is the whole choice: not VARIED pricing, add-ons, or a course. */
|
|
175
|
+
export const showsNextAvailability = (service: Pick<ServiceDetail, "type" | "rateType" | "hasAddOns">): boolean =>
|
|
176
|
+
service.type !== "COURSE" && service.rateType !== "VARIED" && !service.hasAddOns;
|
|
177
|
+
|
|
178
|
+
/** A slot's identity: start|end|location. The same time at two locations is two slots; two staff at one time is one. */
|
|
179
|
+
export const slotKey = (raw: Raw): string => `${raw.localStartDate ?? ""}|${raw.localEndDate ?? ""}|${rawId(raw.location)}`;
|
|
180
|
+
|
|
181
|
+
/** Multi-staff appointments return one slot per staff member for the same time — merged into one, staff concatenated. */
|
|
182
|
+
export function dedupeSlots(raws: Raw[]): Raw[] {
|
|
183
|
+
const byKey = new Map<string, Raw>();
|
|
184
|
+
for (const raw of raws) {
|
|
185
|
+
const key = slotKey(raw);
|
|
186
|
+
const seen = byKey.get(key);
|
|
187
|
+
if (!seen) byKey.set(key, raw);
|
|
188
|
+
else if (raw.availableResources?.length) byKey.set(key, { ...seen, availableResources: [...(seen.availableResources ?? []), ...raw.availableResources] });
|
|
189
|
+
}
|
|
190
|
+
return [...byKey.values()];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const timeLabel = (local: string, locale?: string): string => {
|
|
194
|
+
try {
|
|
195
|
+
return new Date(local).toLocaleTimeString(locale, { hour: "numeric", minute: "2-digit" });
|
|
196
|
+
} catch {
|
|
197
|
+
return local.slice(11, 16);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const toSlotLocation = (raw: Raw | undefined): ServiceLocation | null => {
|
|
202
|
+
if (!raw || (!rawId(raw) && !raw.name)) return null;
|
|
203
|
+
const type = (["BUSINESS", "CUSTOM", "CUSTOMER"].includes(raw.locationType) ? raw.locationType : "BUSINESS") as ServiceLocation["type"];
|
|
204
|
+
return { id: rawId(raw) || null, name: raw.name ?? "", type };
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export function toSlot(raw: Raw): Slot {
|
|
208
|
+
const start: string = raw.localStartDate ?? "";
|
|
209
|
+
const staff = ((raw.availableResources ?? []) as Raw[])
|
|
210
|
+
.flatMap((ar) => (ar.resources ?? []) as Raw[])
|
|
211
|
+
.map((r) => ({ id: rawId(r), name: r.name ?? "" }))
|
|
212
|
+
.filter((r) => r.id);
|
|
213
|
+
return {
|
|
214
|
+
key: slotKey(raw),
|
|
215
|
+
startLocal: start,
|
|
216
|
+
endLocal: raw.localEndDate ?? "",
|
|
217
|
+
dayKey: start.slice(0, 10),
|
|
218
|
+
label: timeLabel(start),
|
|
219
|
+
bookable: raw.bookable !== false,
|
|
220
|
+
totalCapacity: raw.totalCapacity ?? null,
|
|
221
|
+
remainingCapacity: raw.remainingCapacity ?? null,
|
|
222
|
+
waitlistCapacity: raw.eventInfo?.waitingList?.remainingCapacity ?? null,
|
|
223
|
+
scheduleId: raw.scheduleId ?? null,
|
|
224
|
+
eventId: raw.eventInfo?.eventId ?? null,
|
|
225
|
+
eventTitle: raw.eventInfo?.eventTitle ?? "",
|
|
226
|
+
location: toSlotLocation(raw.location),
|
|
227
|
+
staff,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Raw slots from one or more pages → a deduped, ordered SlotsPage with the response's zone. */
|
|
232
|
+
export function toSlotsPage(raws: Raw[], timeZone: string | null | undefined): SlotsPage {
|
|
233
|
+
const slots = dedupeSlots(raws).map(toSlot).sort((a, b) => a.startLocal.localeCompare(b.startLocal));
|
|
234
|
+
return { slots, timeZone: timeZone ?? null };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface BookingDay {
|
|
238
|
+
dayKey: string;
|
|
239
|
+
dayLabel: string;
|
|
240
|
+
slots: Slot[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export const dayLabel = (dayKey: string, locale?: string): string => {
|
|
244
|
+
try {
|
|
245
|
+
return new Date(`${dayKey}T12:00:00`).toLocaleDateString(locale, { weekday: "short", month: "short", day: "numeric" });
|
|
246
|
+
} catch {
|
|
247
|
+
return dayKey;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/** Slots grouped by day, days in order — what a slot picker renders. */
|
|
252
|
+
export function groupSlotsByDay(slots: Slot[]): BookingDay[] {
|
|
253
|
+
const byDay = new Map<string, Slot[]>();
|
|
254
|
+
for (const s of slots) byDay.set(s.dayKey, [...(byDay.get(s.dayKey) ?? []), s]);
|
|
255
|
+
return [...byDay.entries()]
|
|
256
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
257
|
+
.map(([dayKey, daySlots]) => ({ dayKey, dayLabel: dayLabel(dayKey), slots: daySlots }));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* How many participants one booking may hold: the participants policy's cap, else the service's
|
|
262
|
+
* capacity (1 for appointments), never more than the seats left on the chosen slot, never below 1.
|
|
263
|
+
*/
|
|
264
|
+
export function maxParticipants(service: Pick<ServiceDetail, "maxParticipantsPerBooking" | "defaultCapacity" | "type">, slot: Pick<Slot, "remainingCapacity"> | null): number {
|
|
265
|
+
const policy = service.maxParticipantsPerBooking ?? service.defaultCapacity ?? 1;
|
|
266
|
+
const seats = slot?.remainingCapacity ?? Infinity;
|
|
267
|
+
const cap = service.type === "APPOINTMENT" ? 1 : Math.min(policy, seats);
|
|
268
|
+
return Math.max(1, Number.isFinite(cap) ? cap : 1);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// ---- calendar events: sessions, offered days, course seats ---------------------------------------------
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The Query Events body for a schedule's upcoming sessions (INSTANCE events from the start of today,
|
|
275
|
+
* open-ended, oldest first), cursor-paged. Later pages send the cursor. No `timeZone` key when none
|
|
276
|
+
* is resolved — the server uses the business zone and echoes it on each event.
|
|
277
|
+
*/
|
|
278
|
+
export function sessionsRequest(scheduleId: string, { limit = SESSIONS_PAGE_SIZE, cursor, timeZone }: { limit?: number; cursor?: string; timeZone?: string } = {}): Raw {
|
|
279
|
+
return {
|
|
280
|
+
query: { filter: { scheduleId }, cursorPaging: cursor ? { limit, cursor } : { limit } },
|
|
281
|
+
fromLocalDate: toLocalDateString(startOfDay(new Date())),
|
|
282
|
+
...(timeZone ? { timeZone } : {}),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The Query Events body for the recurring (MASTER) events of several schedules at once — one batched
|
|
288
|
+
* call per listing page; a MASTER event carries the weekly `recurrenceRule.days` and, for a course,
|
|
289
|
+
* the whole course's `totalCapacity` / `remainingCapacity`.
|
|
290
|
+
*/
|
|
291
|
+
export function masterEventsRequest(scheduleIds: string[], timeZone?: string): Raw {
|
|
292
|
+
return {
|
|
293
|
+
query: { filter: { appId: BOOKINGS_APP_ID, scheduleId: { $in: scheduleIds } }, cursorPaging: { limit: 500 } },
|
|
294
|
+
recurrenceType: ["MASTER"],
|
|
295
|
+
fromLocalDate: toLocalDateString(startOfDay(new Date())),
|
|
296
|
+
...(timeZone ? { timeZone } : {}),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export const nextEventsCursor = (res: Raw | null | undefined): string | null => res?.pagingMetadata?.cursors?.next ?? null;
|
|
301
|
+
|
|
302
|
+
const diffMinutes = (start: string, end: string): number => {
|
|
303
|
+
const a = new Date(start).getTime();
|
|
304
|
+
const b = new Date(end).getTime();
|
|
305
|
+
return Number.isNaN(a) || Number.isNaN(b) ? 0 : Math.round((b - a) / 60_000);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
/** A calendar event → a Session; staff are its resources of the staff type. */
|
|
309
|
+
export function toSession(raw: Raw): Session {
|
|
310
|
+
const start: string = raw.start?.localDate ?? "";
|
|
311
|
+
const end: string = raw.end?.localDate ?? "";
|
|
312
|
+
const remaining: number | null = raw.remainingCapacity ?? null;
|
|
313
|
+
return {
|
|
314
|
+
id: rawId(raw),
|
|
315
|
+
title: raw.title ?? raw.scheduleName ?? "",
|
|
316
|
+
startLocal: start,
|
|
317
|
+
endLocal: end,
|
|
318
|
+
dayKey: start.slice(0, 10),
|
|
319
|
+
dayLabel: dayLabel(start.slice(0, 10)),
|
|
320
|
+
label: timeLabel(start),
|
|
321
|
+
durationMinutes: diffMinutes(start, end),
|
|
322
|
+
staff: ((raw.resources ?? []) as Raw[])
|
|
323
|
+
.filter((r) => r.type === STAFF_RESOURCE_TYPE_ID && rawId(r))
|
|
324
|
+
.map((r) => ({ id: rawId(r), name: r.name ?? "" })),
|
|
325
|
+
totalCapacity: raw.totalCapacity ?? null,
|
|
326
|
+
spotsLeft: remaining,
|
|
327
|
+
isFullyBooked: remaining != null && remaining <= 0,
|
|
328
|
+
isCancelled: raw.status === "CANCELLED",
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** MASTER events → the weekdays each schedule meets on, in week order, without duplicates. */
|
|
333
|
+
export function offeredDaysByScheduleId(events: Raw[]): Record<string, Weekday[]> {
|
|
334
|
+
const out: Record<string, Set<Weekday>> = {};
|
|
335
|
+
for (const e of events) {
|
|
336
|
+
if (!e.scheduleId) continue;
|
|
337
|
+
const set = (out[e.scheduleId] ??= new Set());
|
|
338
|
+
for (const d of (e.recurrenceRule?.days ?? []) as string[]) if (WEEKDAYS.includes(d as Weekday)) set.add(d as Weekday);
|
|
339
|
+
}
|
|
340
|
+
return Object.fromEntries(Object.entries(out).map(([id, set]) => [id, WEEKDAYS.filter((d) => set.has(d))]));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** Course seats from its first MASTER event; null once the course ended or when it has no recurring session yet. */
|
|
344
|
+
export function courseAvailabilityOf(events: Raw[], ended: boolean): CourseAvailability | null {
|
|
345
|
+
const first = events[0];
|
|
346
|
+
if (ended || !first) return null;
|
|
347
|
+
const spotsLeft: number | null = first.remainingCapacity ?? null;
|
|
348
|
+
return { totalCapacity: first.totalCapacity ?? null, spotsLeft, full: spotsLeft != null && spotsLeft <= 0 };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// ---- add-ons -------------------------------------------------------------------------------------------
|
|
352
|
+
|
|
353
|
+
/** The List Add-On Groups By Service Id body. */
|
|
354
|
+
export const addOnGroupsRequest = (serviceId: string): Raw => ({ serviceId });
|
|
355
|
+
|
|
356
|
+
const money = (m: Raw | undefined | null): string => {
|
|
357
|
+
const value = m?.value;
|
|
358
|
+
const currency = m?.currency;
|
|
359
|
+
if (value == null || value === "" || !currency) return "";
|
|
360
|
+
const amount = Number(value);
|
|
361
|
+
if (!Number.isFinite(amount) || amount === 0) return "";
|
|
362
|
+
const digits = amount % 1 === 0 ? 0 : 2;
|
|
363
|
+
try {
|
|
364
|
+
return new Intl.NumberFormat(undefined, { style: "currency", currency, currencyDisplay: "symbol", minimumFractionDigits: digits, maximumFractionDigits: digits }).format(amount);
|
|
365
|
+
} catch {
|
|
366
|
+
return `${amount} ${currency}`;
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/** The response's add-on groups → DTOs; translated names win over the originals (Wix's rule). */
|
|
371
|
+
export function toAddOnGroups(res: Raw | null | undefined): AddOnGroup[] {
|
|
372
|
+
return ((res?.addOnGroupsDetails ?? []) as Raw[]).map((g) => ({
|
|
373
|
+
id: g.groupId ?? "",
|
|
374
|
+
name: g.groupNameTranslated ?? g.groupName ?? "",
|
|
375
|
+
prompt: g.promptTranslated ?? g.prompt ?? "",
|
|
376
|
+
maxSelectable: g.maxNumberOfAddOns ?? null,
|
|
377
|
+
addOns: ((g.addOns ?? []) as Raw[])
|
|
378
|
+
.map(
|
|
379
|
+
(a): AddOn => ({
|
|
380
|
+
id: a.addOnId ?? "",
|
|
381
|
+
name: a.nameTranslated ?? a.name ?? "",
|
|
382
|
+
price: money(a.price),
|
|
383
|
+
priceAmount: Number(a.price?.value ?? 0) || 0,
|
|
384
|
+
currency: a.price?.currency ?? "",
|
|
385
|
+
durationMinutes: a.durationInMinutes ?? null,
|
|
386
|
+
maxQuantity: a.maxQuantity ?? null,
|
|
387
|
+
}),
|
|
388
|
+
)
|
|
389
|
+
.filter((a) => a.id),
|
|
390
|
+
}));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Selected quantities keyed by add-on id (0 / absent = not selected). */
|
|
394
|
+
export type AddOnSelection = Record<string, number>;
|
|
395
|
+
|
|
396
|
+
/** A group accepts another distinct add-on while under its `maxSelectable`. */
|
|
397
|
+
export function canSelectMore(group: AddOnGroup, selection: AddOnSelection): boolean {
|
|
398
|
+
if (group.maxSelectable == null) return true;
|
|
399
|
+
return group.addOns.filter((a) => (selection[a.id] ?? 0) > 0).length < group.maxSelectable;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** A selection with `id` set to `quantity` (clamped to the add-on's max, removed at 0); refuses a new pick when the group is full. */
|
|
403
|
+
export function withAddOnQuantity(groups: AddOnGroup[], selection: AddOnSelection, id: string, quantity: number): AddOnSelection {
|
|
404
|
+
const group = groups.find((g) => g.addOns.some((a) => a.id === id));
|
|
405
|
+
const addOn = group?.addOns.find((a) => a.id === id);
|
|
406
|
+
if (!group || !addOn) return selection;
|
|
407
|
+
const q = Math.max(0, Math.min(Math.floor(quantity), addOn.maxQuantity ?? 1));
|
|
408
|
+
const next = { ...selection };
|
|
409
|
+
if (q === 0) {
|
|
410
|
+
delete next[id];
|
|
411
|
+
return next;
|
|
412
|
+
}
|
|
413
|
+
if (!(selection[id] > 0) && !canSelectMore(group, selection)) return selection;
|
|
414
|
+
next[id] = q;
|
|
415
|
+
return next;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/** Price × quantity over the selection, formatted ("" when nothing priced is selected or currencies are missing). */
|
|
419
|
+
export function addOnsTotal(groups: AddOnGroup[], selection: AddOnSelection): string {
|
|
420
|
+
let total = 0;
|
|
421
|
+
let currency = "";
|
|
422
|
+
for (const g of groups)
|
|
423
|
+
for (const a of g.addOns) {
|
|
424
|
+
const q = selection[a.id] ?? 0;
|
|
425
|
+
if (q > 0 && a.priceAmount > 0) {
|
|
426
|
+
total += a.priceAmount * q;
|
|
427
|
+
currency ||= a.currency;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return total > 0 ? money({ value: String(total), currency }) : "";
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/** Extra minutes the selection adds to the session. */
|
|
434
|
+
export function addOnsDuration(groups: AddOnGroup[], selection: AddOnSelection): number {
|
|
435
|
+
let minutes = 0;
|
|
436
|
+
for (const g of groups) for (const a of g.addOns) minutes += (a.durationMinutes ?? 0) * (selection[a.id] ?? 0);
|
|
437
|
+
return minutes;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// ---- the booking form -------------------------------------------------------------------------------
|
|
441
|
+
|
|
442
|
+
export const FALLBACK_FIELDS: BookingFormField[] = [
|
|
443
|
+
{ target: "first_name", label: "First Name", type: "STRING", required: true },
|
|
444
|
+
{ target: "last_name", label: "Last Name", type: "STRING", required: true },
|
|
445
|
+
{ target: "email", label: "Email", type: "EMAIL", required: true },
|
|
446
|
+
];
|
|
447
|
+
|
|
448
|
+
const FIELD_TYPES = ["STRING", "EMAIL", "PHONE", "NUMBER", "URL"];
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Flat, render-ready fields from a form summary — deleted fields and non-text types dropped, values
|
|
452
|
+
* keyed by `target`. `required` comes from the full form schema (`fields[].validation.required`,
|
|
453
|
+
* keyed by target); the summary doesn't carry it. Without the schema every field counts as required.
|
|
454
|
+
* ALWAYS non-empty: contact basics when the schema is missing or unusable.
|
|
455
|
+
*/
|
|
456
|
+
export function toFormFields(summary: Raw | null | undefined, form?: Raw | null): BookingFormField[] {
|
|
457
|
+
const requiredByTarget = new Map<string, boolean>(
|
|
458
|
+
((form?.fields ?? []) as Raw[]).filter((f) => f.target).map((f) => [f.target as string, f.validation?.required === true]),
|
|
459
|
+
);
|
|
460
|
+
const fields = ((summary?.fields ?? []) as Raw[])
|
|
461
|
+
.filter((f) => !f.deleted)
|
|
462
|
+
.filter((f) => f.type && FIELD_TYPES.includes(f.type))
|
|
463
|
+
.map((f) => ({
|
|
464
|
+
target: f.target ?? "",
|
|
465
|
+
label: f.label ?? f.target ?? "",
|
|
466
|
+
type: f.type as BookingFormField["type"],
|
|
467
|
+
...(Array.isArray(f.options) && f.options.length ? { options: f.options as string[] } : {}),
|
|
468
|
+
required: requiredByTarget.get(f.target ?? "") ?? true,
|
|
469
|
+
}))
|
|
470
|
+
.filter((f) => f.target);
|
|
471
|
+
return fields.length ? fields : FALLBACK_FIELDS;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// ---- createBooking → cart → checkout-or-place --------------------------------------------------------
|
|
475
|
+
|
|
476
|
+
export interface BookingOptions {
|
|
477
|
+
staffId?: string;
|
|
478
|
+
/** The zone the slot's local times are expressed in (the SlotsPage's `timeZone`); defaults to the visitor's. */
|
|
479
|
+
timeZone?: string;
|
|
480
|
+
/** How the transport spells an entity id in a request: `_id` on the SDK, `id` on REST. */
|
|
481
|
+
idKey?: "_id" | "id";
|
|
482
|
+
/** Seats booked at once (default 1). */
|
|
483
|
+
participants?: number;
|
|
484
|
+
/** Pay the deposit only (true) or the full price now (false); sent only when the service lets the visitor choose. */
|
|
485
|
+
depositSelected?: boolean;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/** A slot's location type → the booking's: BUSINESS → OWNER_BUSINESS, CUSTOMER → CUSTOM, CUSTOM → OWNER_CUSTOM. */
|
|
489
|
+
export function bookingLocationType(type: ServiceLocation["type"] | undefined): "OWNER_BUSINESS" | "CUSTOM" | "OWNER_CUSTOM" {
|
|
490
|
+
if (type === "CUSTOMER") return "CUSTOM";
|
|
491
|
+
if (type === "CUSTOM") return "OWNER_CUSTOM";
|
|
492
|
+
return "OWNER_BUSINESS";
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* The Create Booking `booking` object. APPOINTMENT: the SLOT's scheduleId (never service.schedule.id)
|
|
497
|
+
* plus start/end as local wall-clock with the time zone; CLASS: the eventId; COURSE: no slot at all —
|
|
498
|
+
* `bookedEntity.schedule` with the service's schedule id enrols the visitor in every session. A chosen
|
|
499
|
+
* staff member is the slot's `resource`; otherwise ANY_RESOURCE of the staff type. The location is the
|
|
500
|
+
* SLOT's (id + name, type mapped) so a multi-location business books the right place; only a slot
|
|
501
|
+
* without one falls back to the bare OWNER_BUSINESS type. `depositSelected` rides only when paying
|
|
502
|
+
* ONLINE for a service that takes a deposit AND lets the visitor choose (otherwise the server default
|
|
503
|
+
* applies). `idKey` spells ids the way the transport wants them: `_id` on the SDK, `id` on REST.
|
|
504
|
+
*/
|
|
505
|
+
export function bookingRequest(
|
|
506
|
+
service: Pick<ServiceDetail, "id" | "type" | "paymentOption" | "scheduleId" | "deposit">,
|
|
507
|
+
slot: Slot | null,
|
|
508
|
+
{ staffId, timeZone = defaultTimeZone(), idKey = "id", participants = 1, depositSelected }: BookingOptions = {},
|
|
509
|
+
): Raw {
|
|
510
|
+
const deposit =
|
|
511
|
+
depositSelected !== undefined && service.paymentOption === "ONLINE" && service.deposit && service.deposit.fullUpfrontAllowed
|
|
512
|
+
? { depositSelected }
|
|
513
|
+
: {};
|
|
514
|
+
const base = { selectedPaymentOption: service.paymentOption, ...deposit, totalParticipants: Math.max(1, Math.floor(participants)) };
|
|
515
|
+
if (service.type === "COURSE" || !slot) {
|
|
516
|
+
if (!service.scheduleId) throw new Error("This course has no schedule to book.");
|
|
517
|
+
return { ...base, bookedEntity: { schedule: { scheduleId: service.scheduleId, serviceId: service.id, timezone: timeZone } } };
|
|
518
|
+
}
|
|
519
|
+
const staff = staffId ? slot.staff.find((s) => s.id === staffId) : undefined;
|
|
520
|
+
return {
|
|
521
|
+
...base,
|
|
522
|
+
bookedEntity: {
|
|
523
|
+
slot: {
|
|
524
|
+
serviceId: service.id,
|
|
525
|
+
scheduleId: slot.scheduleId ?? undefined,
|
|
526
|
+
eventId: slot.eventId ?? undefined,
|
|
527
|
+
startDate: slot.startLocal,
|
|
528
|
+
endDate: slot.endLocal,
|
|
529
|
+
timezone: timeZone,
|
|
530
|
+
...(staff
|
|
531
|
+
? { resource: { [idKey]: staff.id, name: staff.name } }
|
|
532
|
+
: { resourceSelections: [{ resourceTypeId: STAFF_RESOURCE_TYPE_ID, selectionMethod: "ANY_RESOURCE" }] }),
|
|
533
|
+
location: slot.location
|
|
534
|
+
? { ...(slot.location.id ? { [idKey]: slot.location.id } : {}), name: slot.location.name, locationType: bookingLocationType(slot.location.type) }
|
|
535
|
+
: { locationType: "OWNER_BUSINESS" },
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* The rest of the Create Booking request — the SDK's second argument, REST's top-level siblings of
|
|
543
|
+
* `booking`: the visitor's form values as the formSubmission DIRECTLY, and the notifications Wix's
|
|
544
|
+
* own flow sends (confirmation by email and SMS, an SMS reminder) — without them the "confirmation
|
|
545
|
+
* email is on its way" copy would be false.
|
|
546
|
+
*/
|
|
547
|
+
export function bookingOptions(formValues: Record<string, unknown>): Raw {
|
|
548
|
+
return {
|
|
549
|
+
participantNotification: { notifyParticipants: true, metadata: { channels: "EMAIL,SMS" } },
|
|
550
|
+
sendSmsReminder: true,
|
|
551
|
+
formSubmission: formValues,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/** The booking id out of a Create Booking response (wrapped { booking } on both transports). */
|
|
556
|
+
export const bookingIdOf = (res: Raw | null | undefined): string => rawId(res?.booking);
|
|
557
|
+
|
|
558
|
+
/** The contact the server resolved from the form, echoed on the created booking. */
|
|
559
|
+
export const contactOf = (res: Raw | null | undefined): Raw | undefined => res?.booking?.contactDetails ?? undefined;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* The Create Cart body that holds the booked seat(s): one line per BOOKING id (catalogItemId is the
|
|
563
|
+
* booking id, never the service id), the site channel, the booking's business location, and the
|
|
564
|
+
* contact the booking already resolved — so the hosted checkout doesn't ask for name and email again.
|
|
565
|
+
*/
|
|
566
|
+
export function bookingCartRequest(bookingIds: string[], contact?: Raw | null, locationId?: string | null): Raw {
|
|
567
|
+
const cart: Raw = { source: { channelType: "WEB" } };
|
|
568
|
+
if (locationId) cart.businessInfo = { locationId };
|
|
569
|
+
if (contact) {
|
|
570
|
+
cart.customerInfo = {
|
|
571
|
+
...(contact.firstName ? { firstName: contact.firstName } : {}),
|
|
572
|
+
...(contact.lastName ? { lastName: contact.lastName } : {}),
|
|
573
|
+
...(contact.phone ? { phone: contact.phone } : {}),
|
|
574
|
+
...(contact.email ? { email: contact.email } : {}),
|
|
575
|
+
};
|
|
576
|
+
if (contact.fullAddress?.country) {
|
|
577
|
+
cart.deliveryInfo = { address: { ...contact.fullAddress } };
|
|
578
|
+
cart.paymentInfo = { billingAddress: { ...contact.fullAddress } };
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return {
|
|
582
|
+
catalogItems: bookingIds.map((id) => ({ quantity: 1, catalogReference: { catalogItemId: id, appId: BOOKINGS_APP_ID } })),
|
|
583
|
+
cart,
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** The cart id out of a Create Cart response — the SDK may unwrap the cart, REST wraps it. */
|
|
588
|
+
export const cartIdOf = (res: Raw | null | undefined): string => rawId(res) || rawId(res?.cart);
|
|
589
|
+
|
|
590
|
+
/** The cart's total from a Calculate Cart response (`summary.priceSummary.total`); 0 when absent. */
|
|
591
|
+
export const cartTotal = (calc: Raw | null | undefined): number => Number(calc?.summary?.priceSummary?.total?.amount ?? 0);
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Hosted checkout is required whenever a card must be involved: always when the service carries a
|
|
595
|
+
* cancellation fee (a card goes on file); never when the calculated total is 0; never when the
|
|
596
|
+
* CART LINE says the whole payment happens offline (`paymentConfig.paymentOption ===
|
|
597
|
+
* "FULL_PAYMENT_OFFLINE"` — the server's resolution of the service's options, memberships included);
|
|
598
|
+
* otherwise yes. Free and pay-in-person bookings therefore place the order directly.
|
|
599
|
+
*/
|
|
600
|
+
export function checkoutRequired(service: Pick<ServiceDetail, "cancellationFeeEnabled">, calc: Raw | null | undefined): boolean {
|
|
601
|
+
if (service.cancellationFeeEnabled) return true;
|
|
602
|
+
if (cartTotal(calc) === 0) return false;
|
|
603
|
+
return calc?.cart?.lineItems?.[0]?.paymentConfig?.paymentOption !== "FULL_PAYMENT_OFFLINE";
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/** The Create Redirect Session body for a cart's checkout; the cart id IS the checkout id. */
|
|
607
|
+
export function checkoutRedirectRequest(cartId: string, origin: string): Raw {
|
|
608
|
+
return { ecomCheckout: { checkoutId: cartId }, callbacks: origin ? { postFlowUrl: `${origin}/` } : {} };
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/** A placed order → the confirmed result; the order id is wherever the transport put it. */
|
|
612
|
+
export function confirmedResult(bookingId: string, order: Raw | null | undefined): BookingResult {
|
|
613
|
+
return { kind: "confirmed", bookingId, orderId: order?.orderId ?? (rawId(order?.order) || null) };
|
|
614
|
+
}
|