@wix/agent-skills 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +7 -5
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +14 -2
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
- package/skills/wix-headless-kit/SKILL.md +31 -14
- package/skills/wix-headless-kit/guides/existing-site.md +12 -5
- package/skills/wix-headless-kit/install/attach.mjs +55 -10
- package/skills/wix-headless-kit/install/check.mjs +5 -5
- package/skills/wix-headless-kit/install/deploy.mjs +7 -3
- package/skills/wix-headless-kit/install/templates.mjs +21 -17
- package/skills/wix-headless-templates/SKILL.md +43 -0
- package/skills/wix-headless-templates/blank/project/README.md +15 -0
- package/skills/wix-headless-templates/blank/project/astro.config.mjs +20 -0
- package/skills/wix-headless-templates/blank/project/package.json +34 -0
- package/skills/wix-headless-templates/blank/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blank/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blank/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blank/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blank/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blank/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blank/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/INSTRUCTIONS.md +418 -0
- package/skills/wix-headless-templates/blog/app/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/app/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/app-astro/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/README.md +15 -0
- package/skills/wix-headless-templates/blog/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/blog/project/package-lock.json +14699 -0
- package/skills/wix-headless-templates/blog/project/package.json +39 -0
- package/skills/wix-headless-templates/blog/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blog/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blog/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blog/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blog/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/blog/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/blog/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/blog/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/blog/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/rest/authors.ts +39 -0
- package/skills/wix-headless-templates/blog/rest/comments.ts +64 -0
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +37 -0
- package/skills/wix-headless-templates/blog/rest/posts.ts +123 -0
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +79 -0
- package/skills/wix-headless-templates/blog/seed/SEED.md +81 -0
- package/skills/wix-headless-templates/blog/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +337 -0
- package/skills/wix-headless-templates/bookings/INSTRUCTIONS.md +356 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/README.md +15 -0
- package/skills/wix-headless-templates/bookings/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/bookings/project/package-lock.json +10546 -0
- package/skills/wix-headless-templates/bookings/project/package.json +41 -0
- package/skills/wix-headless-templates/bookings/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/bookings/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/bookings/rest/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/rest/services.ts +94 -0
- package/skills/wix-headless-templates/bookings/seed/SEED.md +109 -0
- package/skills/wix-headless-templates/bookings/seed/read-site.mjs +28 -0
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +407 -0
- package/skills/wix-headless-templates/cms/INSTRUCTIONS.md +399 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/README.md +15 -0
- package/skills/wix-headless-templates/cms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/cms/project/package-lock.json +9798 -0
- package/skills/wix-headless-templates/cms/project/package.json +37 -0
- package/skills/wix-headless-templates/cms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/cms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/cms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/cms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/cms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/cms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/cms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/cms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/cms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/cms/rest/collections.ts +25 -0
- package/skills/wix-headless-templates/cms/rest/items.ts +189 -0
- package/skills/wix-headless-templates/cms/seed/SEED.md +116 -0
- package/skills/wix-headless-templates/cms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +321 -0
- package/skills/wix-headless-templates/compose.mjs +83 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +349 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +95 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +466 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/app-astro/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/app-astro/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/README.md +15 -0
- package/skills/wix-headless-templates/donations/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/donations/project/package-lock.json +10266 -0
- package/skills/wix-headless-templates/donations/project/package.json +39 -0
- package/skills/wix-headless-templates/donations/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/donations/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/donations/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/donations/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/donations/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/donations/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +95 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +466 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/donations/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/donations/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/donations/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +76 -0
- package/skills/wix-headless-templates/donations/rest/donate.ts +90 -0
- package/skills/wix-headless-templates/donations/seed/SEED.md +90 -0
- package/skills/wix-headless-templates/donations/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +250 -0
- package/skills/wix-headless-templates/events/INSTRUCTIONS.md +387 -0
- package/skills/wix-headless-templates/events/app/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/app/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/app/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/app/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/app/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/app/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/README.md +15 -0
- package/skills/wix-headless-templates/events/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/events/project/package-lock.json +10497 -0
- package/skills/wix-headless-templates/events/project/package.json +39 -0
- package/skills/wix-headless-templates/events/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/events/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/events/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/events/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/events/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/project/src/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/project/src/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/project/src/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/events/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/events/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/events/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/events/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/events/rest/events.ts +112 -0
- package/skills/wix-headless-templates/events/rest/orders.ts +28 -0
- package/skills/wix-headless-templates/events/rest/registration.ts +96 -0
- package/skills/wix-headless-templates/events/seed/SEED.md +115 -0
- package/skills/wix-headless-templates/events/seed/read-site.mjs +26 -0
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +322 -0
- package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +317 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/app/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/app-astro/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/README.md +15 -0
- package/skills/wix-headless-templates/faq/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/faq/project/package-lock.json +8837 -0
- package/skills/wix-headless-templates/faq/project/package.json +37 -0
- package/skills/wix-headless-templates/faq/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/faq/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/faq/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/faq/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/project/src/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/project/src/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/faq/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/faq/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/faq/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/faq/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/faq/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/faq/rest/faq.ts +71 -0
- package/skills/wix-headless-templates/faq/seed/SEED.md +104 -0
- package/skills/wix-headless-templates/faq/seed/read-site.mjs +23 -0
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +302 -0
- package/skills/wix-headless-templates/forms/INSTRUCTIONS.md +417 -0
- package/skills/wix-headless-templates/forms/app/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/README.md +15 -0
- package/skills/wix-headless-templates/forms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/forms/project/package-lock.json +9102 -0
- package/skills/wix-headless-templates/forms/project/package.json +37 -0
- package/skills/wix-headless-templates/forms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/forms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/forms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/forms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/forms/project/src/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/forms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/forms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/forms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/forms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/forms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/forms/rest/forms.ts +37 -0
- package/skills/wix-headless-templates/forms/rest/submissions.ts +83 -0
- package/skills/wix-headless-templates/forms/seed/SEED.md +225 -0
- package/skills/wix-headless-templates/forms/seed/read-site.mjs +53 -0
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +574 -0
- package/skills/wix-headless-templates/forms/tooling/address-templates.mjs +96 -0
- package/skills/wix-headless-templates/members/INSTRUCTIONS.md +345 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/app/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/app/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/app/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/app/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/app/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/app-astro/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/README.md +15 -0
- package/skills/wix-headless-templates/members/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/members/project/package-lock.json +8892 -0
- package/skills/wix-headless-templates/members/project/package.json +37 -0
- package/skills/wix-headless-templates/members/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/members/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/members/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/members/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/project/src/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/project/src/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/project/src/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/project/src/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/members/project/src/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/project/src/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/members/project/src/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/members/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/members/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/members/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/members/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/members/rest/auth.ts +224 -0
- package/skills/wix-headless-templates/members/rest/members.ts +26 -0
- package/skills/wix-headless-templates/members/seed/SEED.md +39 -0
- package/skills/wix-headless-templates/members/seed/read-site.mjs +15 -0
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +91 -0
- package/skills/wix-headless-templates/portfolio/INSTRUCTIONS.md +315 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/README.md +15 -0
- package/skills/wix-headless-templates/portfolio/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/portfolio/project/package-lock.json +8760 -0
- package/skills/wix-headless-templates/portfolio/project/package.json +37 -0
- package/skills/wix-headless-templates/portfolio/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/portfolio/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +86 -0
- package/skills/wix-headless-templates/portfolio/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +253 -0
- package/skills/wix-headless-templates/pricing-plans/INSTRUCTIONS.md +376 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/README.md +15 -0
- package/skills/wix-headless-templates/pricing-plans/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/package-lock.json +9799 -0
- package/skills/wix-headless-templates/pricing-plans/project/package.json +38 -0
- package/skills/wix-headless-templates/pricing-plans/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/pricing-plans/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +58 -0
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-templates/pricing-plans/seed/SEED.md +93 -0
- package/skills/wix-headless-templates/pricing-plans/seed/read-site.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +301 -0
- package/skills/wix-headless-templates/rentals/INSTRUCTIONS.md +309 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/README.md +15 -0
- package/skills/wix-headless-templates/rentals/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/rentals/project/package-lock.json +10545 -0
- package/skills/wix-headless-templates/rentals/project/package.json +40 -0
- package/skills/wix-headless-templates/rentals/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/rentals/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +153 -0
- package/skills/wix-headless-templates/rentals/seed/SEED.md +95 -0
- package/skills/wix-headless-templates/rentals/seed/read-site.mjs +34 -0
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +321 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +468 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/README.md +15 -0
- package/skills/wix-headless-templates/restaurants/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/restaurants/project/package-lock.json +11038 -0
- package/skills/wix-headless-templates/restaurants/project/package.json +40 -0
- package/skills/wix-headless-templates/restaurants/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +96 -0
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +222 -0
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +102 -0
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +118 -0
- package/skills/wix-headless-templates/restaurants/seed/read-site.mjs +25 -0
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +577 -0
- package/skills/wix-headless-templates/shared/CONTENT.md +22 -0
- package/skills/wix-headless-templates/shared/CUSTOM_OPERATIONS.md +100 -0
- package/skills/wix-headless-templates/shared/DESIGN.md +37 -0
- package/skills/wix-headless-templates/shared/SUPPLIED-CONTENT.md +27 -0
- package/skills/wix-headless-templates/shared/app/styles/global.css +57 -0
- package/skills/wix-headless-templates/shared/app/wix/config.ts +16 -0
- package/skills/wix-headless-templates/shared/app/wix/media.ts +106 -0
- package/skills/wix-headless-templates/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-templates/shared/app/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +69 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/INSTRUCTIONS.md +194 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchBox.tsx +136 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchHit.tsx +50 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchResults.tsx +300 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSearch.ts +31 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSuggest.ts +26 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-core.ts +520 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-store.ts +235 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search.ts +80 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/suggest-store.ts +178 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/types.ts +158 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app-astro/pages/search.astro +33 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +82 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +43 -0
- package/skills/wix-headless-templates/shared/rest/client.ts +155 -0
- package/skills/wix-headless-templates/shared/rest/config.ts +4 -0
- package/skills/wix-headless-templates/shared/rest/media.ts +92 -0
- package/skills/wix-headless-templates/shared/seed/images.mjs +183 -0
- package/skills/wix-headless-templates/shared/seed/read-site.mjs +97 -0
- package/skills/wix-headless-templates/shared/seed/site-context.mjs +70 -0
- package/skills/wix-headless-templates/shared/seed/site.mjs +48 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +44 -0
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +685 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart.ts +187 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/app-astro/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/README.md +15 -0
- package/skills/wix-headless-templates/storefront/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/storefront/project/package-lock.json +10786 -0
- package/skills/wix-headless-templates/storefront/project/package.json +41 -0
- package/skills/wix-headless-templates/storefront/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/storefront/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart.ts +187 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/storefront/rest/cart.ts +183 -0
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +267 -0
- package/skills/wix-headless-templates/storefront/seed/SEED.md +169 -0
- package/skills/wix-headless-templates/storefront/seed/read-site.mjs +38 -0
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +839 -0
- package/skills/wix-manage/SKILL.md +11 -7
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +1 -1
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +206 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +17 -24
- package/skills/wix-manage/references/sites/create-headless-site.md +2 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +262 -171
- package/skills/wix-manage/references/stores/update-product-with-options.md +1 -1
- package/skills/wix-headless/entry/bootstrap.mjs +0 -156
- package/skills/wix-headless/entry/skill.md +0 -78
- package/skills/wix-headless-kit/cold-start/bootstrap.mjs +0 -156
- package/skills/wix-headless-kit/cold-start/cold-start.md +0 -111
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +0 -423
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
// Donation rules and DTO mapping — transport-agnostic, imported by BOTH transports: ./campaigns.ts
|
|
2
|
+
// + ./donate.ts (the SDK, managed Astro and React) and the REST twins in templates/donations/rest/
|
|
3
|
+
// (fetch, a static site or a port to another language). Every rule about amounts, fees, frequency,
|
|
4
|
+
// goal math, validation, the checkout line and the redirect body lives HERE, once. A raw campaign
|
|
5
|
+
// may come from the SDK (`_id`, coverImage as a `wix:image://` string) or from REST (`id`,
|
|
6
|
+
// coverImage as { id, url }); the mappers accept both. Has its own formatMoney so it stands alone
|
|
7
|
+
// when stripped. Imports are type-only so a strip to JS emits no imports.
|
|
8
|
+
import type {
|
|
9
|
+
AmountPreset,
|
|
10
|
+
CampaignDetail,
|
|
11
|
+
CampaignStatus,
|
|
12
|
+
CampaignSummary,
|
|
13
|
+
DonationErrorCode,
|
|
14
|
+
DonationFrequency,
|
|
15
|
+
DonationInput,
|
|
16
|
+
DonationOptions,
|
|
17
|
+
DonationReceipt,
|
|
18
|
+
FrequencyOption,
|
|
19
|
+
GoalProgress,
|
|
20
|
+
} from "./types";
|
|
21
|
+
|
|
22
|
+
/** A raw entity as either transport returns it. */
|
|
23
|
+
export type Raw = Record<string, any>;
|
|
24
|
+
/** Media value + size → https URL. Injected: the SDK transport scales through @wix/sdk, REST through the URL form. */
|
|
25
|
+
export type ImgSrc = (value: any, width: number, height: number) => string;
|
|
26
|
+
|
|
27
|
+
/** App id of Wix Donations — the `appId` of every donation line item's catalogReference. */
|
|
28
|
+
export const DONATIONS_APP_ID = "333b456e-dd48-4d6b-b32b-9fd48d74e163";
|
|
29
|
+
/** App id of the eCom platform (Checkout & Orders) — a donation is an eCom checkout. */
|
|
30
|
+
export const ECOM_PLATFORM_APP_ID = "1380b703-ce81-ff05-f115-39571d94dfcd";
|
|
31
|
+
/** Wix's fixed processing-fee rate a donor may add (askDonorCoverFee); applied to every recurring charge. */
|
|
32
|
+
export const FEE_RATE = 0.029;
|
|
33
|
+
/** The donor note's maximum length (the Wix widget's default). */
|
|
34
|
+
export const NOTE_MAX = 100;
|
|
35
|
+
export const FREQUENCIES: DonationFrequency[] = ["ONE_TIME", "WEEK", "MONTH", "YEAR"];
|
|
36
|
+
export const FREQUENCY_LABELS: Record<DonationFrequency, string> = {
|
|
37
|
+
ONE_TIME: "One-time",
|
|
38
|
+
WEEK: "Weekly",
|
|
39
|
+
MONTH: "Monthly",
|
|
40
|
+
YEAR: "Yearly",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const rawId = (raw: Raw | undefined | null): string => raw?._id ?? raw?.id ?? "";
|
|
44
|
+
|
|
45
|
+
// ---- query ----------------------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
export interface CampaignsQueryOptions {
|
|
48
|
+
/** 1–100, default 100. */
|
|
49
|
+
limit?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The Query Donation Campaigns body both transports send: only non-archived campaigns (archived =
|
|
54
|
+
* hidden and cannot accept donations), oldest first (the Wix widget's default campaign is the first
|
|
55
|
+
* by creation date), cursor paging. `status` is NOT filterable — closed campaigns are filtered by the
|
|
56
|
+
* caller from the DTO. The SDK builder spells the same as `.eq("archived", false).ascending("_createdDate")`.
|
|
57
|
+
*/
|
|
58
|
+
export function campaignsQuery({ limit = 100 }: CampaignsQueryOptions = {}): Raw {
|
|
59
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("limit must be between 1 and 100.");
|
|
60
|
+
return { filter: { archived: false }, sort: [{ fieldName: "createdDate", order: "ASC" }], cursorPaging: { limit } };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ---- money ----------------------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A number in a currency, in the visitor's locale; whole amounts without decimals ("$25", "$12.50").
|
|
67
|
+
* "" when the currency is unknown — never a bare number posing as money, never an assumed USD.
|
|
68
|
+
*/
|
|
69
|
+
export function formatAmount(amount: number | null | undefined, currency: string | null | undefined): string {
|
|
70
|
+
if (amount == null || !Number.isFinite(amount) || !currency) return "";
|
|
71
|
+
const whole = Number.isInteger(amount);
|
|
72
|
+
try {
|
|
73
|
+
return new Intl.NumberFormat(undefined, {
|
|
74
|
+
style: "currency",
|
|
75
|
+
currency,
|
|
76
|
+
minimumFractionDigits: whole ? 0 : 2,
|
|
77
|
+
maximumFractionDigits: 2,
|
|
78
|
+
}).format(amount);
|
|
79
|
+
} catch {
|
|
80
|
+
return `${amount} ${currency}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* MultiCurrencyPrice { amount, convertedAmount, formattedAmount } → a display string. The API's
|
|
86
|
+
* own `formattedAmount` wins (the site's currency symbol and locale); otherwise the amount is
|
|
87
|
+
* formatted in `currency`; "" when neither is available.
|
|
88
|
+
*/
|
|
89
|
+
export function formatMoney(money: Raw | null | undefined, currency: string | null | undefined): string {
|
|
90
|
+
if (money?.formattedConvertedAmount) return String(money.formattedConvertedAmount);
|
|
91
|
+
if (money?.formattedAmount) return String(money.formattedAmount);
|
|
92
|
+
const value = money?.convertedAmount ?? money?.amount;
|
|
93
|
+
if (value == null || value === "") return "";
|
|
94
|
+
return formatAmount(Number(value), currency);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const amountOf = (money: Raw | null | undefined): number => {
|
|
98
|
+
const n = Number(money?.amount ?? 0);
|
|
99
|
+
return Number.isFinite(n) ? n : 0;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// ---- campaign rules -------------------------------------------------------------------------------
|
|
103
|
+
|
|
104
|
+
/** `status` is read-only and computed by Wix; anything unknown reads as collecting. */
|
|
105
|
+
export function statusOf(raw: Raw): CampaignStatus {
|
|
106
|
+
if (raw.status === "GOAL_REACHED") return "goalReached";
|
|
107
|
+
if (raw.status === "EXPIRED") return "expired";
|
|
108
|
+
return "collecting";
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const isArchived = (raw: Raw | null | undefined): boolean => raw?.archived === true;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The cover image as a value imgSrc resolves: the SDK hands a `wix:image://…` string; REST hands
|
|
115
|
+
* an Image object { id, url } — its url when present, else the media id in the wix:image form the
|
|
116
|
+
* URL builder scales. "" when the campaign has no image.
|
|
117
|
+
*/
|
|
118
|
+
export function campaignImage(raw: Raw): string {
|
|
119
|
+
const img = raw.coverImage;
|
|
120
|
+
if (!img) return "";
|
|
121
|
+
if (typeof img === "string") return img;
|
|
122
|
+
if (img.url) return String(img.url);
|
|
123
|
+
return img.id ? `wix:image://v1/${img.id}/${img.id}` : "";
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The currency the campaign's amounts are in. The metrics endpoint "currently returns only the
|
|
128
|
+
* site's default currency", so its first entry's currencyCode is the site currency. "" when the
|
|
129
|
+
* metrics could not be read (the API's formattedAmount strings still display; only the live
|
|
130
|
+
* custom-amount total loses its label).
|
|
131
|
+
*/
|
|
132
|
+
export function currencyOf(metrics: Raw[] | null | undefined): string {
|
|
133
|
+
return metrics?.find((m) => m?.currencyCode)?.currencyCode ?? "";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** The metrics entry for `currency` (the first entry when no currency is known); zero when absent. */
|
|
137
|
+
export function metricsFor(metrics: Raw[] | null | undefined, currency: string): { donationCount: number; totalAmount: Raw | undefined } {
|
|
138
|
+
const list = metrics ?? [];
|
|
139
|
+
const entry = currency ? list.find((m) => m?.currencyCode === currency) : list[0];
|
|
140
|
+
return { donationCount: Number(entry?.donationCount ?? 0) || 0, totalAmount: entry?.totalAmount };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Wix's progress rounding: 0 target → 0; under 1% rounds up, over 99% rounds down, else nearest. */
|
|
144
|
+
export function goalPercent(raised: number, target: number): number {
|
|
145
|
+
if (!target) return 0;
|
|
146
|
+
const v = (raised / target) * 100;
|
|
147
|
+
if (v < 1) return Math.ceil(v);
|
|
148
|
+
if (v > 99) return Math.floor(v);
|
|
149
|
+
return Math.round(v);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const sameDay = (a: Date, b: Date): boolean =>
|
|
153
|
+
a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
154
|
+
|
|
155
|
+
/** campaignGoal + metrics → GoalProgress; null when the campaign has no goal. `now` is injectable for tests. */
|
|
156
|
+
export function toGoal(campaignGoal: Raw | null | undefined, metrics: Raw[] | null | undefined, currency: string, now: Date = new Date()): GoalProgress | null {
|
|
157
|
+
if (!campaignGoal?.targetAmount) return null;
|
|
158
|
+
const m = metricsFor(metrics, currency);
|
|
159
|
+
const raisedAmount = amountOf(m.totalAmount);
|
|
160
|
+
const targetAmount = amountOf(campaignGoal.targetAmount);
|
|
161
|
+
const end = campaignGoal.endDate ? new Date(campaignGoal.endDate) : null;
|
|
162
|
+
const hasEnd = !!end && !Number.isNaN(end.getTime());
|
|
163
|
+
const ended = hasEnd && end!.getTime() < now.getTime();
|
|
164
|
+
const left = hasEnd && !ended ? end!.getTime() - now.getTime() : 0;
|
|
165
|
+
return {
|
|
166
|
+
raised: m.totalAmount ? formatMoney(m.totalAmount, currency) : formatAmount(0, currency),
|
|
167
|
+
target: formatMoney(campaignGoal.targetAmount, currency),
|
|
168
|
+
raisedAmount,
|
|
169
|
+
targetAmount,
|
|
170
|
+
percent: goalPercent(raisedAmount, targetAmount),
|
|
171
|
+
donationCount: m.donationCount,
|
|
172
|
+
reached: raisedAmount >= targetAmount,
|
|
173
|
+
endDate: hasEnd ? end!.toISOString() : null,
|
|
174
|
+
ended,
|
|
175
|
+
lastDay: hasEnd && sameDay(end!, now),
|
|
176
|
+
daysLeft: left ? Math.floor(left / 86_400_000) + 1 : 0,
|
|
177
|
+
hoursLeft: left ? Math.floor(left / 3_600_000) + 1 : 0,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function presetsOf(raw: Raw, currency: string): AmountPreset[] {
|
|
182
|
+
return ((raw.predefinedDonationAmounts ?? []) as Raw[])
|
|
183
|
+
.map((p) => ({ amount: amountOf(p.price), label: formatMoney(p.price, currency), impact: p.description ?? "" }))
|
|
184
|
+
.filter((p) => p.amount > 0);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** customAmountEnabled + customAmountOptions; a 0 or absent limit means no limit. */
|
|
188
|
+
export function customAmountOf(raw: Raw, currency: string): DonationOptions["customAmount"] {
|
|
189
|
+
const o: Raw = raw.customAmountOptions ?? {};
|
|
190
|
+
const min = amountOf(o.minimum) || null;
|
|
191
|
+
const max = amountOf(o.maximum) || null;
|
|
192
|
+
return {
|
|
193
|
+
enabled: raw.customAmountEnabled === true,
|
|
194
|
+
min,
|
|
195
|
+
max,
|
|
196
|
+
minLabel: min ? formatMoney(o.minimum, currency) : "",
|
|
197
|
+
maxLabel: max ? formatMoney(o.maximum, currency) : "",
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** donationFrequencies in API order, labelled; unknown values dropped; ONE_TIME when the list is empty. */
|
|
202
|
+
export function frequenciesOf(raw: Raw): FrequencyOption[] {
|
|
203
|
+
const list = ((raw.donationFrequencies ?? []) as string[]).filter((f): f is DonationFrequency => (FREQUENCIES as string[]).includes(f));
|
|
204
|
+
return (list.length ? list : ["ONE_TIME" as DonationFrequency]).map((value) => ({ value, label: FREQUENCY_LABELS[value] }));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function optionsOf(raw: Raw, currency: string): DonationOptions {
|
|
208
|
+
return {
|
|
209
|
+
currency,
|
|
210
|
+
presets: presetsOf(raw, currency),
|
|
211
|
+
customAmount: customAmountOf(raw, currency),
|
|
212
|
+
frequencies: frequenciesOf(raw),
|
|
213
|
+
askCoverFee: raw.askDonorCoverFee === true,
|
|
214
|
+
feeRate: FEE_RATE,
|
|
215
|
+
commentsEnabled: raw.commentsEnabled === true,
|
|
216
|
+
commentMaxLength: NOTE_MAX,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// ---- DTO mappers -----------------------------------------------------------------------------------
|
|
221
|
+
|
|
222
|
+
export function toSummary(raw: Raw, metrics: Raw[] | null | undefined, currency: string, imgSrc: ImgSrc): CampaignSummary {
|
|
223
|
+
const status = statusOf(raw);
|
|
224
|
+
return {
|
|
225
|
+
id: rawId(raw),
|
|
226
|
+
name: raw.name ?? "",
|
|
227
|
+
status,
|
|
228
|
+
acceptsDonations: status === "collecting",
|
|
229
|
+
imageUrl: imgSrc(campaignImage(raw), 1200, 675),
|
|
230
|
+
goal: toGoal(raw.campaignGoal, metrics, currency),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function toDetail(raw: Raw, metrics: Raw[] | null | undefined, currency: string, imgSrc: ImgSrc): CampaignDetail {
|
|
235
|
+
return { ...toSummary(raw, metrics, currency, imgSrc), options: optionsOf(raw, currency) };
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// ---- the form's rules ------------------------------------------------------------------------------
|
|
239
|
+
|
|
240
|
+
export type DonationField = "amount" | "customAmount" | "frequency" | "note";
|
|
241
|
+
|
|
242
|
+
/** What the visitor has chosen so far — the store's editable half. */
|
|
243
|
+
export interface DonationSelection {
|
|
244
|
+
frequency: DonationFrequency | null;
|
|
245
|
+
/** The selected preset's amount (null in custom mode or before a choice). */
|
|
246
|
+
presetAmount: number | null;
|
|
247
|
+
/** "Other amount" is active. */
|
|
248
|
+
customMode: boolean;
|
|
249
|
+
/** The custom field's raw text; parsed on validate. */
|
|
250
|
+
customAmount: string;
|
|
251
|
+
coverFee: boolean;
|
|
252
|
+
note: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The widget's defaults: the first preset, the first frequency, cover-fee pre-checked when the
|
|
257
|
+
* owner asks for it, and custom mode forced when the campaign offers no presets.
|
|
258
|
+
*/
|
|
259
|
+
export function defaultSelection(options: DonationOptions): DonationSelection {
|
|
260
|
+
const customOnly = options.customAmount.enabled && options.presets.length === 0;
|
|
261
|
+
return {
|
|
262
|
+
frequency: options.frequencies[0]?.value ?? null,
|
|
263
|
+
presetAmount: customOnly ? null : options.presets[0]?.amount ?? null,
|
|
264
|
+
customMode: customOnly,
|
|
265
|
+
customAmount: "",
|
|
266
|
+
coverFee: options.askCoverFee,
|
|
267
|
+
note: "",
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** "1,250.50" / " 25 " → 1250.5; null when not a number. */
|
|
272
|
+
export function parseAmount(text: string): number | null {
|
|
273
|
+
const cleaned = text.replace(/[\s,]/g, "");
|
|
274
|
+
if (!cleaned) return null;
|
|
275
|
+
const n = Number(cleaned);
|
|
276
|
+
return Number.isFinite(n) ? n : null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const decimalsOf = (n: number): number => {
|
|
280
|
+
const s = String(n);
|
|
281
|
+
const dot = s.indexOf(".");
|
|
282
|
+
return dot === -1 ? 0 : s.length - dot - 1;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/** The amount the selection resolves to (custom text parsed in custom mode); null when there is none. */
|
|
286
|
+
export function selectedAmount(sel: DonationSelection): number | null {
|
|
287
|
+
return sel.customMode ? parseAmount(sel.customAmount) : sel.presetAmount;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** The donor's fee at Wix's fixed 2.9%, rounded to cents; null for a non-positive amount. */
|
|
291
|
+
export function feeFor(amount: number | null): number | null {
|
|
292
|
+
if (amount == null || amount <= 0) return null;
|
|
293
|
+
return Math.round(amount * FEE_RATE * 100) / 100;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** amount + fee when the owner asks and the donor agreed; the amount alone otherwise. */
|
|
297
|
+
export function totalFor(amount: number | null, coverFee: boolean, askCoverFee: boolean): number | null {
|
|
298
|
+
if (amount == null) return null;
|
|
299
|
+
const fee = askCoverFee && coverFee ? feeFor(amount) ?? 0 : 0;
|
|
300
|
+
return Math.round((amount + fee) * 100) / 100;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** The widget's validation, field by field; {} when the selection is valid. */
|
|
304
|
+
export function validateDonation(options: DonationOptions, sel: DonationSelection): Partial<Record<DonationField, DonationErrorCode>> {
|
|
305
|
+
const errors: Partial<Record<DonationField, DonationErrorCode>> = {};
|
|
306
|
+
if (sel.customMode) {
|
|
307
|
+
const n = parseAmount(sel.customAmount);
|
|
308
|
+
const { min, max } = options.customAmount;
|
|
309
|
+
if (n == null || n <= 0) errors.customAmount = "MISSING_AMOUNT";
|
|
310
|
+
else if (decimalsOf(n) > 2) errors.customAmount = "TOO_MANY_DECIMALS";
|
|
311
|
+
else if (min != null && n < min) errors.customAmount = "BELOW_MIN_AMOUNT";
|
|
312
|
+
else if (max != null && n > max) errors.customAmount = "ABOVE_MAX_AMOUNT";
|
|
313
|
+
} else if (sel.presetAmount == null || sel.presetAmount <= 0) {
|
|
314
|
+
errors.amount = "MISSING_AMOUNT";
|
|
315
|
+
}
|
|
316
|
+
if (!sel.frequency) errors.frequency = "MISSING_FREQUENCY";
|
|
317
|
+
if (sel.note.length > options.commentMaxLength) errors.note = "NOTE_TOO_LONG";
|
|
318
|
+
return errors;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Visitor-facing text for a validation code, with the campaign's own limits. */
|
|
322
|
+
export function errorMessage(code: DonationErrorCode, options: DonationOptions): string {
|
|
323
|
+
switch (code) {
|
|
324
|
+
case "MISSING_AMOUNT":
|
|
325
|
+
return "Enter an amount.";
|
|
326
|
+
case "TOO_MANY_DECIMALS":
|
|
327
|
+
return "Use at most two decimal places.";
|
|
328
|
+
case "BELOW_MIN_AMOUNT":
|
|
329
|
+
return `The minimum donation is ${options.customAmount.minLabel || options.customAmount.min}.`;
|
|
330
|
+
case "ABOVE_MAX_AMOUNT":
|
|
331
|
+
return `The maximum donation is ${options.customAmount.maxLabel || options.customAmount.max}.`;
|
|
332
|
+
case "MISSING_FREQUENCY":
|
|
333
|
+
return "Choose how often to donate.";
|
|
334
|
+
case "NOTE_TOO_LONG":
|
|
335
|
+
return `Keep your note under ${options.commentMaxLength} characters.`;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/** "Donate $25" / "Donate $25.73 Monthly" / "Donate" when there is no amount or no known currency. */
|
|
340
|
+
export function donateLabel(total: number | null, frequency: DonationFrequency | null, currency: string): string {
|
|
341
|
+
const amount = formatAmount(total, currency);
|
|
342
|
+
const cadence = frequency && frequency !== "ONE_TIME" ? ` ${FREQUENCY_LABELS[frequency]}` : "";
|
|
343
|
+
return amount ? `Donate ${amount}${cadence}` : "Donate";
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** A valid selection → the checkout input; null when validation fails. */
|
|
347
|
+
export function toInput(options: DonationOptions, sel: DonationSelection): DonationInput | null {
|
|
348
|
+
if (Object.keys(validateDonation(options, sel)).length) return null;
|
|
349
|
+
const amount = selectedAmount(sel);
|
|
350
|
+
if (amount == null || !sel.frequency) return null;
|
|
351
|
+
return { amount, frequency: sel.frequency, coverFee: options.askCoverFee && sel.coverFee, note: sel.note.trim() };
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// ---- checkout -------------------------------------------------------------------------------------
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The one line item a donation checkout carries. `amount` is a NUMBER and `frequency` the enum
|
|
358
|
+
* string; `donorCoveringFees` is sent only when the donor opted in (the Donations catalog plugin
|
|
359
|
+
* prices the line from these options — never a customLineItem, never a computed price).
|
|
360
|
+
*/
|
|
361
|
+
export function donationLineItem(campaignId: string, input: DonationInput): Raw {
|
|
362
|
+
if (!campaignId) throw new Error("A campaign id is required to donate.");
|
|
363
|
+
return {
|
|
364
|
+
quantity: 1,
|
|
365
|
+
catalogReference: {
|
|
366
|
+
appId: DONATIONS_APP_ID,
|
|
367
|
+
catalogItemId: campaignId,
|
|
368
|
+
options: { amount: input.amount, frequency: input.frequency, ...(input.coverFee ? { donorCoveringFees: true } : {}) },
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** Create Checkout body: the donation line, channelType WEB, the note as the checkout's buyerNote. */
|
|
374
|
+
export function checkoutBody(campaignId: string, input: DonationInput): Raw {
|
|
375
|
+
return {
|
|
376
|
+
lineItems: [donationLineItem(campaignId, input)],
|
|
377
|
+
channelType: "WEB",
|
|
378
|
+
...(input.note ? { checkoutInfo: { buyerNote: input.note } } : {}),
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/** Create Cart body — the Wix widget's own route (fallback): the note as the cart's buyerNote. */
|
|
383
|
+
export function cartBody(campaignId: string, input: DonationInput): Raw {
|
|
384
|
+
return {
|
|
385
|
+
lineItems: [donationLineItem(campaignId, input)],
|
|
386
|
+
...(input.note ? { cartInfo: { buyerNote: input.note } } : {}),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** The checkout id out of either transport's response for either route. */
|
|
391
|
+
export function checkoutIdOf(res: Raw | null | undefined): string {
|
|
392
|
+
const id = res?._id ?? res?.id ?? res?.checkoutId ?? res?.checkout?.id ?? res?.checkout?._id ?? "";
|
|
393
|
+
if (!id) throw new Error("Checkout couldn't start: no checkout id returned.");
|
|
394
|
+
return String(id);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/** Where the hosted checkout returns to. Defaults are the Astro routes; a static site passes its file paths. */
|
|
398
|
+
export interface DonatePaths {
|
|
399
|
+
/** Success landing — Wix appends `?orderId=<eCom order id>`. Default `/donate/thank-you`. */
|
|
400
|
+
thankYou?: string;
|
|
401
|
+
/** Back here on abandon or interruption (NOT a success signal). Default `/donate/<campaignId>`. */
|
|
402
|
+
campaign?: string;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* The Create Redirect Session body for a donation checkout. `origin` is the published https host
|
|
407
|
+
* (window.location.origin in a browser) — an http or server-derived origin isn't on the OAuth app's
|
|
408
|
+
* allowed domains and 403s the return; no callbacks when unknown (SSR).
|
|
409
|
+
*/
|
|
410
|
+
export function redirectBody(checkoutId: string, campaignId: string, origin: string, paths: DonatePaths = {}): Raw {
|
|
411
|
+
if (!checkoutId) throw new Error("A checkout id is required to start the hosted checkout.");
|
|
412
|
+
const callbacks = origin
|
|
413
|
+
? {
|
|
414
|
+
postFlowUrl: `${origin}${paths.campaign ?? `/donate/${campaignId}`}`,
|
|
415
|
+
thankYouPageUrl: `${origin}${paths.thankYou ?? "/donate/thank-you"}`,
|
|
416
|
+
}
|
|
417
|
+
: {};
|
|
418
|
+
return { ecomCheckout: { checkoutId }, callbacks };
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/** The hosted checkout URL out of a redirect-session response; throws when there is none. */
|
|
422
|
+
export function redirectUrl(session: Raw | null | undefined): string {
|
|
423
|
+
const url = session?.redirectSession?.fullUrl;
|
|
424
|
+
if (!url) throw new Error("Checkout couldn't start — please try again.");
|
|
425
|
+
return url;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** A checkout failure as the visitor should read it; the raw message is kept when no rule applies. */
|
|
429
|
+
export function checkoutError(e: unknown): Error {
|
|
430
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
431
|
+
if (/premium|payment method|payments? (is|are) not (set up|enabled)|PAYMENT_METHOD/i.test(msg)) {
|
|
432
|
+
return new Error("Donations aren't switched on yet — the site owner needs a premium plan and a connected payment method.");
|
|
433
|
+
}
|
|
434
|
+
return e instanceof Error ? e : new Error(msg || "Checkout couldn't start — please try again.");
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// ---- the receipt ----------------------------------------------------------------------------------
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* The order id the hosted checkout appends to thankYouPageUrl: the redirect-session contract
|
|
441
|
+
* spells it `orderId`; the Wix widget's own success URL uses `orderid`. Both are read.
|
|
442
|
+
*/
|
|
443
|
+
export function orderIdFromSearch(search: string): string {
|
|
444
|
+
const q = new URLSearchParams(search);
|
|
445
|
+
return q.get("orderId") ?? q.get("orderid") ?? "";
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* An eCom order → the receipt: the donor's name from billingInfo.contactDetails (recipientInfo only
|
|
450
|
+
* when billing lacks a complete name), the order total's formatted amount, paid only on PAID.
|
|
451
|
+
*/
|
|
452
|
+
export function toReceipt(order: Raw): DonationReceipt {
|
|
453
|
+
const complete = (c: Raw | undefined): c is Raw => !!(c?.firstName && c?.lastName);
|
|
454
|
+
const billing: Raw | undefined = order.billingInfo?.contactDetails;
|
|
455
|
+
const recipient: Raw | undefined = order.recipientInfo?.contactDetails;
|
|
456
|
+
const contact = complete(billing) ? billing : complete(recipient) ? recipient : billing ?? recipient ?? {};
|
|
457
|
+
const total: Raw | undefined = order.priceSummary?.total;
|
|
458
|
+
return {
|
|
459
|
+
orderNumber: order.number != null ? String(order.number) : "",
|
|
460
|
+
donorFirstName: contact.firstName ?? "",
|
|
461
|
+
donorLastName: contact.lastName ?? "",
|
|
462
|
+
amount: formatMoney(total, order.currency ?? ""),
|
|
463
|
+
paid: order.paymentStatus === "PAID",
|
|
464
|
+
campaignId: order.lineItems?.[0]?.catalogReference?.catalogItemId ?? "",
|
|
465
|
+
};
|
|
466
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// The thank-you page's order read as a framework-free store — the logic behind useDonationReceipt.
|
|
2
|
+
// Landing on the thank-you URL is Wix's success redirect (it is reached only after the hosted
|
|
3
|
+
// checkout completes); the order itself may or may not be readable with the visitor's token, so
|
|
4
|
+
// `receipt` null with `loading` false is a normal outcome, not an error — the page thanks the donor
|
|
5
|
+
// without order facts. One store per page: createReceiptStore(orderId).
|
|
6
|
+
import { fetchDonationReceipt } from "./donate";
|
|
7
|
+
import { orderIdFromSearch } from "./donations-core";
|
|
8
|
+
import type { DonationReceipt } from "./types";
|
|
9
|
+
|
|
10
|
+
export interface ReceiptState {
|
|
11
|
+
/** The order id from the URL ("" on a direct visit with no order). */
|
|
12
|
+
orderId: string;
|
|
13
|
+
/** True while the order read is in flight. */
|
|
14
|
+
loading: boolean;
|
|
15
|
+
/** The order's facts; null when there was no order id or the order couldn't be read. */
|
|
16
|
+
receipt: DonationReceipt | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ReceiptStore {
|
|
20
|
+
getState(): ReceiptState;
|
|
21
|
+
subscribe(listener: () => void): () => void;
|
|
22
|
+
/** Read the order once (a browser). */
|
|
23
|
+
start(): void;
|
|
24
|
+
stop(): void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** `orderId` omitted → read from the current URL (`?orderId=` or `?orderid=`). */
|
|
28
|
+
export function createReceiptStore(orderId?: string): ReceiptStore {
|
|
29
|
+
const id = orderId ?? (typeof window !== "undefined" ? orderIdFromSearch(window.location.search) : "");
|
|
30
|
+
let state: ReceiptState = { orderId: id, loading: !!id, receipt: null };
|
|
31
|
+
let started = false;
|
|
32
|
+
const listeners = new Set<() => void>();
|
|
33
|
+
|
|
34
|
+
function setState(patch: Partial<ReceiptState>): void {
|
|
35
|
+
state = { ...state, ...patch };
|
|
36
|
+
for (const fn of listeners) fn();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
getState: () => state,
|
|
41
|
+
subscribe(fn) {
|
|
42
|
+
listeners.add(fn);
|
|
43
|
+
return () => listeners.delete(fn);
|
|
44
|
+
},
|
|
45
|
+
start() {
|
|
46
|
+
if (started) return;
|
|
47
|
+
started = true;
|
|
48
|
+
if (!id) return;
|
|
49
|
+
fetchDonationReceipt(id).then((receipt) => { if (started) setState({ receipt, loading: false }); });
|
|
50
|
+
},
|
|
51
|
+
stop() {
|
|
52
|
+
started = false;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Donations DTOs — the serializable shapes every hook, component, and page consumes. Plain JSON:
|
|
2
|
+
// safe as Astro island props or across server/client boundaries. Images are resolved https URLs;
|
|
3
|
+
// every displayable amount is a ready formatted string ("" when the currency is unknown).
|
|
4
|
+
|
|
5
|
+
/** The Donation Campaigns `Frequency` enum values. */
|
|
6
|
+
export type DonationFrequency = "ONE_TIME" | "WEEK" | "MONTH" | "YEAR";
|
|
7
|
+
|
|
8
|
+
/** `status` as the API computes it: COLLECTING → collecting, GOAL_REACHED → goalReached, EXPIRED → expired. */
|
|
9
|
+
export type CampaignStatus = "collecting" | "goalReached" | "expired";
|
|
10
|
+
|
|
11
|
+
/** Goal progress from the campaign's goal + the metrics read (null on the DTO when the campaign has no goal). */
|
|
12
|
+
export interface GoalProgress {
|
|
13
|
+
/** Formatted total raised ("$1,250"); "" when the metrics could not be read. */
|
|
14
|
+
raised: string;
|
|
15
|
+
/** Formatted target ("$20,000"). */
|
|
16
|
+
target: string;
|
|
17
|
+
/** Numbers for a11y and bar width only — never render them as money. */
|
|
18
|
+
raisedAmount: number;
|
|
19
|
+
targetAmount: number;
|
|
20
|
+
/** Wix's rounding (<1 → ceil, >99 → floor, else round); may exceed 100. */
|
|
21
|
+
percent: number;
|
|
22
|
+
donationCount: number;
|
|
23
|
+
/** raisedAmount >= targetAmount (independent of `status`: a campaign may keep collecting past its goal). */
|
|
24
|
+
reached: boolean;
|
|
25
|
+
/** ISO end date, null when the goal has no deadline. */
|
|
26
|
+
endDate: string | null;
|
|
27
|
+
/** endDate is in the past. */
|
|
28
|
+
ended: boolean;
|
|
29
|
+
/** endDate falls on today's calendar day. */
|
|
30
|
+
lastDay: boolean;
|
|
31
|
+
/** Whole days left including today; 0 with no deadline or once ended. */
|
|
32
|
+
daysLeft: number;
|
|
33
|
+
/** Whole hours left including the current one; 0 with no deadline or once ended. */
|
|
34
|
+
hoursLeft: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AmountPreset {
|
|
38
|
+
amount: number;
|
|
39
|
+
/** Formatted ("$25"). */
|
|
40
|
+
label: string;
|
|
41
|
+
/** The owner's impact statement for this amount; "" when none. */
|
|
42
|
+
impact: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface FrequencyOption {
|
|
46
|
+
value: DonationFrequency;
|
|
47
|
+
/** "One-time" | "Weekly" | "Monthly" | "Yearly". */
|
|
48
|
+
label: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface DonationOptions {
|
|
52
|
+
/** ISO currency code the campaign's amounts are in; "" when it could not be determined. */
|
|
53
|
+
currency: string;
|
|
54
|
+
/** In API order; the first is the default selection. [] with a custom-only campaign. */
|
|
55
|
+
presets: AmountPreset[];
|
|
56
|
+
customAmount: {
|
|
57
|
+
enabled: boolean;
|
|
58
|
+
/** null = no limit. */
|
|
59
|
+
min: number | null;
|
|
60
|
+
max: number | null;
|
|
61
|
+
/** Formatted limits for messages; "" when none. */
|
|
62
|
+
minLabel: string;
|
|
63
|
+
maxLabel: string;
|
|
64
|
+
};
|
|
65
|
+
/** >= 1; the first is the default. Show a picker only when length > 1. */
|
|
66
|
+
frequencies: FrequencyOption[];
|
|
67
|
+
/** The owner asks donors to add the processing fee. */
|
|
68
|
+
askCoverFee: boolean;
|
|
69
|
+
/** 0.029 — Wix's fixed rate, applied to every recurring charge too. */
|
|
70
|
+
feeRate: number;
|
|
71
|
+
/** The owner enabled the donor note. */
|
|
72
|
+
commentsEnabled: boolean;
|
|
73
|
+
/** Max note length (100). */
|
|
74
|
+
commentMaxLength: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A campaign as a listing card or a home strip needs it. */
|
|
78
|
+
export interface CampaignSummary {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
status: CampaignStatus;
|
|
82
|
+
/** status === "collecting". An archived campaign never reaches a DTO. */
|
|
83
|
+
acceptsDonations: boolean;
|
|
84
|
+
/** Resolved https URL ("" when the campaign has no cover image). */
|
|
85
|
+
imageUrl: string;
|
|
86
|
+
/** null when the campaign has no goal. */
|
|
87
|
+
goal: GoalProgress | null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** A campaign as the campaign page and the donate form need it. */
|
|
91
|
+
export interface CampaignDetail extends CampaignSummary {
|
|
92
|
+
options: DonationOptions;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** What the visitor chose — what the checkout line carries. */
|
|
96
|
+
export interface DonationInput {
|
|
97
|
+
amount: number;
|
|
98
|
+
frequency: DonationFrequency;
|
|
99
|
+
coverFee: boolean;
|
|
100
|
+
note: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type DonationErrorCode =
|
|
104
|
+
| "MISSING_AMOUNT"
|
|
105
|
+
| "TOO_MANY_DECIMALS"
|
|
106
|
+
| "BELOW_MIN_AMOUNT"
|
|
107
|
+
| "ABOVE_MAX_AMOUNT"
|
|
108
|
+
| "MISSING_FREQUENCY"
|
|
109
|
+
| "NOTE_TOO_LONG";
|
|
110
|
+
|
|
111
|
+
/** The eCom order behind a completed donation, as the thank-you page shows it. */
|
|
112
|
+
export interface DonationReceipt {
|
|
113
|
+
orderNumber: string;
|
|
114
|
+
donorFirstName: string;
|
|
115
|
+
donorLastName: string;
|
|
116
|
+
/** Formatted order total; "" when the order carries no formatted amount and no currency. */
|
|
117
|
+
amount: string;
|
|
118
|
+
/** paymentStatus === "PAID". Anything else reads as pending — never "paid". */
|
|
119
|
+
paid: boolean;
|
|
120
|
+
campaignId: string;
|
|
121
|
+
}
|