@wix/agent-skills 1.26.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +8 -6
- package/skills/wix-app/references/APP_VALIDATION.md +5 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/SDK_MODULE_MAP.md +1 -1
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +14 -2
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
- package/skills/wix-app/references/stores/GET_PRODUCT.md +9 -1
- package/skills/wix-app/references/stores/INVENTORY.md +2 -0
- package/skills/wix-app/references/stores/QUERY.md +2 -2
- package/skills/wix-app/references/stores/WRITE.md +1 -1
- package/skills/wix-headless-kit/SKILL.md +35 -14
- package/skills/wix-headless-kit/guides/existing-site.md +12 -5
- package/skills/wix-headless-kit/guides/no-machine.md +115 -0
- package/skills/wix-headless-kit/install/attach.mjs +60 -13
- package/skills/wix-headless-kit/install/bootstrap.mjs +3 -1
- package/skills/wix-headless-kit/install/check.mjs +5 -5
- package/skills/wix-headless-kit/install/context.mjs +4 -2
- package/skills/wix-headless-kit/install/deploy.mjs +11 -5
- package/skills/wix-headless-kit/install/pins.json +8 -0
- package/skills/wix-headless-kit/install/setup.mjs +10 -8
- package/skills/wix-headless-kit/install/templates.mjs +39 -25
- package/skills/wix-headless-templates/SKILL.md +43 -0
- package/skills/wix-headless-templates/blank/project/README.md +15 -0
- package/skills/wix-headless-templates/blank/project/astro.config.mjs +20 -0
- package/skills/wix-headless-templates/blank/project/package.json +34 -0
- package/skills/wix-headless-templates/blank/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blank/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blank/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blank/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blank/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blank/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blank/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/INSTRUCTIONS.md +418 -0
- package/skills/wix-headless-templates/blog/app/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/app/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/app-astro/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/README.md +15 -0
- package/skills/wix-headless-templates/blog/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/blog/project/package-lock.json +14699 -0
- package/skills/wix-headless-templates/blog/project/package.json +39 -0
- package/skills/wix-headless-templates/blog/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blog/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blog/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blog/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blog/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/blog/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/blog/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/blog/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/blog/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/rest/authors.ts +39 -0
- package/skills/wix-headless-templates/blog/rest/comments.ts +64 -0
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +37 -0
- package/skills/wix-headless-templates/blog/rest/posts.ts +123 -0
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +79 -0
- package/skills/wix-headless-templates/blog/seed/SEED.md +81 -0
- package/skills/wix-headless-templates/blog/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +337 -0
- package/skills/wix-headless-templates/bookings/INSTRUCTIONS.md +356 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/README.md +15 -0
- package/skills/wix-headless-templates/bookings/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/bookings/project/package-lock.json +10546 -0
- package/skills/wix-headless-templates/bookings/project/package.json +41 -0
- package/skills/wix-headless-templates/bookings/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/bookings/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/bookings/rest/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/rest/services.ts +94 -0
- package/skills/wix-headless-templates/bookings/seed/SEED.md +109 -0
- package/skills/wix-headless-templates/bookings/seed/read-site.mjs +28 -0
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +407 -0
- package/skills/wix-headless-templates/cms/INSTRUCTIONS.md +399 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/README.md +15 -0
- package/skills/wix-headless-templates/cms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/cms/project/package-lock.json +9798 -0
- package/skills/wix-headless-templates/cms/project/package.json +37 -0
- package/skills/wix-headless-templates/cms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/cms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/cms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/cms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/cms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/cms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/cms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/cms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/cms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/cms/rest/collections.ts +25 -0
- package/skills/wix-headless-templates/cms/rest/items.ts +189 -0
- package/skills/wix-headless-templates/cms/seed/SEED.md +116 -0
- package/skills/wix-headless-templates/cms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +321 -0
- package/skills/wix-headless-templates/compose.mjs +83 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +348 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +68 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +465 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/app-astro/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/app-astro/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/README.md +15 -0
- package/skills/wix-headless-templates/donations/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/donations/project/package-lock.json +10266 -0
- package/skills/wix-headless-templates/donations/project/package.json +39 -0
- package/skills/wix-headless-templates/donations/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/donations/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/donations/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/donations/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/donations/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/donations/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +68 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +465 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/donations/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/donations/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/donations/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +76 -0
- package/skills/wix-headless-templates/donations/rest/donate.ts +64 -0
- package/skills/wix-headless-templates/donations/seed/SEED.md +90 -0
- package/skills/wix-headless-templates/donations/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +250 -0
- package/skills/wix-headless-templates/events/INSTRUCTIONS.md +387 -0
- package/skills/wix-headless-templates/events/app/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/app/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/app/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/app/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/app/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/app/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/README.md +15 -0
- package/skills/wix-headless-templates/events/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/events/project/package-lock.json +10497 -0
- package/skills/wix-headless-templates/events/project/package.json +39 -0
- package/skills/wix-headless-templates/events/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/events/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/events/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/events/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/events/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/project/src/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/project/src/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/project/src/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/events/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/events/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/events/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/events/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/events/rest/events.ts +112 -0
- package/skills/wix-headless-templates/events/rest/orders.ts +28 -0
- package/skills/wix-headless-templates/events/rest/registration.ts +96 -0
- package/skills/wix-headless-templates/events/seed/SEED.md +115 -0
- package/skills/wix-headless-templates/events/seed/read-site.mjs +26 -0
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +322 -0
- package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +317 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/app/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/app-astro/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/README.md +15 -0
- package/skills/wix-headless-templates/faq/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/faq/project/package-lock.json +8837 -0
- package/skills/wix-headless-templates/faq/project/package.json +37 -0
- package/skills/wix-headless-templates/faq/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/faq/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/faq/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/faq/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/project/src/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/project/src/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/faq/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/faq/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/faq/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/faq/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/faq/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/faq/rest/faq.ts +71 -0
- package/skills/wix-headless-templates/faq/seed/SEED.md +104 -0
- package/skills/wix-headless-templates/faq/seed/read-site.mjs +23 -0
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +302 -0
- package/skills/wix-headless-templates/forms/INSTRUCTIONS.md +417 -0
- package/skills/wix-headless-templates/forms/app/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/README.md +15 -0
- package/skills/wix-headless-templates/forms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/forms/project/package-lock.json +9102 -0
- package/skills/wix-headless-templates/forms/project/package.json +37 -0
- package/skills/wix-headless-templates/forms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/forms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/forms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/forms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/forms/project/src/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/forms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/forms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/forms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/forms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/forms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/forms/rest/forms.ts +37 -0
- package/skills/wix-headless-templates/forms/rest/submissions.ts +83 -0
- package/skills/wix-headless-templates/forms/seed/SEED.md +225 -0
- package/skills/wix-headless-templates/forms/seed/read-site.mjs +53 -0
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +574 -0
- package/skills/wix-headless-templates/forms/tooling/address-templates.mjs +96 -0
- package/skills/wix-headless-templates/members/INSTRUCTIONS.md +345 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/app/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/app/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/app/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/app/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/app/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/app-astro/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/README.md +15 -0
- package/skills/wix-headless-templates/members/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/members/project/package-lock.json +8892 -0
- package/skills/wix-headless-templates/members/project/package.json +37 -0
- package/skills/wix-headless-templates/members/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/members/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/members/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/members/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/project/src/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/project/src/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/project/src/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/project/src/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/members/project/src/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/project/src/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/members/project/src/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/members/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/members/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/members/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/members/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/members/rest/auth.ts +224 -0
- package/skills/wix-headless-templates/members/rest/members.ts +26 -0
- package/skills/wix-headless-templates/members/seed/SEED.md +39 -0
- package/skills/wix-headless-templates/members/seed/read-site.mjs +15 -0
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +91 -0
- package/skills/wix-headless-templates/portfolio/INSTRUCTIONS.md +315 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/README.md +15 -0
- package/skills/wix-headless-templates/portfolio/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/portfolio/project/package-lock.json +8760 -0
- package/skills/wix-headless-templates/portfolio/project/package.json +37 -0
- package/skills/wix-headless-templates/portfolio/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/portfolio/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +86 -0
- package/skills/wix-headless-templates/portfolio/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +253 -0
- package/skills/wix-headless-templates/pricing-plans/INSTRUCTIONS.md +378 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/README.md +15 -0
- package/skills/wix-headless-templates/pricing-plans/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/package-lock.json +9799 -0
- package/skills/wix-headless-templates/pricing-plans/project/package.json +38 -0
- package/skills/wix-headless-templates/pricing-plans/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/pricing-plans/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +58 -0
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-templates/pricing-plans/seed/SEED.md +93 -0
- package/skills/wix-headless-templates/pricing-plans/seed/read-site.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +301 -0
- package/skills/wix-headless-templates/rentals/INSTRUCTIONS.md +309 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/README.md +15 -0
- package/skills/wix-headless-templates/rentals/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/rentals/project/package-lock.json +10545 -0
- package/skills/wix-headless-templates/rentals/project/package.json +40 -0
- package/skills/wix-headless-templates/rentals/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/rentals/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +153 -0
- package/skills/wix-headless-templates/rentals/seed/SEED.md +95 -0
- package/skills/wix-headless-templates/rentals/seed/read-site.mjs +34 -0
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +321 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +468 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/README.md +15 -0
- package/skills/wix-headless-templates/restaurants/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/restaurants/project/package-lock.json +11038 -0
- package/skills/wix-headless-templates/restaurants/project/package.json +40 -0
- package/skills/wix-headless-templates/restaurants/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +96 -0
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +222 -0
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +102 -0
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +118 -0
- package/skills/wix-headless-templates/restaurants/seed/read-site.mjs +25 -0
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +577 -0
- package/skills/wix-headless-templates/shared/CONTENT.md +22 -0
- package/skills/wix-headless-templates/shared/CUSTOM_OPERATIONS.md +100 -0
- package/skills/wix-headless-templates/shared/DESIGN.md +37 -0
- package/skills/wix-headless-templates/shared/SUPPLIED-CONTENT.md +27 -0
- package/skills/wix-headless-templates/shared/app/styles/global.css +57 -0
- package/skills/wix-headless-templates/shared/app/wix/config.ts +16 -0
- package/skills/wix-headless-templates/shared/app/wix/media.ts +106 -0
- package/skills/wix-headless-templates/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-templates/shared/app/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +69 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/INSTRUCTIONS.md +194 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchBox.tsx +136 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchHit.tsx +50 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchResults.tsx +300 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSearch.ts +31 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSuggest.ts +26 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-core.ts +520 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-store.ts +235 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search.ts +80 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/suggest-store.ts +178 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/types.ts +158 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app-astro/pages/search.astro +33 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +82 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +43 -0
- package/skills/wix-headless-templates/shared/rest/client.ts +155 -0
- package/skills/wix-headless-templates/shared/rest/config.ts +4 -0
- package/skills/wix-headless-templates/shared/rest/media.ts +92 -0
- package/skills/wix-headless-templates/shared/seed/images.mjs +183 -0
- package/skills/wix-headless-templates/shared/seed/read-site.mjs +97 -0
- package/skills/wix-headless-templates/shared/seed/site-context.mjs +70 -0
- package/skills/wix-headless-templates/shared/seed/site.mjs +48 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +47 -0
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +685 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart.ts +186 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/app-astro/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/README.md +15 -0
- package/skills/wix-headless-templates/storefront/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/storefront/project/package-lock.json +10786 -0
- package/skills/wix-headless-templates/storefront/project/package.json +41 -0
- package/skills/wix-headless-templates/storefront/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/storefront/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart.ts +186 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/storefront/rest/cart.ts +183 -0
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +267 -0
- package/skills/wix-headless-templates/storefront/seed/SEED.md +169 -0
- package/skills/wix-headless-templates/storefront/seed/read-site.mjs +38 -0
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +839 -0
- package/skills/wix-manage/SKILL.md +11 -7
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +1 -1
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +206 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +17 -24
- package/skills/wix-manage/references/sites/create-headless-site.md +2 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +281 -171
- package/skills/wix-manage/references/stores/update-product-with-options.md +1 -1
- package/skills/wix-headless/entry/bootstrap.mjs +0 -156
- package/skills/wix-headless/entry/skill.md +0 -78
- package/skills/wix-headless-kit/cold-start/bootstrap.mjs +0 -156
- package/skills/wix-headless-kit/cold-start/cold-start.md +0 -111
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +0 -423
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# Rentals — playbook
|
|
2
|
+
|
|
3
|
+
The rental machinery ships as files — the rental catalog (Bookings services carrying the Wix
|
|
4
|
+
Rentals app id, paged), the two availability flows (hourly: a start, then the lengths that start
|
|
5
|
+
allows; daily: a start day, then the consecutive days it can run into), the server-priced quote for
|
|
6
|
+
a start and length, the schema-driven booking form, and the exact `createBooking → cart →
|
|
7
|
+
checkout-or-place` sequence with the rental's resource and the customer's end, typed end-to-end.
|
|
8
|
+
**The presentation is yours**: you design and implement the rental card, the listing surface, and
|
|
9
|
+
the rental surface on the shipped hooks/DTOs, plus the home page and the brand. You never write
|
|
10
|
+
rental logic; you never skip designing.
|
|
11
|
+
|
|
12
|
+
Wix Rentals has no API of its own: a rental is a Wix Bookings service with five field values (the
|
|
13
|
+
Rentals app id, a resource type and its resources, the Rentals form, a duration range). The shipped
|
|
14
|
+
code knows this so you don't have to; the bookings vertical is NOT needed alongside this one (the
|
|
15
|
+
seed installs the Wix Bookings app itself, as the availability engine), and a site that runs both
|
|
16
|
+
keeps them apart by the app id.
|
|
17
|
+
|
|
18
|
+
## The file map (deployed into `src/`)
|
|
19
|
+
|
|
20
|
+
**On Astro and React the shipped files are tested and work as they are** — this table and the
|
|
21
|
+
contracts below are everything you need to use them, so don't spend the run reading their source;
|
|
22
|
+
wire them and build your surfaces. Reading them is the right move when something is off (a runtime
|
|
23
|
+
error, a field this playbook doesn't cover) or when the brief wants a behaviour they don't offer —
|
|
24
|
+
then read the file that owns it and change or extend it. On `lib`, `static`, and a port the
|
|
25
|
+
components don't deploy at all, and each wiring section below opens with the files to read before
|
|
26
|
+
writing their equivalents. Files you edit: `SiteLayout.astro`, `styles/global.css`, and the two
|
|
27
|
+
pages' island imports. Files you **create**: your listing and rental components, plus your home page.
|
|
28
|
+
|
|
29
|
+
| file | what it is |
|
|
30
|
+
|---|---|
|
|
31
|
+
| `wix/config.ts` · `wix/sdk.ts` | shared auth seam (deploy configures it — nothing to set by hand) |
|
|
32
|
+
| `wix/media.ts` · `wix/money.ts` | `imgAttrs(url, sizes)` — every `<img>` attribute for a DTO image: `<img {...imgAttrs(r.imageUrl, "33vw")} alt={r.name} />`; `imgSrc()` / `imgSrcSet()` / `formatMoney()` underneath |
|
|
33
|
+
| `wix/rentals/types.ts` | the DTOs (`RentalSummary`, `RentalDetail`, `RentalLocation`, `StartOption`, `EndOption`, `RentalQuote`, `RentalFormField`, `RentalResult`) — contracts below |
|
|
34
|
+
| `wix/rentals/rentals.ts` | `fetchRentals` (one page), `fetchRentalBySlug`, `fetchStarts`, `fetchEndOptions`, `fetchQuote`, `fetchRentalForm`, `rentResource` — the transport; the rules and DTO mappers (the five rentals values, rate and range labels, the request bodies, the daily walk, checkout-or-place) are in `rentals-core.ts` beside it (shared with the REST layer) |
|
|
35
|
+
| `wix/rentals/rentals-store.ts` · `rental-flow-store.ts` | the listing and rental state machines, framework-free (`createRentalsStore()`, `createRentalFlowStore(rental)` — `getState`/`subscribe` + actions, one instance per surface); the hooks below bind them to React, every other stack uses them directly |
|
|
36
|
+
| `hooks/rentals/useRentals.ts` | React binding of `rentals-store.ts`: listing + paging — contract below |
|
|
37
|
+
| `hooks/rentals/useRentalFlow.ts` | React binding of `rental-flow-store.ts`: the whole rental state machine — contract below |
|
|
38
|
+
| `components/rentals/RentalsView.tsx` (+ `RentalCard`) · `RentalBookingView.tsx` | **REFERENCE implementations** — correct, plain; build your own instead of shipping them |
|
|
39
|
+
| `styles/global.css` | the design system: Tailwind v4 + the `@theme` token block (shared across verticals) |
|
|
40
|
+
|
|
41
|
+
Astro stack additionally gets:
|
|
42
|
+
|
|
43
|
+
| file | what it is |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `layouts/SiteLayout.astro` | site chrome — **yours to brand** (keep the `seo-tags` slot + global.css import). If another vertical is also deployed, its layout won — add a Rentals nav link there |
|
|
46
|
+
| `pages/rentals.astro` | SSR listing — **keep the frontmatter**, swap the island import to YOUR component |
|
|
47
|
+
| `pages/rentals/[slug].astro` | SSR detail + rental with owner-editable SEO — **keep the frontmatter and the SEO pieces** (`wixMetadata`, `loadSEOTagsServiceConfig`, `<SEO.Tags>`) exactly; swap the island import. The rental island stays `client:only="react"` (availability is time-zone-specific) |
|
|
48
|
+
|
|
49
|
+
## What you build — the design job
|
|
50
|
+
|
|
51
|
+
1. **The rental card + listing surface** — your tile (image, "By the hour" / "By the day", the
|
|
52
|
+
rate and range presentation) and rhythm, with skeletons while loading and an honest empty
|
|
53
|
+
state — on `useRentals`.
|
|
54
|
+
2. **The rental surface** — the start picker one day at a time (a strip of the days that have
|
|
55
|
+
availability, then that day's times bucketed into morning, afternoon and evening; a daily rental
|
|
56
|
+
shows the strip alone) with window paging at the strip's ends, the length picker for the chosen
|
|
57
|
+
start, the quote, the schema-driven form, the CTA labelled from `ctaState`, and the confirmed
|
|
58
|
+
state — on `useRentalFlow`, which owns ALL rental logic; you own how it looks.
|
|
59
|
+
3. **The home page** — hero, featured rentals (fetch in frontmatter → your components), brand story.
|
|
60
|
+
|
|
61
|
+
Plus the **theme** (`@theme` block, one edit) and the **chrome** (`SiteLayout`, one pass).
|
|
62
|
+
Style everything with Tailwind utilities on the tokens.
|
|
63
|
+
|
|
64
|
+
### What a complete rentals site shows (recommended defaults)
|
|
65
|
+
|
|
66
|
+
Defaults for a brief that says nothing about them; the prompt wins where it differs. Look at the
|
|
67
|
+
rentals before designing (hourly vs daily, how many units, rates, images) and design for this
|
|
68
|
+
business, not a stereotype of its category. Then, by default:
|
|
69
|
+
|
|
70
|
+
- **Home:** what is for rent and one rental action in the first screen; real rentals under truthful
|
|
71
|
+
headings; not a repeat of the listing.
|
|
72
|
+
- **Listing:** a real rental card — image, name, unit badge, `rateLabel` ("$40 / hour") and
|
|
73
|
+
`rangeLabel` ("1 to 8 hours"), link — in the first screen; nothing when a label is ""; a
|
|
74
|
+
"Load more" affordance while `hasMore`; `rentals === null` → skeleton tiles, `[]` → your honest
|
|
75
|
+
empty state.
|
|
76
|
+
- **Rental page:** name, rate, and the first available day's starts in the first screen **at 390px
|
|
77
|
+
wide too** — the image is a bounded band on a phone, not a full-screen hero. **One day at a
|
|
78
|
+
time:** a horizontal strip of the days in `days` (weekday and day number), the active day's
|
|
79
|
+
starts under it bucketed into morning / afternoon / evening, and the window pagers at the strip's
|
|
80
|
+
ends (`windowDays` is 7 for hourly, 14 for daily). Never list every day's times at once: a
|
|
81
|
+
rental's resources are usually bookable around the clock, so a week is over three hundred chips
|
|
82
|
+
and the form ends up below a wall of numbers. For a daily rental the strip is the start picker (a
|
|
83
|
+
day is a start). Switching day drops a start chosen on another day. "Times in {timeZone}" for an
|
|
84
|
+
hourly rental once known; a start chip keyed by `start.key`, disabled when `!bookable`; a window
|
|
85
|
+
with no starts says so and offers the next one; once a start is chosen, the length picker from `endOptions`
|
|
86
|
+
(`null` → loading, `[]` → "this start can't be rented for the minimum length — pick another");
|
|
87
|
+
once a length is chosen, the quote (`quote === null` → "calculating", `quote.total` → the total,
|
|
88
|
+
"" → omit); the form under the pickers, the CTA under the form.
|
|
89
|
+
- **CTA label:** from `ctaState` — "Rent" / "Request to rent" — then the money: "— free" when
|
|
90
|
+
`rental.free`, "· {quote.total}" once quoted, else "· {rateLabel}"; nothing when both are "".
|
|
91
|
+
- **Confirmed state:** rendered only from `confirmed`; a visitor returning from the hosted checkout
|
|
92
|
+
is not a success signal. Its copy follows `ctaState`: "You're all set" + "a confirmation email is
|
|
93
|
+
on its way" for `rent`; "Request sent" + "you'll hear back once it's approved" for
|
|
94
|
+
`requestToRent` — never promise a confirmed rental for a request.
|
|
95
|
+
- **A slug that resolves to nothing** shows only the not-found state.
|
|
96
|
+
- **Copy:** nothing the owner didn't supply — no invented reviews, availability pressure, or
|
|
97
|
+
guarantees; no Wix IDs or technical words in visible text.
|
|
98
|
+
|
|
99
|
+
### The contracts your components consume
|
|
100
|
+
|
|
101
|
+
Everything you need to build on the shipped code; read the source only when something is off.
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
// RentalSummary (tiles) — display-ready, every money value already a string ("" = unknown, omit it):
|
|
105
|
+
// { id, slug, name, tagLine, unit: "HOUR"|"DAY",
|
|
106
|
+
// ratePerUnit /* "$40" | "Free" | "" */, rateLabel /* "$40 / hour" | "$40 / day" | "Free" | "" */,
|
|
107
|
+
// rateAmount, currency /* numbers for the store's fallback math — never render these */,
|
|
108
|
+
// minUnits, maxUnits /* in the unit; hours may be 0.5 */, rangeLabel /* "1 to 8 hours" | "3 days" | "" */,
|
|
109
|
+
// imageUrl /* https or "" */, resourceTypeId|null, resourceCount,
|
|
110
|
+
// locations: [{ id|null, name, type: "BUSINESS"|"CUSTOM"|"CUSTOMER" }],
|
|
111
|
+
// onlineBookingEnabled, requiresManualApproval, free }
|
|
112
|
+
// RentalDetail adds: description, formId|null, paymentOption, cancellationFeeEnabled, scheduleId|null.
|
|
113
|
+
|
|
114
|
+
// useRentals({ initialRentals?, initialHasMore?, pageSize? = 20 }) →
|
|
115
|
+
// { rentals: RentalSummary[]|null /* null = loading → skeletons */, hasMore, loadingMore, loadMore(), error }
|
|
116
|
+
|
|
117
|
+
// useRentalFlow(rental: RentalDetail) →
|
|
118
|
+
// { days: [{ dayKey, dayLabel, starts: StartOption[] }] | null, // day-grouped; null = loading; [] = none in the window
|
|
119
|
+
// windowStart, windowDays, nextWindow(), prevWindow(), jumpTo(dayKey), // paging on day boundaries (prev clamps to today)
|
|
120
|
+
// timeZone|null, // the business zone the times are in (from the response)
|
|
121
|
+
// selectedStart, setSelectedStart(start|null), // ignores a !bookable start; clears the length and the quote
|
|
122
|
+
// // StartOption = { key, startLocal, dayKey, label /* "9:00 AM" | "Mon, Oct 5" */, bookable, location|null,
|
|
123
|
+
// // resource: { id, name } | null, scheduleId|null }
|
|
124
|
+
// endOptions: EndOption[] | null, selectedEnd, setSelectedEnd(end|null), // null = loading (or no start yet); [] = none
|
|
125
|
+
// // EndOption = { endLocal, units, label /* "2 hours · until 11:00 AM" | "3 days · until Wed, Oct 7" */ }
|
|
126
|
+
// quote: { total, totalAmount, units, unit } | null, // the server's price for start + length; null until both chosen and priced
|
|
127
|
+
// formFields: [{ target, label, type, options?, required }], // never empty (contact-basics fallback); only required ones gate canRent
|
|
128
|
+
// values, setValue(target, value), // inputs write here, keyed by target
|
|
129
|
+
// ctaState: "rent"|"requestToRent", canRent, // label the CTA from ctaState; gate it on canRent
|
|
130
|
+
// rent(): Promise<RentalResult>, // paid → the browser navigates to the Wix checkout;
|
|
131
|
+
// renting, confirmed, error } // free/offline → confirmed is set (REAL success)
|
|
132
|
+
// A window change clears selectedStart, selectedEnd and quote and sets days to null while the new window loads.
|
|
133
|
+
// rent() rejects on refusal (start taken, length refused, invalid form) AND records .error — render it beside the CTA.
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### The reference files for stacks where the components don't deploy
|
|
137
|
+
|
|
138
|
+
On `lib`, `static`, and a port, nothing under `components/` or `hooks/` arrives. The state machines
|
|
139
|
+
behind the hooks do arrive — `wix/rentals/rentals-store.ts`, `rental-flow-store.ts` — so you never
|
|
140
|
+
rewrite them: create a store per surface, `subscribe`, render from `getState()`, call its actions.
|
|
141
|
+
Their `RentalsState` / `RentalFlowState` interfaces are the render contract; read those. What you
|
|
142
|
+
write is the rendering — tiles, the start and length pickers, the form, the CTA — and for that read
|
|
143
|
+
these first; they are tested code for exactly that behaviour:
|
|
144
|
+
|
|
145
|
+
1. `components/rentals/RentalBookingView.tsx` — the rental surface as working code: the day strip
|
|
146
|
+
(the days with availability, pagers at its ends), the active day's starts in morning / afternoon
|
|
147
|
+
/ evening buckets for an hourly rental, the strip as the start picker for a daily one, the
|
|
148
|
+
time-zone line,
|
|
149
|
+
the length picker with its loading and empty states, the quote line, one input per `formFields`
|
|
150
|
+
entry typed from its `type` (a `<select>` when it has `options`), the CTA disabled until
|
|
151
|
+
`canRent` and labelled from `ctaState` + the money, `error` inline, and the confirmed state
|
|
152
|
+
rendered only from `confirmed` with copy by `ctaState`.
|
|
153
|
+
2. `components/rentals/RentalsView.tsx` — skeleton tiles while `rentals === null`, the honest empty
|
|
154
|
+
state, "Load more" while `hasMore`, and `RentalCard`: image with the unit badge, name, tagLine,
|
|
155
|
+
"rate · range", locations.
|
|
156
|
+
|
|
157
|
+
All under `templates/rentals/app/`.
|
|
158
|
+
|
|
159
|
+
### Wiring — Astro (default)
|
|
160
|
+
|
|
161
|
+
1. Set the `@theme` tokens (one edit); brand `SiteLayout.astro` (one pass — merge into the other
|
|
162
|
+
vertical's layout instead if several are deployed).
|
|
163
|
+
2. Write your components under `src/components/rentals/` (new names — don't overwrite the
|
|
164
|
+
references), swap the island imports in `pages/rentals.astro` and `pages/rentals/[slug].astro`.
|
|
165
|
+
Listing island: `client:load` with the SSR props; rental island: `client:only="react"`.
|
|
166
|
+
**Author your surfaces in as few messages as possible** — batch multiple Writes per message.
|
|
167
|
+
3. Write `pages/index.astro` (home) — it exists from the scaffold; Read it before overwriting.
|
|
168
|
+
|
|
169
|
+
### Wiring — another JS framework (`--stack lib`: Vue, Svelte, Solid, plain Vite)
|
|
170
|
+
|
|
171
|
+
Read the reference files listed above before writing any surface.
|
|
172
|
+
|
|
173
|
+
`deploy.mjs rentals --stack lib` put the data layer in `src/wix/` and nothing else: `sdk.ts` (the
|
|
174
|
+
visitor client, configured with the public client id), `media.ts`, `money.ts`, and `wix/rentals/` —
|
|
175
|
+
`rentals.ts`, `types.ts`, `rentals-core.ts`, and the two stores. None of it is React. The hooks and
|
|
176
|
+
components don't ship on this stack; the stores replace the hooks, and you write the components in
|
|
177
|
+
your framework to the contracts on this page:
|
|
178
|
+
|
|
179
|
+
- bind the stores with your framework's external-store primitive (Vue: `shallowRef` updated in
|
|
180
|
+
`subscribe`; Svelte: `readable(store.getState(), (set) => store.subscribe(() => set(store.getState())))`;
|
|
181
|
+
Solid: a signal set in `subscribe`). `createRentalsStore(options)` per listing (`start()` when
|
|
182
|
+
mounted, `stop()` when unmounted), `createRentalFlowStore(rental)` per rental surface (the
|
|
183
|
+
`RentalDetail` from `fetchRentalBySlug`; `start()` in the browser only). State in, actions out —
|
|
184
|
+
exactly the hooks' contracts above;
|
|
185
|
+
- your tiles, pickers, form, and CTA to the defaults in "What a complete rentals site shows" — the
|
|
186
|
+
shipped `RentalBookingView.tsx` and `RentalsView.tsx` are readable as behaviour specs.
|
|
187
|
+
|
|
188
|
+
Routes `/rentals`, `/rentals/:slug` (via `fetchRentalBySlug`, null → your 404); dev server on 4321;
|
|
189
|
+
a static build goes through `npx @wix/cli@latest release` with `site.outputDirectory` pointing at
|
|
190
|
+
the build folder, an SSR build is hosted by you. Rental-page tags from the `RentalDetail`.
|
|
191
|
+
|
|
192
|
+
### Wiring — static site (`--stack static`, no bundler)
|
|
193
|
+
|
|
194
|
+
Read the reference files listed above before writing any surface.
|
|
195
|
+
|
|
196
|
+
`deploy.mjs rentals --stack static --out site` put the REST layer in `site/js/wix/` (browser ESM,
|
|
197
|
+
the `.ts` beside each `.js` for reading). Everything the visitor loads lives under `site/` — pages,
|
|
198
|
+
styles, `js/` — and `wix.config.json`'s `site.outputDirectory` is `"./site"`; the project root
|
|
199
|
+
(config, plan, seed output) is never the upload. Same function names and DTOs as the table above,
|
|
200
|
+
so the contracts on this page hold unchanged: `fetchRentals`, `fetchRentalBySlug`, `fetchStarts`,
|
|
201
|
+
`fetchEndOptions`, `fetchQuote`, `fetchRentalForm`, `rentResource` from `./js/wix/rentals.js`. The
|
|
202
|
+
state machines ship too: `createRentalsStore` from `./js/wix/rentals-store.js` and
|
|
203
|
+
`createRentalFlowStore(rental)` from `./js/wix/rental-flow-store.js` (`fetchRentalBySlug(slug)`
|
|
204
|
+
first, then the store). No components ship — you write the rendering in plain JS: one render
|
|
205
|
+
function per surface that reads `getState()`, called from `subscribe`, with the surface's controls
|
|
206
|
+
calling the store's actions. `rent()` navigates the full document to the hosted checkout for a paid
|
|
207
|
+
rental on its own (`window.location.origin` must be on the OAuth app's allowed domains so checkout
|
|
208
|
+
can return); for a free or pay-in-person rental it sets `confirmed`. Pages are `rentals.html` and
|
|
209
|
+
`rental.html?slug=…` (Wix static hosting serves files, not directories). Set `document.title` and the
|
|
210
|
+
meta description from the `RentalDetail` once it loads. The visitor token persists in `localStorage`
|
|
211
|
+
on its own; never mint per page. `npx @wix/cli@latest release` uploads `site/`.
|
|
212
|
+
|
|
213
|
+
### Wiring — server-rendered, another language (Flask, Laravel, Rails, …)
|
|
214
|
+
|
|
215
|
+
Read the reference files listed above before writing any surface.
|
|
216
|
+
|
|
217
|
+
Run `deploy.mjs rentals --stack static` in the project folder anyway: `js/wix/` is both the
|
|
218
|
+
browser-side code and the readable spec. **Reads on the server:** port `js/wix/rentals.ts`'s two
|
|
219
|
+
catalog reads and `rentals-core.ts`'s mappers to your language (a page of rentals, one rental),
|
|
220
|
+
returning the same DTO shapes as dicts, one anonymous visitor token per process for these public
|
|
221
|
+
reads (mint and refresh per `client.ts`), and render the listing and the rental page in your
|
|
222
|
+
templates so names and rates are in the HTML. **Renting in the browser:** the rental surface on
|
|
223
|
+
`./js/wix/rental-flow-store.js` with the rendered `RentalDetail` (a JSON script tag, or
|
|
224
|
+
`fetchRentalBySlug(slug)` from `./js/wix/rentals.js`), exactly as the static wiring above — the
|
|
225
|
+
browser owns the visitor's token, so the booking, its cart, and the checkout redirect are the
|
|
226
|
+
visitor's. Routes stay `/rentals`, `/rentals/<slug>`. Add your public https origin to the OAuth
|
|
227
|
+
app's allowed domains before checkout can return.
|
|
228
|
+
|
|
229
|
+
**Pre-rendered (any static-site generator) → Wix-hosted.** Same port for the reads at build time;
|
|
230
|
+
the generator emits a page for every slug `fetchRentals()` returns, following `hasMore`. Run
|
|
231
|
+
`deploy.mjs rentals --stack static --out <build dir>`, point `site.outputDirectory` at that folder,
|
|
232
|
+
`wix release`. Give the templates one root-relative base path to `js/wix/`. Availability and
|
|
233
|
+
renting still run client-side on the rental page through `createRentalFlowStore()`.
|
|
234
|
+
|
|
235
|
+
### Wiring — React SPA (Vite etc.)
|
|
236
|
+
|
|
237
|
+
Import `./styles/global.css` once at the app entry (needs `@tailwindcss/vite` in the vite plugins —
|
|
238
|
+
deploy added the dep). Routes: `/rentals` → your listing; `/rentals/:slug` → fetch with
|
|
239
|
+
`fetchRentalBySlug(slug)` client-side, then your rental surface on `useRentalFlow(rental)`. Deploy
|
|
240
|
+
wrote the public client id into `wix/config.ts`; nothing else to configure.
|
|
241
|
+
|
|
242
|
+
Routes on Wix hosting: the host serves files only, so a clean route answers 404 when loaded
|
|
243
|
+
directly — hash routes, or one HTML file per route, decided before the first route is written.
|
|
244
|
+
|
|
245
|
+
## Hard rules
|
|
246
|
+
|
|
247
|
+
- **Rental logic only through the shipped exports** — `useRentalFlow`/`rentResource` own the
|
|
248
|
+
sequence (createBooking with the start's resource and the customer's END → cart holds it, carries
|
|
249
|
+
the contact and the Rentals app id → checkout-or-place decided from the calculated cart), the
|
|
250
|
+
payment-option derivation, the price preview's three fields, the daily walk, the notifications,
|
|
251
|
+
and the formSubmission shape. Never re-derive any of it, never call `confirmBooking`, never hand-
|
|
252
|
+
build a checkout URL, never add a duration to a start yourself.
|
|
253
|
+
- **Hourly and daily are two flows, one contract** — branch your rendering on `rental.unit`; the
|
|
254
|
+
store already branches the calls (end options are hourly-only; a daily rental's lengths come
|
|
255
|
+
from the walk over `days`).
|
|
256
|
+
- **The CTA and the confirmed copy follow `ctaState`** — "Request to rent" / "Request sent" for
|
|
257
|
+
`requestToRent`. A request is not a confirmed rental.
|
|
258
|
+
- **Money strings are final** — render `rateLabel`, `ratePerUnit`, `quote.total` as given; "" means
|
|
259
|
+
unknown, so omit it. Never multiply `rateAmount` yourself for display; the quote is the server's.
|
|
260
|
+
- **The form is schema-driven** — render `formFields` as given (values keyed by `target`); never
|
|
261
|
+
hardcode field names beyond what the fallback already guarantees.
|
|
262
|
+
- **Gate the CTA on `canRent`** and surface `error` — `rent()` can reject (start taken, length
|
|
263
|
+
refused, validation); that message is for the visitor.
|
|
264
|
+
- **The confirmed state must reflect REAL success**: render it only from `confirmed`. A visitor
|
|
265
|
+
returning from the hosted checkout redirect is NOT a success signal.
|
|
266
|
+
- Where the shipped components deploy (Astro, React): theme via the `@theme` tokens, and your
|
|
267
|
+
markup uses Tailwind utilities on the same tokens. Where they don't (`lib`, `static`, a port):
|
|
268
|
+
style with whatever your stack does well, on one token set of your own.
|
|
269
|
+
- Live data or an honest empty state — never mock rentals, starts, or lengths.
|
|
270
|
+
- Keep the detail page's SEO pieces exactly as shipped (Astro).
|
|
271
|
+
- **Browsing and renting need no login.** They run on the Wix visitor session the shipped client
|
|
272
|
+
already holds; don't gate rentals behind sign-in unless the brief asks for accounts.
|
|
273
|
+
- **Call every hook before any conditional return.** Hooks first, branches after.
|
|
274
|
+
|
|
275
|
+
## Point the user to their dashboard
|
|
276
|
+
|
|
277
|
+
Hand the owner these links — `{siteId}` is `siteId` in `wix.config.json` (the deploy JSON prints it
|
|
278
|
+
as `dashboardUrl`). Rentals live in the Rentals dashboard page, not the Bookings services page: that
|
|
279
|
+
page lists only services carrying the Bookings app id, so on a rentals site it shows an empty "Add a
|
|
280
|
+
New Service" wizard. Never send the owner there for their rentals.
|
|
281
|
+
|
|
282
|
+
| page | `https://manage.wix.com/dashboard/{siteId}/` + |
|
|
283
|
+
|---|---|
|
|
284
|
+
| Rentals (the rooms, their prices and hours) | `wix-rental/rental-list` |
|
|
285
|
+
| Bookings list | `bookings/bookings/bookings-list` |
|
|
286
|
+
| Calendar | `bookings/calendar` |
|
|
287
|
+
| Booking form | `bookings/settings/booking-form-page` |
|
|
288
|
+
| Policies | `bookings/settings/policies` |
|
|
289
|
+
| Accept payments — connect a payment method | `wix-cashier/payments` |
|
|
290
|
+
| Upgrade the plan — online payments need premium | full URL: `https://www.wix.com/upgrade/website?metaSiteId={siteId}` |
|
|
291
|
+
|
|
292
|
+
Completing a rental online — free rentals included — needs a payment method on the site ("manual
|
|
293
|
+
payments" is enough for free and pay-in-person); taking real online payments also needs a premium
|
|
294
|
+
plan. Until then `rent()` surfaces "the site cannot take online bookings yet" and hosted checkout says
|
|
295
|
+
"We can't accept online payments." Hand both links above in the close; don't treat it as a code failure. Resources are seeded bookable around the clock;
|
|
296
|
+
opening hours per resource are dashboard work (and split a multi-day rental into one booking per
|
|
297
|
+
day) — say so.
|
|
298
|
+
|
|
299
|
+
## Seeding
|
|
300
|
+
|
|
301
|
+
Per `seed/SEED.md` — plain-data `plan.json` into `seed-rentals.mjs` from the project root. Seed
|
|
302
|
+
resource types with their units and 3–4 rentals that exercise the UI (an hourly one and a daily one
|
|
303
|
+
where the business allows, a free or approval-gated one where it fits, an image per rental).
|
|
304
|
+
|
|
305
|
+
A fresh Rentals install carries Wix's own sample rental ("Conference room", $45 an hour), and the
|
|
306
|
+
listing shows it next to the seeded ones. Never delete it, or anything else on the site: the result's
|
|
307
|
+
`preexisting[]` names what the listing shows, and the closing message says so with the Rentals
|
|
308
|
+
dashboard link so the owner removes it there — never release a kayak shop that rents a conference
|
|
309
|
+
room without telling the owner.
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// REFERENCE rental surface: the start picker ONE DAY AT A TIME (a strip of the days that have
|
|
2
|
+
// availability, then that day's times bucketed into morning / afternoon / evening; a daily rental
|
|
3
|
+
// shows the strip alone, since a day IS the start), window paging at the ends of the strip, the
|
|
4
|
+
// time-zone line, the length picker for the chosen start, the server-priced quote, the schema-driven
|
|
5
|
+
// form, and the CTA labelled from ctaState — on the @theme tokens. A rental's resources are usually
|
|
6
|
+
// bookable around the clock, so a week of starts is over three hundred chips; listing them all
|
|
7
|
+
// buries the form and reads as a wall of numbers. Correct and complete; per the skill's model you
|
|
8
|
+
// design and build your own on useRentalFlow. Mount client:only — availability is time-zone-specific.
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
import { useRentalFlow } from "../../hooks/rentals/useRentalFlow";
|
|
11
|
+
import type { RentalDetail, StartOption } from "../../wix/rentals/types";
|
|
12
|
+
|
|
13
|
+
const chip = (selected: boolean, disabled = false) =>
|
|
14
|
+
`rounded-control border px-4 py-1.5 text-sm transition-colors ${
|
|
15
|
+
disabled ? "cursor-not-allowed border-border text-muted-foreground line-through opacity-60" : selected ? "border-primary bg-primary text-primary-foreground" : "border-border text-foreground hover:bg-secondary"
|
|
16
|
+
}`;
|
|
17
|
+
const dayTile = (selected: boolean, disabled = false) =>
|
|
18
|
+
`w-[68px] shrink-0 rounded-md border px-1 py-2 text-center transition-colors ${
|
|
19
|
+
disabled ? "cursor-not-allowed border-border text-muted-foreground opacity-60" : selected ? "border-primary bg-primary text-primary-foreground" : "border-border text-foreground hover:bg-secondary"
|
|
20
|
+
}`;
|
|
21
|
+
const pager = "w-[68px] shrink-0 rounded-md border border-border px-1 py-2 text-center text-xs leading-tight text-foreground transition-colors hover:bg-secondary";
|
|
22
|
+
|
|
23
|
+
const input = "w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-shadow focus:ring-2 focus:ring-primary";
|
|
24
|
+
const heading = "mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground";
|
|
25
|
+
|
|
26
|
+
// startLocal is "YYYY-MM-DDThh:mm:ss" (no zone): chars 11–13 are the local hour, no Date parsing needed.
|
|
27
|
+
const hourOf = (s: StartOption): number => Number(s.startLocal.slice(11, 13));
|
|
28
|
+
const BUCKETS: { label: string; test: (h: number) => boolean }[] = [
|
|
29
|
+
{ label: "Morning", test: (h) => h < 12 },
|
|
30
|
+
{ label: "Afternoon", test: (h) => h >= 12 && h < 17 },
|
|
31
|
+
{ label: "Evening", test: (h) => h >= 17 },
|
|
32
|
+
];
|
|
33
|
+
const fmtDay = (dayKey: string, opts: Intl.DateTimeFormatOptions): string => {
|
|
34
|
+
try {
|
|
35
|
+
return new Date(`${dayKey}T12:00:00`).toLocaleDateString(undefined, opts);
|
|
36
|
+
} catch {
|
|
37
|
+
return dayKey;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default function RentalBookingView({ rental }: { rental: RentalDetail }) {
|
|
42
|
+
const { days, windowDays, nextWindow, prevWindow, timeZone, selectedStart, setSelectedStart, endOptions, selectedEnd, setSelectedEnd, quote, formFields, values, setValue, ctaState, canRent, rent, renting, confirmed, error } =
|
|
43
|
+
useRentalFlow(rental);
|
|
44
|
+
const [activeDay, setActiveDay] = useState<string | null>(null);
|
|
45
|
+
|
|
46
|
+
// Follow the data: land on the first day with availability, and don't strand the view on a day
|
|
47
|
+
// that left when the window moved.
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (days && days.length && !days.some((d) => d.dayKey === activeDay)) setActiveDay(days[0].dayKey);
|
|
50
|
+
}, [days, activeDay]);
|
|
51
|
+
|
|
52
|
+
const daily = rental.unit === "DAY";
|
|
53
|
+
const verb = ctaState === "requestToRent" ? "Request to rent" : "Rent";
|
|
54
|
+
|
|
55
|
+
if (confirmed) {
|
|
56
|
+
return (
|
|
57
|
+
<div className="rounded-lg border border-border bg-secondary p-8 text-center">
|
|
58
|
+
<p className="text-lg font-semibold">{ctaState === "requestToRent" ? "Request sent" : "You're all set!"}</p>
|
|
59
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
60
|
+
{rental.name}
|
|
61
|
+
{selectedStart && selectedEnd ? ` — ${selectedStart.label}, ${selectedEnd.label}` : ""}.{" "}
|
|
62
|
+
{ctaState === "requestToRent" ? "You'll hear back once the request is approved." : "A confirmation email is on its way."}
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const current = days?.find((d) => d.dayKey === activeDay) ?? days?.[0] ?? null;
|
|
69
|
+
const buckets = current ? BUCKETS.map((b) => ({ label: b.label, starts: current.starts.filter((s) => b.test(hourOf(s))) })).filter((b) => b.starts.length) : [];
|
|
70
|
+
|
|
71
|
+
// Switching day drops a start chosen on another day — otherwise the CTA names a time that isn't on screen.
|
|
72
|
+
const pickDay = (dayKey: string) => {
|
|
73
|
+
setActiveDay(dayKey);
|
|
74
|
+
if (selectedStart && selectedStart.dayKey !== dayKey) setSelectedStart(null);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div>
|
|
79
|
+
<p className={heading}>{daily ? "Pick a start day" : "Pick a day"}</p>
|
|
80
|
+
{days === null ? (
|
|
81
|
+
<div className="flex gap-2" aria-busy="true">
|
|
82
|
+
{Array.from({ length: 5 }, (_, i) => (
|
|
83
|
+
<div key={i} className="h-14 w-[68px] animate-pulse rounded-md bg-secondary" />
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
) : (
|
|
87
|
+
<div className="flex gap-2 overflow-x-auto pb-1" role="group" aria-label={daily ? "Choose a start day" : "Choose a day"}>
|
|
88
|
+
<button type="button" onClick={prevWindow} className={pager} aria-label={`Previous ${windowDays} days`}>
|
|
89
|
+
Earlier
|
|
90
|
+
</button>
|
|
91
|
+
{days.length === 0 && <p className="self-center text-sm text-muted-foreground">Nothing available in these {windowDays} days.</p>}
|
|
92
|
+
{days.map((day) => {
|
|
93
|
+
const start = daily ? day.starts[0] : null; // a daily rental's day is its start
|
|
94
|
+
const active = daily ? selectedStart?.key === start?.key : day.dayKey === current?.dayKey;
|
|
95
|
+
return (
|
|
96
|
+
<button key={day.dayKey} type="button" aria-pressed={active} disabled={daily && !start?.bookable} className={dayTile(active, daily && !start?.bookable)} onClick={() => (daily && start ? setSelectedStart(start) : pickDay(day.dayKey))}>
|
|
97
|
+
<span className="block text-[10px] uppercase tracking-wide opacity-70">{fmtDay(day.dayKey, { weekday: "short" })}</span>
|
|
98
|
+
<span className="block text-lg font-semibold leading-tight">{fmtDay(day.dayKey, { day: "numeric" })}</span>
|
|
99
|
+
</button>
|
|
100
|
+
);
|
|
101
|
+
})}
|
|
102
|
+
<button type="button" onClick={nextWindow} className={pager} aria-label={`Next ${windowDays} days`}>
|
|
103
|
+
More
|
|
104
|
+
<br />
|
|
105
|
+
dates
|
|
106
|
+
</button>
|
|
107
|
+
</div>
|
|
108
|
+
)}
|
|
109
|
+
|
|
110
|
+
{!daily && current && (
|
|
111
|
+
<div className="mt-5">
|
|
112
|
+
<div className="mb-3 flex flex-wrap items-baseline justify-between gap-2">
|
|
113
|
+
<p className="text-sm font-medium">{fmtDay(current.dayKey, { weekday: "long", month: "short", day: "numeric" })}</p>
|
|
114
|
+
<span className="text-xs text-muted-foreground">
|
|
115
|
+
{current.starts.length} {current.starts.length === 1 ? "start" : "starts"}
|
|
116
|
+
{timeZone ? ` · times in ${timeZone.replace(/_/g, " ")}` : ""}
|
|
117
|
+
</span>
|
|
118
|
+
</div>
|
|
119
|
+
<div className="space-y-4">
|
|
120
|
+
{buckets.map((b) => (
|
|
121
|
+
<div key={b.label}>
|
|
122
|
+
<p className="mb-2 text-[11px] uppercase tracking-[0.12em] text-muted-foreground">{b.label}</p>
|
|
123
|
+
<div className="flex flex-wrap gap-2">
|
|
124
|
+
{b.starts.map((s) => (
|
|
125
|
+
<button key={s.key} type="button" disabled={!s.bookable} title={s.location?.name || undefined} className={chip(selectedStart?.key === s.key, !s.bookable)} onClick={() => setSelectedStart(s)}>
|
|
126
|
+
{s.label}
|
|
127
|
+
</button>
|
|
128
|
+
))}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
))}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
)}
|
|
135
|
+
|
|
136
|
+
{selectedStart && (
|
|
137
|
+
<div className="mt-6">
|
|
138
|
+
<p className={heading}>How long{daily ? ` from ${selectedStart.label}` : ""}</p>
|
|
139
|
+
{endOptions === null ? (
|
|
140
|
+
<div className="h-10 animate-pulse rounded-md bg-secondary" aria-busy="true" />
|
|
141
|
+
) : endOptions.length === 0 ? (
|
|
142
|
+
<p className="rounded-md border border-border p-4 text-sm text-muted-foreground">This start can't be rented for the minimum length. Pick another start.</p>
|
|
143
|
+
) : (
|
|
144
|
+
<div className="flex flex-wrap gap-2">
|
|
145
|
+
{endOptions.map((o) => (
|
|
146
|
+
<button key={o.endLocal} type="button" className={chip(selectedEnd?.endLocal === o.endLocal)} onClick={() => setSelectedEnd(o)}>
|
|
147
|
+
{o.label}
|
|
148
|
+
</button>
|
|
149
|
+
))}
|
|
150
|
+
</div>
|
|
151
|
+
)}
|
|
152
|
+
{selectedEnd && (
|
|
153
|
+
<p className="mt-3 text-sm text-muted-foreground">
|
|
154
|
+
{quote === null ? "Calculating the price…" : quote.total ? <>Total <span className="font-medium text-foreground">{quote.total}</span></> : rental.free ? "Free" : ""}
|
|
155
|
+
</p>
|
|
156
|
+
)}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
<div className="mt-6 grid max-w-md gap-3">
|
|
161
|
+
{formFields.map((f) => (
|
|
162
|
+
<label key={f.target} className="block">
|
|
163
|
+
<span className={heading}>
|
|
164
|
+
{f.label}
|
|
165
|
+
{f.required ? " *" : ""}
|
|
166
|
+
</span>
|
|
167
|
+
{f.options?.length ? (
|
|
168
|
+
<select value={values[f.target] ?? ""} onChange={(e) => setValue(f.target, e.target.value)} className={input}>
|
|
169
|
+
<option value="">Choose…</option>
|
|
170
|
+
{f.options.map((o) => (
|
|
171
|
+
<option key={o} value={o}>
|
|
172
|
+
{o}
|
|
173
|
+
</option>
|
|
174
|
+
))}
|
|
175
|
+
</select>
|
|
176
|
+
) : (
|
|
177
|
+
<input
|
|
178
|
+
type={f.type === "EMAIL" ? "email" : f.type === "PHONE" ? "tel" : f.type === "NUMBER" ? "number" : f.type === "URL" ? "url" : "text"}
|
|
179
|
+
value={values[f.target] ?? ""}
|
|
180
|
+
required={f.required}
|
|
181
|
+
onChange={(e) => setValue(f.target, e.target.value)}
|
|
182
|
+
className={input}
|
|
183
|
+
/>
|
|
184
|
+
)}
|
|
185
|
+
</label>
|
|
186
|
+
))}
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
{error && <p className="mt-3 text-sm text-destructive">{error}</p>}
|
|
190
|
+
<button type="button" disabled={!canRent || renting} onClick={() => rent().catch(() => {})} className="mt-5 rounded-control bg-primary px-8 py-3 text-sm font-semibold text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-50">
|
|
191
|
+
{renting ? "Reserving…" : rental.free ? `${verb} — free` : quote?.total ? `${verb} · ${quote.total}` : rental.rateLabel ? `${verb} · ${rental.rateLabel}` : verb}
|
|
192
|
+
</button>
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// REFERENCE listing surface: rentals grid with the rate and range per tile, skeletons, an honest
|
|
2
|
+
// empty state, and load-more, on the @theme tokens. Correct and complete; per the skill's model you
|
|
3
|
+
// design and build your own on useRentals.
|
|
4
|
+
import type { ComponentType, ReactNode } from "react";
|
|
5
|
+
import { useRentals } from "../../hooks/rentals/useRentals";
|
|
6
|
+
import type { RentalSummary } from "../../wix/rentals/types";
|
|
7
|
+
|
|
8
|
+
export interface LinkLikeProps {
|
|
9
|
+
href: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const PlainLink = ({ href, className, children }: LinkLikeProps) => (
|
|
15
|
+
<a href={href} className={className}>
|
|
16
|
+
{children}
|
|
17
|
+
</a>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export interface RentalCardProps {
|
|
21
|
+
rental: RentalSummary;
|
|
22
|
+
rentalHref?: (slug: string) => string;
|
|
23
|
+
LinkComponent?: ComponentType<LinkLikeProps>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function RentalCard({ rental, rentalHref = (slug) => `/rentals/${slug}`, LinkComponent = PlainLink }: RentalCardProps) {
|
|
27
|
+
return (
|
|
28
|
+
<LinkComponent href={rentalHref(rental.slug)} className="group block no-underline">
|
|
29
|
+
<div className="relative aspect-[4/3] overflow-hidden rounded-lg bg-secondary">
|
|
30
|
+
{rental.imageUrl && <img src={rental.imageUrl} alt={rental.name} loading="lazy" className="h-full w-full object-cover transition-transform duration-300 group-hover:scale-[1.03]" />}
|
|
31
|
+
<span className="absolute left-3 top-3 rounded-control bg-background/90 px-3 py-1 text-xs font-semibold text-foreground backdrop-blur">{rental.unit === "DAY" ? "By the day" : "By the hour"}</span>
|
|
32
|
+
</div>
|
|
33
|
+
<p className="mt-3 text-sm font-medium text-foreground">{rental.name}</p>
|
|
34
|
+
{rental.tagLine && <p className="mt-0.5 text-xs text-muted-foreground">{rental.tagLine}</p>}
|
|
35
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
36
|
+
{rental.rateLabel && <span className="text-foreground">{rental.rateLabel}</span>}
|
|
37
|
+
{rental.rateLabel && rental.rangeLabel ? " · " : ""}
|
|
38
|
+
{rental.rangeLabel}
|
|
39
|
+
</p>
|
|
40
|
+
{rental.locations.length > 0 && rental.locations[0].name && <p className="mt-0.5 text-xs text-muted-foreground">{rental.locations.map((l) => l.name).filter(Boolean).join(" · ")}</p>}
|
|
41
|
+
</LinkComponent>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface RentalsViewProps {
|
|
46
|
+
initialRentals?: RentalSummary[];
|
|
47
|
+
initialHasMore?: boolean;
|
|
48
|
+
emptyMessage?: string;
|
|
49
|
+
rentalHref?: RentalCardProps["rentalHref"];
|
|
50
|
+
LinkComponent?: ComponentType<LinkLikeProps>;
|
|
51
|
+
CardComponent?: ComponentType<RentalCardProps>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default function RentalsView({ initialRentals, initialHasMore, emptyMessage = "Nothing to rent yet — check back soon.", rentalHref, LinkComponent, CardComponent = RentalCard }: RentalsViewProps) {
|
|
55
|
+
const { rentals, hasMore, loadingMore, loadMore, error } = useRentals({ initialRentals, initialHasMore });
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div>
|
|
59
|
+
{error && <p className="mb-4 text-sm text-destructive">{error}</p>}
|
|
60
|
+
{rentals === null ? (
|
|
61
|
+
<div className="grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3" aria-busy="true">
|
|
62
|
+
{Array.from({ length: 6 }, (_, i) => (
|
|
63
|
+
<div key={i}>
|
|
64
|
+
<div className="aspect-[4/3] animate-pulse rounded-lg bg-secondary" />
|
|
65
|
+
<div className="mt-3 h-3.5 w-2/3 animate-pulse rounded bg-secondary" />
|
|
66
|
+
</div>
|
|
67
|
+
))}
|
|
68
|
+
</div>
|
|
69
|
+
) : rentals.length === 0 ? (
|
|
70
|
+
<p className="py-16 text-center text-muted-foreground">{emptyMessage}</p>
|
|
71
|
+
) : (
|
|
72
|
+
<>
|
|
73
|
+
<div className="grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3">
|
|
74
|
+
{rentals.map((r) => (
|
|
75
|
+
<CardComponent key={r.id} rental={r} rentalHref={rentalHref} LinkComponent={LinkComponent} />
|
|
76
|
+
))}
|
|
77
|
+
</div>
|
|
78
|
+
{hasMore && (
|
|
79
|
+
<div className="mt-10 text-center">
|
|
80
|
+
<button type="button" disabled={loadingMore} onClick={() => void loadMore()} className="rounded-control border border-border px-6 py-2 text-sm font-medium text-foreground transition-colors hover:bg-secondary disabled:opacity-50">
|
|
81
|
+
{loadingMore ? "Loading…" : "Load more"}
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
</>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// React binding of the rental-flow store (wix/rentals/rental-flow-store.ts) — the whole rental
|
|
2
|
+
// state machine for one rental lives there, framework-free: the availability window (starts grouped
|
|
3
|
+
// by day, paging), the chosen start, the lengths it allows, the chosen length and its quote, the
|
|
4
|
+
// schema-driven form, the CTA state, and rent(). All correctness lives in the data layer; you own
|
|
5
|
+
// how it looks. Mount the surface client-only: availability is time-zone/session-specific.
|
|
6
|
+
import { useEffect, useRef, useSyncExternalStore } from "react";
|
|
7
|
+
import { createRentalFlowStore, type RentalFlowState, type RentalFlowStore } from "../../wix/rentals/rental-flow-store";
|
|
8
|
+
import type { RentalDetail } from "../../wix/rentals/types";
|
|
9
|
+
|
|
10
|
+
export type UseRentalFlow = RentalFlowState & Pick<RentalFlowStore, "nextWindow" | "prevWindow" | "jumpTo" | "setSelectedStart" | "setSelectedEnd" | "setValue" | "rent">;
|
|
11
|
+
|
|
12
|
+
export function useRentalFlow(rental: RentalDetail): UseRentalFlow {
|
|
13
|
+
const ref = useRef<{ rentalId: string; store: RentalFlowStore } | null>(null);
|
|
14
|
+
if (!ref.current || ref.current.rentalId !== rental.id) ref.current = { rentalId: rental.id, store: createRentalFlowStore(rental) };
|
|
15
|
+
const store = ref.current.store;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
store.start();
|
|
18
|
+
return () => store.stop();
|
|
19
|
+
}, [store]);
|
|
20
|
+
const state = useSyncExternalStore(store.subscribe, store.getState, store.getState);
|
|
21
|
+
return {
|
|
22
|
+
...state,
|
|
23
|
+
nextWindow: store.nextWindow,
|
|
24
|
+
prevWindow: store.prevWindow,
|
|
25
|
+
jumpTo: store.jumpTo,
|
|
26
|
+
setSelectedStart: store.setSelectedStart,
|
|
27
|
+
setSelectedEnd: store.setSelectedEnd,
|
|
28
|
+
setValue: store.setValue,
|
|
29
|
+
rent: store.rent,
|
|
30
|
+
};
|
|
31
|
+
}
|