@wix/agent-skills 1.26.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +8 -6
- package/skills/wix-app/references/APP_VALIDATION.md +5 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/SDK_MODULE_MAP.md +1 -1
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +14 -2
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
- package/skills/wix-app/references/stores/GET_PRODUCT.md +9 -1
- package/skills/wix-app/references/stores/INVENTORY.md +2 -0
- package/skills/wix-app/references/stores/QUERY.md +2 -2
- package/skills/wix-app/references/stores/WRITE.md +1 -1
- package/skills/wix-headless-kit/SKILL.md +35 -14
- package/skills/wix-headless-kit/guides/existing-site.md +12 -5
- package/skills/wix-headless-kit/guides/no-machine.md +115 -0
- package/skills/wix-headless-kit/install/attach.mjs +60 -13
- package/skills/wix-headless-kit/install/bootstrap.mjs +3 -1
- package/skills/wix-headless-kit/install/check.mjs +5 -5
- package/skills/wix-headless-kit/install/context.mjs +4 -2
- package/skills/wix-headless-kit/install/deploy.mjs +11 -5
- package/skills/wix-headless-kit/install/pins.json +8 -0
- package/skills/wix-headless-kit/install/setup.mjs +10 -8
- package/skills/wix-headless-kit/install/templates.mjs +39 -25
- package/skills/wix-headless-templates/SKILL.md +43 -0
- package/skills/wix-headless-templates/blank/project/README.md +15 -0
- package/skills/wix-headless-templates/blank/project/astro.config.mjs +20 -0
- package/skills/wix-headless-templates/blank/project/package.json +34 -0
- package/skills/wix-headless-templates/blank/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blank/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blank/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blank/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blank/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blank/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blank/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/INSTRUCTIONS.md +418 -0
- package/skills/wix-headless-templates/blog/app/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/app/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/app-astro/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/README.md +15 -0
- package/skills/wix-headless-templates/blog/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/blog/project/package-lock.json +14699 -0
- package/skills/wix-headless-templates/blog/project/package.json +39 -0
- package/skills/wix-headless-templates/blog/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blog/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blog/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blog/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blog/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/blog/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/blog/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/blog/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/blog/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/rest/authors.ts +39 -0
- package/skills/wix-headless-templates/blog/rest/comments.ts +64 -0
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +37 -0
- package/skills/wix-headless-templates/blog/rest/posts.ts +123 -0
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +79 -0
- package/skills/wix-headless-templates/blog/seed/SEED.md +81 -0
- package/skills/wix-headless-templates/blog/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +337 -0
- package/skills/wix-headless-templates/bookings/INSTRUCTIONS.md +356 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/README.md +15 -0
- package/skills/wix-headless-templates/bookings/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/bookings/project/package-lock.json +10546 -0
- package/skills/wix-headless-templates/bookings/project/package.json +41 -0
- package/skills/wix-headless-templates/bookings/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/bookings/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/bookings/rest/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/rest/services.ts +94 -0
- package/skills/wix-headless-templates/bookings/seed/SEED.md +109 -0
- package/skills/wix-headless-templates/bookings/seed/read-site.mjs +28 -0
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +407 -0
- package/skills/wix-headless-templates/cms/INSTRUCTIONS.md +399 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/README.md +15 -0
- package/skills/wix-headless-templates/cms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/cms/project/package-lock.json +9798 -0
- package/skills/wix-headless-templates/cms/project/package.json +37 -0
- package/skills/wix-headless-templates/cms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/cms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/cms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/cms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/cms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/cms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/cms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/cms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/cms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/cms/rest/collections.ts +25 -0
- package/skills/wix-headless-templates/cms/rest/items.ts +189 -0
- package/skills/wix-headless-templates/cms/seed/SEED.md +116 -0
- package/skills/wix-headless-templates/cms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +321 -0
- package/skills/wix-headless-templates/compose.mjs +83 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +348 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +68 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +465 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/app-astro/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/app-astro/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/README.md +15 -0
- package/skills/wix-headless-templates/donations/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/donations/project/package-lock.json +10266 -0
- package/skills/wix-headless-templates/donations/project/package.json +39 -0
- package/skills/wix-headless-templates/donations/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/donations/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/donations/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/donations/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/donations/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/donations/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +68 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +465 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/donations/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/donations/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/donations/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +76 -0
- package/skills/wix-headless-templates/donations/rest/donate.ts +64 -0
- package/skills/wix-headless-templates/donations/seed/SEED.md +90 -0
- package/skills/wix-headless-templates/donations/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +250 -0
- package/skills/wix-headless-templates/events/INSTRUCTIONS.md +387 -0
- package/skills/wix-headless-templates/events/app/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/app/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/app/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/app/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/app/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/app/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/README.md +15 -0
- package/skills/wix-headless-templates/events/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/events/project/package-lock.json +10497 -0
- package/skills/wix-headless-templates/events/project/package.json +39 -0
- package/skills/wix-headless-templates/events/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/events/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/events/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/events/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/events/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/project/src/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/project/src/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/project/src/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/events/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/events/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/events/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/events/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/events/rest/events.ts +112 -0
- package/skills/wix-headless-templates/events/rest/orders.ts +28 -0
- package/skills/wix-headless-templates/events/rest/registration.ts +96 -0
- package/skills/wix-headless-templates/events/seed/SEED.md +115 -0
- package/skills/wix-headless-templates/events/seed/read-site.mjs +26 -0
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +322 -0
- package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +317 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/app/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/app-astro/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/README.md +15 -0
- package/skills/wix-headless-templates/faq/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/faq/project/package-lock.json +8837 -0
- package/skills/wix-headless-templates/faq/project/package.json +37 -0
- package/skills/wix-headless-templates/faq/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/faq/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/faq/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/faq/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/project/src/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/project/src/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/faq/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/faq/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/faq/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/faq/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/faq/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/faq/rest/faq.ts +71 -0
- package/skills/wix-headless-templates/faq/seed/SEED.md +104 -0
- package/skills/wix-headless-templates/faq/seed/read-site.mjs +23 -0
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +302 -0
- package/skills/wix-headless-templates/forms/INSTRUCTIONS.md +417 -0
- package/skills/wix-headless-templates/forms/app/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/README.md +15 -0
- package/skills/wix-headless-templates/forms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/forms/project/package-lock.json +9102 -0
- package/skills/wix-headless-templates/forms/project/package.json +37 -0
- package/skills/wix-headless-templates/forms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/forms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/forms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/forms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/forms/project/src/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/forms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/forms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/forms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/forms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/forms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/forms/rest/forms.ts +37 -0
- package/skills/wix-headless-templates/forms/rest/submissions.ts +83 -0
- package/skills/wix-headless-templates/forms/seed/SEED.md +225 -0
- package/skills/wix-headless-templates/forms/seed/read-site.mjs +53 -0
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +574 -0
- package/skills/wix-headless-templates/forms/tooling/address-templates.mjs +96 -0
- package/skills/wix-headless-templates/members/INSTRUCTIONS.md +345 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/app/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/app/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/app/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/app/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/app/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/app-astro/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/README.md +15 -0
- package/skills/wix-headless-templates/members/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/members/project/package-lock.json +8892 -0
- package/skills/wix-headless-templates/members/project/package.json +37 -0
- package/skills/wix-headless-templates/members/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/members/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/members/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/members/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/project/src/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/project/src/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/project/src/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/project/src/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/members/project/src/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/project/src/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/members/project/src/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/members/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/members/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/members/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/members/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/members/rest/auth.ts +224 -0
- package/skills/wix-headless-templates/members/rest/members.ts +26 -0
- package/skills/wix-headless-templates/members/seed/SEED.md +39 -0
- package/skills/wix-headless-templates/members/seed/read-site.mjs +15 -0
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +91 -0
- package/skills/wix-headless-templates/portfolio/INSTRUCTIONS.md +315 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/README.md +15 -0
- package/skills/wix-headless-templates/portfolio/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/portfolio/project/package-lock.json +8760 -0
- package/skills/wix-headless-templates/portfolio/project/package.json +37 -0
- package/skills/wix-headless-templates/portfolio/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/portfolio/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +86 -0
- package/skills/wix-headless-templates/portfolio/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +253 -0
- package/skills/wix-headless-templates/pricing-plans/INSTRUCTIONS.md +378 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/README.md +15 -0
- package/skills/wix-headless-templates/pricing-plans/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/package-lock.json +9799 -0
- package/skills/wix-headless-templates/pricing-plans/project/package.json +38 -0
- package/skills/wix-headless-templates/pricing-plans/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/pricing-plans/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +58 -0
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-templates/pricing-plans/seed/SEED.md +93 -0
- package/skills/wix-headless-templates/pricing-plans/seed/read-site.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +301 -0
- package/skills/wix-headless-templates/rentals/INSTRUCTIONS.md +309 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/README.md +15 -0
- package/skills/wix-headless-templates/rentals/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/rentals/project/package-lock.json +10545 -0
- package/skills/wix-headless-templates/rentals/project/package.json +40 -0
- package/skills/wix-headless-templates/rentals/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/rentals/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +153 -0
- package/skills/wix-headless-templates/rentals/seed/SEED.md +95 -0
- package/skills/wix-headless-templates/rentals/seed/read-site.mjs +34 -0
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +321 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +468 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/README.md +15 -0
- package/skills/wix-headless-templates/restaurants/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/restaurants/project/package-lock.json +11038 -0
- package/skills/wix-headless-templates/restaurants/project/package.json +40 -0
- package/skills/wix-headless-templates/restaurants/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +96 -0
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +222 -0
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +102 -0
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +118 -0
- package/skills/wix-headless-templates/restaurants/seed/read-site.mjs +25 -0
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +577 -0
- package/skills/wix-headless-templates/shared/CONTENT.md +22 -0
- package/skills/wix-headless-templates/shared/CUSTOM_OPERATIONS.md +100 -0
- package/skills/wix-headless-templates/shared/DESIGN.md +37 -0
- package/skills/wix-headless-templates/shared/SUPPLIED-CONTENT.md +27 -0
- package/skills/wix-headless-templates/shared/app/styles/global.css +57 -0
- package/skills/wix-headless-templates/shared/app/wix/config.ts +16 -0
- package/skills/wix-headless-templates/shared/app/wix/media.ts +106 -0
- package/skills/wix-headless-templates/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-templates/shared/app/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +69 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/INSTRUCTIONS.md +194 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchBox.tsx +136 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchHit.tsx +50 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchResults.tsx +300 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSearch.ts +31 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSuggest.ts +26 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-core.ts +520 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-store.ts +235 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search.ts +80 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/suggest-store.ts +178 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/types.ts +158 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app-astro/pages/search.astro +33 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +82 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +43 -0
- package/skills/wix-headless-templates/shared/rest/client.ts +155 -0
- package/skills/wix-headless-templates/shared/rest/config.ts +4 -0
- package/skills/wix-headless-templates/shared/rest/media.ts +92 -0
- package/skills/wix-headless-templates/shared/seed/images.mjs +183 -0
- package/skills/wix-headless-templates/shared/seed/read-site.mjs +97 -0
- package/skills/wix-headless-templates/shared/seed/site-context.mjs +70 -0
- package/skills/wix-headless-templates/shared/seed/site.mjs +48 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +47 -0
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +685 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart.ts +186 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/app-astro/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/README.md +15 -0
- package/skills/wix-headless-templates/storefront/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/storefront/project/package-lock.json +10786 -0
- package/skills/wix-headless-templates/storefront/project/package.json +41 -0
- package/skills/wix-headless-templates/storefront/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/storefront/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart.ts +186 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/storefront/rest/cart.ts +183 -0
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +267 -0
- package/skills/wix-headless-templates/storefront/seed/SEED.md +169 -0
- package/skills/wix-headless-templates/storefront/seed/read-site.mjs +38 -0
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +839 -0
- package/skills/wix-manage/SKILL.md +11 -7
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +1 -1
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +206 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +17 -24
- package/skills/wix-manage/references/sites/create-headless-site.md +2 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +281 -171
- package/skills/wix-manage/references/stores/update-product-with-options.md +1 -1
- package/skills/wix-headless/entry/bootstrap.mjs +0 -156
- package/skills/wix-headless/entry/skill.md +0 -78
- package/skills/wix-headless-kit/cold-start/bootstrap.mjs +0 -156
- package/skills/wix-headless-kit/cold-start/cold-start.md +0 -111
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +0 -423
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// Wix Data reads/writes (@wix/data `items`) over the SDK — the only file that touches raw data
|
|
2
|
+
// items on this transport. CMS is schema-generic: every function takes the collection id from the
|
|
3
|
+
// seed plan (seed/SEED.md) and returns plain CmsItem DTOs from ./types. The rules and mappers live
|
|
4
|
+
// in ./items-core (shared with the REST twin in templates/cms/rest/); this file is the transport
|
|
5
|
+
// only. Copy as-is; extend by adding functions, not by editing these.
|
|
6
|
+
// docs: https://dev.wix.com/docs/sdk/business-solutions/data/items/query.md
|
|
7
|
+
// docs: https://dev.wix.com/docs/sdk/business-solutions/data/items/update.md
|
|
8
|
+
import { items as itemsModule } from "@wix/data";
|
|
9
|
+
import { wixModule } from "../sdk";
|
|
10
|
+
import { imgRatio, imgSrc } from "../media";
|
|
11
|
+
import { DEFAULT_LIMIT, DISTINCT_LIMIT, assertFilterValue, betweenRange, toItem, toValues, type Media, type Raw } from "./items-core";
|
|
12
|
+
import type { CmsFilter, CmsItem, CmsPage, CmsQuery } from "./types";
|
|
13
|
+
|
|
14
|
+
const items = wixModule(itemsModule);
|
|
15
|
+
const media: Media = { imgSrc, imgRatio };
|
|
16
|
+
|
|
17
|
+
/** The query builder with every predicate applied — one place for the op → builder mapping (query, count, distinct). */
|
|
18
|
+
function withFilters(collectionId: string, filters: CmsFilter[]) {
|
|
19
|
+
let q = items.query(collectionId);
|
|
20
|
+
for (const f of filters) {
|
|
21
|
+
assertFilterValue(f);
|
|
22
|
+
const v = f.value as any;
|
|
23
|
+
switch (f.op) {
|
|
24
|
+
case "eq": q = q.eq(f.field, v); break;
|
|
25
|
+
case "ne": q = q.ne(f.field, v); break;
|
|
26
|
+
case "gt": q = q.gt(f.field, v); break;
|
|
27
|
+
case "ge": q = q.ge(f.field, v); break;
|
|
28
|
+
case "lt": q = q.lt(f.field, v); break;
|
|
29
|
+
case "le": q = q.le(f.field, v); break;
|
|
30
|
+
case "contains": q = q.contains(f.field, v); break;
|
|
31
|
+
case "startsWith": q = q.startsWith(f.field, v); break;
|
|
32
|
+
case "endsWith": q = q.endsWith(f.field, v); break;
|
|
33
|
+
// `in` rides hasSome, as Wix's own CMS components map it: on a scalar field hasSome matches a
|
|
34
|
+
// value equal to ANY of the list (the builder's own in() is not in its public type).
|
|
35
|
+
case "in": q = q.hasSome(f.field, v); break;
|
|
36
|
+
case "hasSome": q = q.hasSome(f.field, v); break;
|
|
37
|
+
case "hasAll": q = q.hasAll(f.field, v); break;
|
|
38
|
+
case "between": {
|
|
39
|
+
// The builder spells between as ge(start) + lt(end): start inclusive, end exclusive.
|
|
40
|
+
const [start, end] = betweenRange(f);
|
|
41
|
+
q = q.between(f.field, start as any, end as any);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case "isEmpty": q = q.isEmpty(f.field); break;
|
|
45
|
+
case "isNotEmpty": q = q.isNotEmpty(f.field); break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return q;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Query one page of a collection. An empty result on a PUBLIC collection is a seed
|
|
53
|
+
* permissions bug (read must be "ANYONE"), not a query bug — never reach for auth.elevate.
|
|
54
|
+
*/
|
|
55
|
+
export async function queryItems(collectionId: string, query: CmsQuery = {}): Promise<CmsPage> {
|
|
56
|
+
const { filters = [], sort = [], limit = DEFAULT_LIMIT, skip = 0, include = [], withTotal = false } = query;
|
|
57
|
+
let q = withFilters(collectionId, filters);
|
|
58
|
+
for (const s of sort) q = s.direction === "desc" ? q.descending(s.field) : q.ascending(s.field);
|
|
59
|
+
if (include.length) q = q.include(...include);
|
|
60
|
+
const res = await q.limit(limit).skip(skip).find(withTotal ? { returnTotalCount: true } : undefined);
|
|
61
|
+
return {
|
|
62
|
+
items: (res.items ?? []).map((r: Raw) => toItem(r, media)),
|
|
63
|
+
hasNext: res.hasNext(),
|
|
64
|
+
total: res.totalCount ?? null,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Fetch one item by `_id`. Null when not found. `includeReferences` is the get request's key in the
|
|
70
|
+
* installed typings (`includeReferencedItems` is the deprecated one) — confirm once on a live site
|
|
71
|
+
* that get honours it; if the referenced fields come back as ids, route through getItemBy("_id", …).
|
|
72
|
+
*/
|
|
73
|
+
export async function getItemById(
|
|
74
|
+
collectionId: string,
|
|
75
|
+
itemId: string,
|
|
76
|
+
{ include = [] }: { include?: string[] } = {},
|
|
77
|
+
): Promise<CmsItem | null> {
|
|
78
|
+
const raw = await items.get(collectionId, itemId, {
|
|
79
|
+
...(include.length ? { includeReferences: include.map((field) => ({ field })) } : {}),
|
|
80
|
+
});
|
|
81
|
+
return raw ? toItem(raw as Raw, media) : null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Fetch the first item whose `field` equals `value` — slug-style routing (Wix Data has no
|
|
86
|
+
* native get-by-slug). Null when not found → render a not-found state, never invent an item.
|
|
87
|
+
*/
|
|
88
|
+
export async function getItemBy(
|
|
89
|
+
collectionId: string,
|
|
90
|
+
field: string,
|
|
91
|
+
value: string | number,
|
|
92
|
+
{ include = [] }: { include?: string[] } = {},
|
|
93
|
+
): Promise<CmsItem | null> {
|
|
94
|
+
const page = await queryItems(collectionId, { filters: [{ field, op: "eq", value }], limit: 1, include });
|
|
95
|
+
return page.items[0] ?? null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Count items matching the filters — the builder's count(), no items transferred. */
|
|
99
|
+
export async function countItems(collectionId: string, filters: CmsFilter[] = []): Promise<number> {
|
|
100
|
+
return withFilters(collectionId, filters).count();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The distinct values a field holds across the collection (optionally within `filters`) — filter
|
|
105
|
+
* chips and selects from live data, not from the page in hand. Values normalized like item values
|
|
106
|
+
* (a DATE field's → ISO strings); a reference field yields ids.
|
|
107
|
+
*/
|
|
108
|
+
export async function distinctValues(
|
|
109
|
+
collectionId: string,
|
|
110
|
+
field: string,
|
|
111
|
+
{ filters = [], limit = DISTINCT_LIMIT }: { filters?: CmsFilter[]; limit?: number } = {},
|
|
112
|
+
): Promise<unknown[]> {
|
|
113
|
+
const res = await withFilters(collectionId, filters).limit(limit).distinct(field);
|
|
114
|
+
return toValues(res.items ?? [], media);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Insert an item (visitor form / member submission). Succeeds only when the collection's
|
|
119
|
+
* insert permission covers the caller (403 otherwise — a seed permissions step, not a code
|
|
120
|
+
* bug). Never set `_owner` — Wix stamps it from the caller's identity.
|
|
121
|
+
* Date fields must be Date objects (an ISO string is stored as text and breaks date queries).
|
|
122
|
+
* A MULTI_REFERENCE value inside `data` is DROPPED by the insert endpoint (200, no error) — pass
|
|
123
|
+
* those as `link: { field: [referencedIds] }` and they are linked right after the insert (create,
|
|
124
|
+
* then link). The returned item predates the links: re-read with `include` to see them.
|
|
125
|
+
*/
|
|
126
|
+
export async function insertItem(
|
|
127
|
+
collectionId: string,
|
|
128
|
+
data: Record<string, unknown>,
|
|
129
|
+
{ link = {} }: { link?: Record<string, string[]> } = {},
|
|
130
|
+
): Promise<CmsItem> {
|
|
131
|
+
const created = await items.insert(collectionId, data as Raw);
|
|
132
|
+
const item = toItem(created as Raw, media);
|
|
133
|
+
for (const [field, refIds] of Object.entries(link)) await linkItems(collectionId, field, item._id, refIds);
|
|
134
|
+
return item;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* REPLACE an item — fields omitted from `item` are WIPED (update does not patch). Spread the
|
|
139
|
+
* full item you hold and override; for an id + a few changed fields use patchItemFields.
|
|
140
|
+
* A round-tripped DTO carries dates as ISO strings — wrap each date field back
|
|
141
|
+
* (`new Date(iso)`) before updating, or the DATE field is silently rewritten as text.
|
|
142
|
+
*/
|
|
143
|
+
export async function updateItem(collectionId: string, item: CmsItem): Promise<CmsItem> {
|
|
144
|
+
const updated = await items.update(collectionId, item as Raw & { _id: string });
|
|
145
|
+
return toItem(updated as Raw, media);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Patch only the named fields — the safe partial change (no replace-wipes-fields footgun). */
|
|
149
|
+
export async function patchItemFields(
|
|
150
|
+
collectionId: string,
|
|
151
|
+
itemId: string,
|
|
152
|
+
fields: Record<string, unknown>,
|
|
153
|
+
): Promise<CmsItem> {
|
|
154
|
+
const entries = Object.entries(fields);
|
|
155
|
+
if (!entries.length) throw new Error("cms: patchItemFields called with no fields.");
|
|
156
|
+
let p = items.patch(collectionId, itemId);
|
|
157
|
+
for (const [k, v] of entries) p = p.setField(k, v);
|
|
158
|
+
const patched = await p.run();
|
|
159
|
+
return toItem(patched as Raw, media);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Remove an item by `_id`. Irreversible. Returns the removed item (null if it didn't exist). */
|
|
163
|
+
export async function removeItem(collectionId: string, itemId: string): Promise<CmsItem | null> {
|
|
164
|
+
const removed = await items.remove(collectionId, itemId);
|
|
165
|
+
return removed ? toItem(removed as Raw, media) : null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Add references to a MULTI_REFERENCE field of `itemId` — the only way a multi-reference is set
|
|
170
|
+
* (insert/update drop the value silently). Existing references stay; needs the collection's update
|
|
171
|
+
* permission. A no-op for an empty list.
|
|
172
|
+
*/
|
|
173
|
+
export async function linkItems(collectionId: string, field: string, itemId: string, refIds: string[]): Promise<void> {
|
|
174
|
+
if (!refIds.length) return;
|
|
175
|
+
await items.insertReference(collectionId, field, itemId, refIds);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Remove references from a MULTI_REFERENCE field of `itemId`. Other references stay. A no-op for an empty list. */
|
|
179
|
+
export async function unlinkItems(collectionId: string, field: string, itemId: string, refIds: string[]): Promise<void> {
|
|
180
|
+
if (!refIds.length) return;
|
|
181
|
+
await items.removeReference(collectionId, field, itemId, refIds);
|
|
182
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// CMS DTOs — the serializable shapes every hook, component, and page consumes. CMS is
|
|
2
|
+
// schema-generic: field keys come from the seed plan (seed/SEED.md), so an item is a flat
|
|
3
|
+
// field map rather than a fixed interface. Plain JSON: safe as Astro island props or across
|
|
4
|
+
// server/client boundaries. By the time an item leaves the data layer, Date fields are ISO
|
|
5
|
+
// strings and IMAGE fields are resolved https URLs.
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* One collection item: `_id` plus the collection's fields, flat on the item (there is no
|
|
9
|
+
* `item.data.*` — that is the REST shape and reads undefined here).
|
|
10
|
+
* Field values by type: TEXT/URL/EMAIL → string, NUMBER → number, BOOLEAN → boolean,
|
|
11
|
+
* DATE/DATETIME → ISO string, TIME → "hh:mm:ss.SSS" string (text on the wire, passed through),
|
|
12
|
+
* IMAGE → https URL at the image's natural aspect ("" never happens — absent fields are
|
|
13
|
+
* undefined), RICH_TEXT → the stored HTML string, ARRAY_STRING (tags) → string[], ADDRESS →
|
|
14
|
+
* object with `formatted`, MEDIA_GALLERY → array of { src, type, title } (`src` resolved),
|
|
15
|
+
* REFERENCE/MULTI_REFERENCE → id(s), or full CmsItem(s) when the query included the field.
|
|
16
|
+
* VIDEO/DOCUMENT identifiers (`wix:video://`, `wix:document://`) and RICH_CONTENT (Ricos JSON)
|
|
17
|
+
* pass through unresolved.
|
|
18
|
+
*/
|
|
19
|
+
export interface CmsItem {
|
|
20
|
+
_id: string;
|
|
21
|
+
/** ISO string (the SDK's Date objects are serialized by the data layer). */
|
|
22
|
+
_createdDate?: string;
|
|
23
|
+
_updatedDate?: string;
|
|
24
|
+
/** Id of the member who created the row (member-scoped collections). */
|
|
25
|
+
_owner?: string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Predicate operators — the SDK query builder's names. `in` matches a scalar field equal to ANY of
|
|
31
|
+
* the values (an id list; hasSome on the wire, as Wix's own components send it); `between` takes
|
|
32
|
+
* `[start, end]`, start inclusive, end EXCLUSIVE (the builder spells it ge + lt — a date range
|
|
33
|
+
* ends at the first excluded day).
|
|
34
|
+
*/
|
|
35
|
+
export type CmsFilterOp =
|
|
36
|
+
| "eq"
|
|
37
|
+
| "ne"
|
|
38
|
+
| "gt"
|
|
39
|
+
| "ge"
|
|
40
|
+
| "lt"
|
|
41
|
+
| "le"
|
|
42
|
+
| "contains"
|
|
43
|
+
| "startsWith"
|
|
44
|
+
| "endsWith"
|
|
45
|
+
| "in"
|
|
46
|
+
| "hasSome"
|
|
47
|
+
| "hasAll"
|
|
48
|
+
| "between"
|
|
49
|
+
| "isEmpty"
|
|
50
|
+
| "isNotEmpty";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* One query predicate. Comparands must match the field's stored type — a DATE/DATETIME
|
|
54
|
+
* field only matches a Date object (an ISO string compares as text and matches nothing).
|
|
55
|
+
*/
|
|
56
|
+
export interface CmsFilter {
|
|
57
|
+
field: string;
|
|
58
|
+
op: CmsFilterOp;
|
|
59
|
+
/** Required except for isEmpty/isNotEmpty; in/hasSome/hasAll take an array; between takes `[start, end]`. */
|
|
60
|
+
value?: string | number | boolean | Date | (string | number | Date)[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface CmsSort {
|
|
64
|
+
field: string;
|
|
65
|
+
/** Default "asc". */
|
|
66
|
+
direction?: "asc" | "desc";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CmsQuery {
|
|
70
|
+
filters?: CmsFilter[];
|
|
71
|
+
sort?: CmsSort[];
|
|
72
|
+
/** Page size (default 20). */
|
|
73
|
+
limit?: number;
|
|
74
|
+
/** Items to skip — page N (0-based) is skip = N * limit. */
|
|
75
|
+
skip?: number;
|
|
76
|
+
/** Reference field keys to inline as full items (otherwise the field holds ids). */
|
|
77
|
+
include?: string[];
|
|
78
|
+
/** true → the page carries `total` (slower query; for counts, page numbers, empty-state logic). */
|
|
79
|
+
withTotal?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** One page of items. Load the next page with skip = items shown so far. */
|
|
83
|
+
export interface CmsPage {
|
|
84
|
+
items: CmsItem[];
|
|
85
|
+
hasNext: boolean;
|
|
86
|
+
/** Total matching items — only when the query asked `withTotal`, else null. */
|
|
87
|
+
total: number | null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** A field's type as the collection schema spells it (Wix Data `Type`; open for values added later). */
|
|
91
|
+
export type CmsFieldType =
|
|
92
|
+
| "TEXT"
|
|
93
|
+
| "NUMBER"
|
|
94
|
+
| "BOOLEAN"
|
|
95
|
+
| "DATE"
|
|
96
|
+
| "DATETIME"
|
|
97
|
+
| "TIME"
|
|
98
|
+
| "URL"
|
|
99
|
+
| "IMAGE"
|
|
100
|
+
| "VIDEO"
|
|
101
|
+
| "DOCUMENT"
|
|
102
|
+
| "AUDIO"
|
|
103
|
+
| "RICH_TEXT"
|
|
104
|
+
| "RICH_CONTENT"
|
|
105
|
+
| "MEDIA_GALLERY"
|
|
106
|
+
| "ADDRESS"
|
|
107
|
+
| "ARRAY_STRING"
|
|
108
|
+
| "ARRAY"
|
|
109
|
+
| "OBJECT"
|
|
110
|
+
| "REFERENCE"
|
|
111
|
+
| "MULTI_REFERENCE"
|
|
112
|
+
| (string & {});
|
|
113
|
+
|
|
114
|
+
/** Who may run a verb on a collection (Wix Data `Role`). */
|
|
115
|
+
export type CmsRole = "ANYONE" | "SITE_MEMBER" | "SITE_MEMBER_AUTHOR" | "ADMIN" | (string & {});
|
|
116
|
+
|
|
117
|
+
/** One field of a collection's schema. */
|
|
118
|
+
export interface CmsFieldSchema {
|
|
119
|
+
key: string;
|
|
120
|
+
displayName: string;
|
|
121
|
+
type: CmsFieldType;
|
|
122
|
+
/** `_id`, `_createdDate`, `_updatedDate`, `_owner` — Wix's to stamp, never written. */
|
|
123
|
+
systemField: boolean;
|
|
124
|
+
required: boolean;
|
|
125
|
+
/** REFERENCE/MULTI_REFERENCE: the collection the field points at. */
|
|
126
|
+
referencedCollectionId?: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* A collection's schema — field types, reference targets, and permissions at runtime: the
|
|
131
|
+
* source of truth for a field's type when the seed plan isn't at hand (an imported site).
|
|
132
|
+
*/
|
|
133
|
+
export interface CmsCollectionSchema {
|
|
134
|
+
id: string;
|
|
135
|
+
displayName: string;
|
|
136
|
+
fields: CmsFieldSchema[];
|
|
137
|
+
permissions: { read: CmsRole; insert: CmsRole; update: CmsRole; remove: CmsRole };
|
|
138
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Wix connection config — written by the skill's deploy step (install/deploy.mjs).
|
|
2
|
+
//
|
|
3
|
+
// WIX_CLIENT_ID = null → ambient auth (a Wix-managed Astro project: `@wix/astro` authenticates
|
|
4
|
+
// every SDK call automatically; there is no client and nothing to set).
|
|
5
|
+
// WIX_CLIENT_ID = "..." → manual visitor client (any other React setup): the public OAuth client id.
|
|
6
|
+
// It is NOT a secret — it only mints anonymous visitor tokens — so
|
|
7
|
+
// hardcoding and committing it is fine. deploy.mjs copies it from `.env.local`
|
|
8
|
+
// (`WIX_CLIENT_ID`, what `wix env pull` writes): the CONTENT site's app — on a
|
|
9
|
+
// migration preview the site being migrated, while wix.config.json names
|
|
10
|
+
// only the deploy target.
|
|
11
|
+
export const WIX_CLIENT_ID: string | null = null;
|
|
12
|
+
|
|
13
|
+
// Kept for projects deployed before the Members vertical moved onto the shared seam; the shipped
|
|
14
|
+
// members code no longer reads it (ambient Astro uses the built-in /api/auth routes, manual mode
|
|
15
|
+
// uses the shared client above). deploy.mjs still fills it so older code keeps compiling.
|
|
16
|
+
export const WIX_MEMBERS_CLIENT_ID: string | null = null;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Wix media resolution — define once, use on EVERY image render path. Copy as-is.
|
|
2
|
+
//
|
|
3
|
+
// SDK media fields come back either as an already-absolute https URL, or as a
|
|
4
|
+
// `wix:image://v1/<hash>/<file>#originWidth=…` identifier that a browser cannot load
|
|
5
|
+
// (ERR_UNKNOWN_URL_SCHEME). The wix:image:// form must go through the SDK media module;
|
|
6
|
+
// never hand-build a static.wixstatic.com URL (wrong format → 403).
|
|
7
|
+
// docs: https://dev.wix.com/docs/sdk/core-modules/sdk/media.md
|
|
8
|
+
import { media } from "@wix/sdk";
|
|
9
|
+
|
|
10
|
+
type MediaLike =
|
|
11
|
+
| string
|
|
12
|
+
| null
|
|
13
|
+
| undefined
|
|
14
|
+
| { image?: unknown; url?: string | null; id?: string | null };
|
|
15
|
+
|
|
16
|
+
/** A bare Wix media file id (`e6a89e_06cf…~mv2.png`): what REST-shaped media objects carry as `url` and `id`. */
|
|
17
|
+
const BARE_FILE_ID = /^[\w-]+~mv2\.[a-z0-9]+$/i;
|
|
18
|
+
|
|
19
|
+
function rawOf(value: MediaLike): string {
|
|
20
|
+
if (!value) return "";
|
|
21
|
+
if (typeof value === "string") return value;
|
|
22
|
+
if (value.image != null && typeof value.image === "object") return rawOf(value.image as MediaLike); // { image: { id, url } }
|
|
23
|
+
return (typeof value.image === "string" ? value.image : null) ?? value.url ?? value.id ?? "";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Resolve any Wix media value to a browser-loadable URL ("" when absent). */
|
|
27
|
+
export function imgSrc(value: MediaLike, width = 600, height = 600): string {
|
|
28
|
+
const v = rawOf(value);
|
|
29
|
+
if (!v) return "";
|
|
30
|
+
if (v.startsWith("wix:image://")) {
|
|
31
|
+
return media.getScaledToFillImageUrl(v, width, height, {});
|
|
32
|
+
}
|
|
33
|
+
// A bare file id (what REST-shaped media objects carry) or an absolute Wix media URL (bare, or
|
|
34
|
+
// already carrying a /v1/fill/ segment at some other size): re-issue it through the scaler at the
|
|
35
|
+
// requested size, so every image path lands on one shape.
|
|
36
|
+
const file = BARE_FILE_ID.test(v) ? v : v.match(/^https:\/\/static\.wixstatic\.com\/media\/([^/?#]+)/)?.[1];
|
|
37
|
+
if (file) return `https://static.wixstatic.com/media/${file}/v1/fill/w_${width},h_${height},al_c,q_90/${file}`;
|
|
38
|
+
return v;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Responsive candidates for `srcset`: the same image at several widths through Wix's scaler, so a
|
|
43
|
+
* card never downloads a hero-sized file. Pair with `sizes`:
|
|
44
|
+
* <img src={imgSrc(m, 640, 640)} srcSet={imgSrcSet(m)} sizes="(min-width: 1024px) 25vw, 50vw"
|
|
45
|
+
* width={640} height={640} loading="lazy" alt={…} />
|
|
46
|
+
* Accepts every form an image reaches you in: a raw `wix:image://` id, an ALREADY-RESOLVED Wix URL
|
|
47
|
+
* (what the DTOs carry — `imageUrl`, `gallery[]`; its `/v1/fill/w_…,h_…` segment is rewritten per
|
|
48
|
+
* width), or any other https URL (returned as the single candidate). `ratio` is height/width
|
|
49
|
+
* (1 = square). "" only when there is no image at all — still set `src` as well.
|
|
50
|
+
*/
|
|
51
|
+
export function imgSrcSet(value: MediaLike, widths: number[] = [320, 480, 640, 960], ratio = 1): string {
|
|
52
|
+
const raw = rawOf(value);
|
|
53
|
+
if (!raw) return "";
|
|
54
|
+
if (raw.startsWith("wix:image://") || BARE_FILE_ID.test(raw)) {
|
|
55
|
+
return widths.map((w) => `${imgSrc(value, w, Math.round(w * ratio))} ${w}w`).join(", ");
|
|
56
|
+
}
|
|
57
|
+
// A resolved Wix URL: …/v1/fill/w_800,h_800,al_c,… — swap the size for each width.
|
|
58
|
+
const FILL = /\/v1\/fill\/w_\d+,h_\d+/;
|
|
59
|
+
if (/static\.wixstatic\.com\//.test(raw) && FILL.test(raw)) {
|
|
60
|
+
return widths.map((w) => `${raw.replace(FILL, `/v1/fill/w_${w},h_${Math.round(w * ratio)}`)} ${w}w`).join(", ");
|
|
61
|
+
}
|
|
62
|
+
return raw; // one candidate, never an empty srcset for a real image
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Everything an <img> needs for one Wix image, so a tile can never ship `srcSet` without `src`:
|
|
67
|
+
* <img {...imgAttrs(p.imageUrl, "(min-width: 1024px) 25vw, 50vw")} alt={p.name} />
|
|
68
|
+
* `sizes` is the width the image renders at (a CSS length or media-query list); `ratio` is
|
|
69
|
+
* height/width. Returns an empty object when there is no image — render your placeholder then.
|
|
70
|
+
*/
|
|
71
|
+
export function imgAttrs(value: MediaLike, sizes: string, ratio = 1): { src: string; srcSet: string; sizes: string; loading: "lazy"; decoding: "async" } | Record<string, never> {
|
|
72
|
+
const src = imgSrc(value, 640, Math.round(640 * ratio));
|
|
73
|
+
if (!src) return {};
|
|
74
|
+
return { src, srcSet: imgSrcSet(value, undefined, ratio), sizes, loading: "lazy", decoding: "async" };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Height/width of a Wix image when the value carries its size: a raw
|
|
79
|
+
* `wix:image://…#originWidth=W&originHeight=H` id (the natural size) or a resolved `/v1/fill/w_W,h_H/`
|
|
80
|
+
* URL (the size it was scaled to). null when neither is present. Pass it as `ratio` to keep a
|
|
81
|
+
* srcset at the image's own aspect instead of the square default:
|
|
82
|
+
* <img {...imgAttrs(item.photo, "33vw", imgRatio(item.photo) ?? 1)} alt={…} />
|
|
83
|
+
*/
|
|
84
|
+
export function imgRatio(value: MediaLike): number | null {
|
|
85
|
+
const v = rawOf(value);
|
|
86
|
+
if (typeof v !== "string" || !v) return null;
|
|
87
|
+
const size = v.startsWith("wix:image://")
|
|
88
|
+
? [v.match(/[#&]originWidth=(\d+)/)?.[1], v.match(/[#&]originHeight=(\d+)/)?.[1]]
|
|
89
|
+
: (v.match(/\/v1\/fill\/w_(\d+),h_(\d+)/)?.slice(1) ?? []);
|
|
90
|
+
const w = Number(size[0]);
|
|
91
|
+
const h = Number(size[1]);
|
|
92
|
+
return w > 0 && h > 0 ? h / w : null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The identity of a media value BEFORE scaling — de-duplicate galleries on this, never on a
|
|
97
|
+
* resolved URL (two scaled URLs of one photo differ in their size parameters).
|
|
98
|
+
*/
|
|
99
|
+
export function mediaKey(value: MediaLike): string {
|
|
100
|
+
const v = rawOf(value);
|
|
101
|
+
if (!v) return "";
|
|
102
|
+
// The file id, whichever form the value takes — a raw id and a resolved URL of one photo share it.
|
|
103
|
+
if (v.startsWith("wix:image://")) return v.slice("wix:image://v1/".length).split("/")[0].split("#")[0];
|
|
104
|
+
const m = v.match(/^https:\/\/static\.wixstatic\.com\/media\/([^/?#]+)/);
|
|
105
|
+
return m ? m[1] : v;
|
|
106
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Money formatting for API amounts that carry no formatted string. Copy as-is.
|
|
2
|
+
//
|
|
3
|
+
// Catalog prices come with a ready `formattedAmount` — use that directly. But eCom Cart V2
|
|
4
|
+
// amounts are ConvertedMoney `{ amount, convertedAmount }` with NO formatted string, and the
|
|
5
|
+
// currency lives on the cart, not on the money object. Never hardcode "$" or assume USD.
|
|
6
|
+
export interface ConvertedMoneyLike {
|
|
7
|
+
amount?: string | null;
|
|
8
|
+
convertedAmount?: string | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Format a ConvertedMoney in the given currency, using the visitor's locale. */
|
|
12
|
+
export function formatMoney(
|
|
13
|
+
money: ConvertedMoneyLike | null | undefined,
|
|
14
|
+
currencyCode: string | null | undefined,
|
|
15
|
+
): string {
|
|
16
|
+
const value = money?.convertedAmount ?? money?.amount;
|
|
17
|
+
if (value == null || value === "") return "";
|
|
18
|
+
const currency = currencyCode || "USD";
|
|
19
|
+
try {
|
|
20
|
+
return new Intl.NumberFormat(undefined, { style: "currency", currency }).format(Number(value));
|
|
21
|
+
} catch {
|
|
22
|
+
return `${value} ${currency}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// The one auth seam for every Wix SDK call in this app. Copy as-is; do not rewrite.
|
|
2
|
+
//
|
|
3
|
+
// Two modes, switched by WIX_CLIENT_ID in ./config:
|
|
4
|
+
// null (ambient) — a Wix-managed Astro project: `@wix/astro` authenticates raw SDK module
|
|
5
|
+
// calls automatically, server-side AND in client islands. `wixModule()`
|
|
6
|
+
// returns the module untouched.
|
|
7
|
+
// string (manual) — any other React setup (Vite SPA, non-Astro): one shared client is built
|
|
8
|
+
// with OAuthStrategy, and `wixModule()` returns the module bound to it.
|
|
9
|
+
// The strategy self-manages visitor tokens on every call (mints on first
|
|
10
|
+
// use, renews on expiry) and persists them through the storage below.
|
|
11
|
+
//
|
|
12
|
+
// The visitor token IS the identity of the current cart / member session, so in manual mode
|
|
13
|
+
// tokens persist to localStorage — never re-minted per load (a fresh anonymous mint is a NEW
|
|
14
|
+
// visitor and silently empties the cart).
|
|
15
|
+
// docs: https://dev.wix.com/docs/sdk/core-modules/sdk/oauth-strategy.md
|
|
16
|
+
// docs: https://dev.wix.com/docs/go-headless/wix-managed-headless/authentication/about-the-astro-integration.md
|
|
17
|
+
import { createClient, OAuthStrategy, EMPTY_TOKENS } from "@wix/sdk";
|
|
18
|
+
import { fetchWithAuth as ambientFetch } from "@wix/sdk/context";
|
|
19
|
+
import type { IOAuthStrategy, TokenStorage, Tokens } from "@wix/sdk";
|
|
20
|
+
import { WIX_CLIENT_ID } from "./config";
|
|
21
|
+
|
|
22
|
+
const STORAGE_KEY = `wix-session-${WIX_CLIENT_ID ?? "ambient"}`;
|
|
23
|
+
|
|
24
|
+
function browserTokenStorage(): TokenStorage {
|
|
25
|
+
return {
|
|
26
|
+
getTokens(): Tokens {
|
|
27
|
+
if (typeof window !== "undefined") {
|
|
28
|
+
try {
|
|
29
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
30
|
+
if (raw) return JSON.parse(raw) as Tokens;
|
|
31
|
+
} catch {
|
|
32
|
+
/* disabled/corrupt storage — fall through to empty */
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return EMPTY_TOKENS;
|
|
36
|
+
},
|
|
37
|
+
setTokens(tokens: Tokens): void {
|
|
38
|
+
if (typeof window === "undefined") return;
|
|
39
|
+
try {
|
|
40
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(tokens));
|
|
41
|
+
} catch {
|
|
42
|
+
/* storage full/disabled — the session just won't survive a reload */
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const client = WIX_CLIENT_ID
|
|
49
|
+
? createClient({
|
|
50
|
+
auth: OAuthStrategy({
|
|
51
|
+
clientId: WIX_CLIENT_ID,
|
|
52
|
+
tokenStorage: browserTokenStorage(),
|
|
53
|
+
}),
|
|
54
|
+
})
|
|
55
|
+
: null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Bind an SDK module to this app's auth. Usage (identical in both modes):
|
|
59
|
+
* import { productsV3 } from "@wix/stores";
|
|
60
|
+
* const products = wixModule(productsV3);
|
|
61
|
+
* await products.queryProducts(...)
|
|
62
|
+
*/
|
|
63
|
+
export function wixModule<T>(module: T): T {
|
|
64
|
+
// The cast bridges the SDK's internal Descriptors constraint; the in/out type is identical.
|
|
65
|
+
return client
|
|
66
|
+
? (client.use(module as unknown as Record<string, unknown>) as unknown as T)
|
|
67
|
+
: module;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* An authenticated fetch of a Wix REST endpoint under the SAME auth as the SDK modules (ambient
|
|
72
|
+
* on managed Astro, the shared client elsewhere) — for the few APIs whose generated SDK module is
|
|
73
|
+
* too heavy to bundle (the Forms schema module alone is 15 MB: server-side it pushes a Wix
|
|
74
|
+
* deploy past its size limit, client-side every visitor downloads it). Same visitor identity,
|
|
75
|
+
* same token, no second mint. `path` is the wixapis.com path; returns the raw Response.
|
|
76
|
+
*/
|
|
77
|
+
export function wixFetch(path: string, init?: RequestInit): Promise<Response> {
|
|
78
|
+
const url = path.startsWith("http") ? path : `https://www.wixapis.com${path}`;
|
|
79
|
+
return client ? client.fetchWithAuth(url, init) : ambientFetch(url, init);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The shared data client's manual-mode auth strategy, or null under ambient auth. The
|
|
84
|
+
* Members vertical deliberately owns a separate explicit client for its custom in-app login;
|
|
85
|
+
* app code reads that session through the members hooks instead.
|
|
86
|
+
*/
|
|
87
|
+
export function wixAuth(): IOAuthStrategy | null {
|
|
88
|
+
return client ? client.auth : null;
|
|
89
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Collection schema reads over REST — the twin of app/wix/cms/collections.ts. Same export, same
|
|
2
|
+
// DTO; the mapper comes from collections-core (the SAME file the SDK transport uses, deployed flat
|
|
3
|
+
// next to this one by deploy.mjs --stack static), so this file is only the transport.
|
|
4
|
+
// docs: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-collections/create-data-collection.md (the Data Collections API; get is GET /wix-data/v2/collections/{id} per the SDK's route table)
|
|
5
|
+
import { WixApiError, wixRequest } from "./client.js";
|
|
6
|
+
import { toCollectionSchema, type RawCollection } from "./collections-core.js";
|
|
7
|
+
import type { CmsCollectionSchema } from "./types.js";
|
|
8
|
+
|
|
9
|
+
const unreadable = (e: unknown): boolean => e instanceof WixApiError && (e.status === 404 || e.status === 403);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A collection's schema — field types, reference targets, permissions. Null when the collection
|
|
13
|
+
* can't be read: it doesn't exist (404), or the caller may not read schemas (403 — confirm once on
|
|
14
|
+
* a live site that a visitor token is allowed; if it isn't, read it where an elevated call runs).
|
|
15
|
+
* GET /wix-data/v2/collections/{dataCollectionId} → { collection: { id, displayName, fields: [{ key, displayName, type, typeMetadata, systemField, required }], permissions: { insert, update, remove, read } } }
|
|
16
|
+
*/
|
|
17
|
+
export async function getCollectionSchema(collectionId: string): Promise<CmsCollectionSchema | null> {
|
|
18
|
+
try {
|
|
19
|
+
const res = await wixRequest<RawCollection>(`/wix-data/v2/collections/${encodeURIComponent(collectionId)}`, { method: "GET" });
|
|
20
|
+
return res?.collection ? toCollectionSchema(res.collection) : null;
|
|
21
|
+
} catch (e) {
|
|
22
|
+
if (unreadable(e)) return null;
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
25
|
+
}
|