@wix/agent-skills 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +7 -5
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +14 -2
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
- package/skills/wix-headless-kit/SKILL.md +31 -14
- package/skills/wix-headless-kit/guides/existing-site.md +12 -5
- package/skills/wix-headless-kit/install/attach.mjs +55 -10
- package/skills/wix-headless-kit/install/check.mjs +5 -5
- package/skills/wix-headless-kit/install/deploy.mjs +7 -3
- package/skills/wix-headless-kit/install/templates.mjs +21 -17
- package/skills/wix-headless-templates/SKILL.md +43 -0
- package/skills/wix-headless-templates/blank/project/README.md +15 -0
- package/skills/wix-headless-templates/blank/project/astro.config.mjs +20 -0
- package/skills/wix-headless-templates/blank/project/package.json +34 -0
- package/skills/wix-headless-templates/blank/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blank/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blank/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blank/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blank/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blank/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blank/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/INSTRUCTIONS.md +418 -0
- package/skills/wix-headless-templates/blog/app/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/app/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/app-astro/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/README.md +15 -0
- package/skills/wix-headless-templates/blog/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/blog/project/package-lock.json +14699 -0
- package/skills/wix-headless-templates/blog/project/package.json +39 -0
- package/skills/wix-headless-templates/blog/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blog/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blog/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blog/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blog/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/blog/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/blog/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/blog/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/blog/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/rest/authors.ts +39 -0
- package/skills/wix-headless-templates/blog/rest/comments.ts +64 -0
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +37 -0
- package/skills/wix-headless-templates/blog/rest/posts.ts +123 -0
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +79 -0
- package/skills/wix-headless-templates/blog/seed/SEED.md +81 -0
- package/skills/wix-headless-templates/blog/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +337 -0
- package/skills/wix-headless-templates/bookings/INSTRUCTIONS.md +356 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/README.md +15 -0
- package/skills/wix-headless-templates/bookings/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/bookings/project/package-lock.json +10546 -0
- package/skills/wix-headless-templates/bookings/project/package.json +41 -0
- package/skills/wix-headless-templates/bookings/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/bookings/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/bookings/rest/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/rest/services.ts +94 -0
- package/skills/wix-headless-templates/bookings/seed/SEED.md +109 -0
- package/skills/wix-headless-templates/bookings/seed/read-site.mjs +28 -0
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +407 -0
- package/skills/wix-headless-templates/cms/INSTRUCTIONS.md +399 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/README.md +15 -0
- package/skills/wix-headless-templates/cms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/cms/project/package-lock.json +9798 -0
- package/skills/wix-headless-templates/cms/project/package.json +37 -0
- package/skills/wix-headless-templates/cms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/cms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/cms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/cms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/cms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/cms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/cms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/cms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/cms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/cms/rest/collections.ts +25 -0
- package/skills/wix-headless-templates/cms/rest/items.ts +189 -0
- package/skills/wix-headless-templates/cms/seed/SEED.md +116 -0
- package/skills/wix-headless-templates/cms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +321 -0
- package/skills/wix-headless-templates/compose.mjs +83 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +349 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +95 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +466 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/app-astro/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/app-astro/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/README.md +15 -0
- package/skills/wix-headless-templates/donations/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/donations/project/package-lock.json +10266 -0
- package/skills/wix-headless-templates/donations/project/package.json +39 -0
- package/skills/wix-headless-templates/donations/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/donations/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/donations/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/donations/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/donations/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/donations/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +95 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +466 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/donations/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/donations/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/donations/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +76 -0
- package/skills/wix-headless-templates/donations/rest/donate.ts +90 -0
- package/skills/wix-headless-templates/donations/seed/SEED.md +90 -0
- package/skills/wix-headless-templates/donations/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +250 -0
- package/skills/wix-headless-templates/events/INSTRUCTIONS.md +387 -0
- package/skills/wix-headless-templates/events/app/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/app/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/app/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/app/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/app/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/app/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/README.md +15 -0
- package/skills/wix-headless-templates/events/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/events/project/package-lock.json +10497 -0
- package/skills/wix-headless-templates/events/project/package.json +39 -0
- package/skills/wix-headless-templates/events/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/events/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/events/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/events/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/events/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/project/src/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/project/src/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/project/src/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/events/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/events/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/events/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/events/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/events/rest/events.ts +112 -0
- package/skills/wix-headless-templates/events/rest/orders.ts +28 -0
- package/skills/wix-headless-templates/events/rest/registration.ts +96 -0
- package/skills/wix-headless-templates/events/seed/SEED.md +115 -0
- package/skills/wix-headless-templates/events/seed/read-site.mjs +26 -0
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +322 -0
- package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +317 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/app/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/app-astro/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/README.md +15 -0
- package/skills/wix-headless-templates/faq/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/faq/project/package-lock.json +8837 -0
- package/skills/wix-headless-templates/faq/project/package.json +37 -0
- package/skills/wix-headless-templates/faq/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/faq/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/faq/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/faq/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/project/src/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/project/src/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/faq/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/faq/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/faq/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/faq/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/faq/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/faq/rest/faq.ts +71 -0
- package/skills/wix-headless-templates/faq/seed/SEED.md +104 -0
- package/skills/wix-headless-templates/faq/seed/read-site.mjs +23 -0
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +302 -0
- package/skills/wix-headless-templates/forms/INSTRUCTIONS.md +417 -0
- package/skills/wix-headless-templates/forms/app/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/README.md +15 -0
- package/skills/wix-headless-templates/forms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/forms/project/package-lock.json +9102 -0
- package/skills/wix-headless-templates/forms/project/package.json +37 -0
- package/skills/wix-headless-templates/forms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/forms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/forms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/forms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/forms/project/src/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/forms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/forms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/forms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/forms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/forms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/forms/rest/forms.ts +37 -0
- package/skills/wix-headless-templates/forms/rest/submissions.ts +83 -0
- package/skills/wix-headless-templates/forms/seed/SEED.md +225 -0
- package/skills/wix-headless-templates/forms/seed/read-site.mjs +53 -0
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +574 -0
- package/skills/wix-headless-templates/forms/tooling/address-templates.mjs +96 -0
- package/skills/wix-headless-templates/members/INSTRUCTIONS.md +345 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/app/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/app/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/app/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/app/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/app/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/app-astro/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/README.md +15 -0
- package/skills/wix-headless-templates/members/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/members/project/package-lock.json +8892 -0
- package/skills/wix-headless-templates/members/project/package.json +37 -0
- package/skills/wix-headless-templates/members/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/members/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/members/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/members/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/project/src/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/project/src/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/project/src/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/project/src/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/members/project/src/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/project/src/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/members/project/src/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/members/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/members/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/members/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/members/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/members/rest/auth.ts +224 -0
- package/skills/wix-headless-templates/members/rest/members.ts +26 -0
- package/skills/wix-headless-templates/members/seed/SEED.md +39 -0
- package/skills/wix-headless-templates/members/seed/read-site.mjs +15 -0
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +91 -0
- package/skills/wix-headless-templates/portfolio/INSTRUCTIONS.md +315 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/README.md +15 -0
- package/skills/wix-headless-templates/portfolio/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/portfolio/project/package-lock.json +8760 -0
- package/skills/wix-headless-templates/portfolio/project/package.json +37 -0
- package/skills/wix-headless-templates/portfolio/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/portfolio/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +86 -0
- package/skills/wix-headless-templates/portfolio/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +253 -0
- package/skills/wix-headless-templates/pricing-plans/INSTRUCTIONS.md +376 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/README.md +15 -0
- package/skills/wix-headless-templates/pricing-plans/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/package-lock.json +9799 -0
- package/skills/wix-headless-templates/pricing-plans/project/package.json +38 -0
- package/skills/wix-headless-templates/pricing-plans/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/pricing-plans/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +58 -0
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-templates/pricing-plans/seed/SEED.md +93 -0
- package/skills/wix-headless-templates/pricing-plans/seed/read-site.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +301 -0
- package/skills/wix-headless-templates/rentals/INSTRUCTIONS.md +309 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/README.md +15 -0
- package/skills/wix-headless-templates/rentals/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/rentals/project/package-lock.json +10545 -0
- package/skills/wix-headless-templates/rentals/project/package.json +40 -0
- package/skills/wix-headless-templates/rentals/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/rentals/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +153 -0
- package/skills/wix-headless-templates/rentals/seed/SEED.md +95 -0
- package/skills/wix-headless-templates/rentals/seed/read-site.mjs +34 -0
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +321 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +468 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/README.md +15 -0
- package/skills/wix-headless-templates/restaurants/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/restaurants/project/package-lock.json +11038 -0
- package/skills/wix-headless-templates/restaurants/project/package.json +40 -0
- package/skills/wix-headless-templates/restaurants/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +96 -0
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +222 -0
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +102 -0
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +118 -0
- package/skills/wix-headless-templates/restaurants/seed/read-site.mjs +25 -0
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +577 -0
- package/skills/wix-headless-templates/shared/CONTENT.md +22 -0
- package/skills/wix-headless-templates/shared/CUSTOM_OPERATIONS.md +100 -0
- package/skills/wix-headless-templates/shared/DESIGN.md +37 -0
- package/skills/wix-headless-templates/shared/SUPPLIED-CONTENT.md +27 -0
- package/skills/wix-headless-templates/shared/app/styles/global.css +57 -0
- package/skills/wix-headless-templates/shared/app/wix/config.ts +16 -0
- package/skills/wix-headless-templates/shared/app/wix/media.ts +106 -0
- package/skills/wix-headless-templates/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-templates/shared/app/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +69 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/INSTRUCTIONS.md +194 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchBox.tsx +136 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchHit.tsx +50 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchResults.tsx +300 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSearch.ts +31 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSuggest.ts +26 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-core.ts +520 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-store.ts +235 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search.ts +80 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/suggest-store.ts +178 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/types.ts +158 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app-astro/pages/search.astro +33 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +82 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +43 -0
- package/skills/wix-headless-templates/shared/rest/client.ts +155 -0
- package/skills/wix-headless-templates/shared/rest/config.ts +4 -0
- package/skills/wix-headless-templates/shared/rest/media.ts +92 -0
- package/skills/wix-headless-templates/shared/seed/images.mjs +183 -0
- package/skills/wix-headless-templates/shared/seed/read-site.mjs +97 -0
- package/skills/wix-headless-templates/shared/seed/site-context.mjs +70 -0
- package/skills/wix-headless-templates/shared/seed/site.mjs +48 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +44 -0
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +685 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart.ts +187 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/app-astro/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/README.md +15 -0
- package/skills/wix-headless-templates/storefront/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/storefront/project/package-lock.json +10786 -0
- package/skills/wix-headless-templates/storefront/project/package.json +41 -0
- package/skills/wix-headless-templates/storefront/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/storefront/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart.ts +187 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/storefront/rest/cart.ts +183 -0
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +267 -0
- package/skills/wix-headless-templates/storefront/seed/SEED.md +169 -0
- package/skills/wix-headless-templates/storefront/seed/read-site.mjs +38 -0
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +839 -0
- package/skills/wix-manage/SKILL.md +11 -7
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +1 -1
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +206 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +17 -24
- package/skills/wix-manage/references/sites/create-headless-site.md +2 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +262 -171
- package/skills/wix-manage/references/stores/update-product-with-options.md +1 -1
- package/skills/wix-headless/entry/bootstrap.mjs +0 -156
- package/skills/wix-headless/entry/skill.md +0 -78
- package/skills/wix-headless-kit/cold-start/bootstrap.mjs +0 -156
- package/skills/wix-headless-kit/cold-start/cold-start.md +0 -111
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +0 -423
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
// Site Search rules and DTO mapping — transport-agnostic, imported by BOTH transports: ./search.ts
|
|
2
|
+
// (the SDK, managed Astro and React) and the REST twin in rest/search.ts (fetch, a static site or a
|
|
3
|
+
// port to another language). Every request body, every field the index is known by on the wire
|
|
4
|
+
// (`_highlights`, `documentImage`, `urlPart`, `result-format`), every href rule and the highlight
|
|
5
|
+
// sanitiser live HERE, once. The federated service is a preview API: a renamed field is one edit
|
|
6
|
+
// in this file. Imports are type-only so a strip to JS emits no imports.
|
|
7
|
+
import type {
|
|
8
|
+
EventHit,
|
|
9
|
+
FacetValue,
|
|
10
|
+
PostHit,
|
|
11
|
+
ProductHit,
|
|
12
|
+
SearchAllResult,
|
|
13
|
+
SearchDocType,
|
|
14
|
+
SearchFacets,
|
|
15
|
+
SearchFilter,
|
|
16
|
+
SearchGroup,
|
|
17
|
+
SearchHit,
|
|
18
|
+
SearchOptions,
|
|
19
|
+
SearchPage,
|
|
20
|
+
SearchSort,
|
|
21
|
+
ServiceHit,
|
|
22
|
+
SiteSearchConfig,
|
|
23
|
+
SiteSearchPlan,
|
|
24
|
+
SuggestGroup,
|
|
25
|
+
SuggestHit,
|
|
26
|
+
} from "./types";
|
|
27
|
+
|
|
28
|
+
/** A raw search document as either transport returns it. */
|
|
29
|
+
export type Raw = Record<string, any>;
|
|
30
|
+
/** Media value + size → https URL. Injected: the SDK transport scales through @wix/sdk, REST through the URL form. */
|
|
31
|
+
export type ImgSrc = (value: any, width: number, height: number) => string;
|
|
32
|
+
|
|
33
|
+
// ---- limits — the service answers 400 past them (observed live) --------------------------------
|
|
34
|
+
/** `query` of search and federatedSearch: 101 chars → 400 MAX_LENGTH. */
|
|
35
|
+
export const MAX_QUERY = 100;
|
|
36
|
+
/** `query` of suggest and autocomplete. */
|
|
37
|
+
export const MAX_SUGGEST_QUERY = 50;
|
|
38
|
+
/** suggest: "Phrase needs to be at least 3 symbols long". */
|
|
39
|
+
export const MIN_SUGGEST_CHARS = 3;
|
|
40
|
+
export const SUGGEST_DEBOUNCE_MS = 300;
|
|
41
|
+
/** Suggestions per document type. */
|
|
42
|
+
export const SUGGEST_LIMIT = 4;
|
|
43
|
+
/** Hits per group on the grouped results page (federatedSearch `limit` is PER type, 1–100). */
|
|
44
|
+
export const GROUP_LIMIT = 4;
|
|
45
|
+
/** Page size of the single-type view. */
|
|
46
|
+
export const PAGE_LIMIT = 12;
|
|
47
|
+
export const IMAGE_SIZE = 320;
|
|
48
|
+
export const EXCERPT_CHARS = 160;
|
|
49
|
+
|
|
50
|
+
// ---- document types ------------------------------------------------------------------------------
|
|
51
|
+
/** Our group key ⇄ the federated service's document type path — the one place both spellings meet. */
|
|
52
|
+
export const WIX_DOC_TYPES: Record<SearchDocType, string> = {
|
|
53
|
+
products: "public/stores/products",
|
|
54
|
+
services: "public/booking/services",
|
|
55
|
+
posts: "public/blog/posts",
|
|
56
|
+
events: "public/events/events",
|
|
57
|
+
pages: "public/site/pages",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export function docTypeOf(wixType: string | null | undefined): SearchDocType | null {
|
|
61
|
+
for (const [key, path] of Object.entries(WIX_DOC_TYPES)) if (path === wixType) return key as SearchDocType;
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const isDocType = (v: unknown): v is SearchDocType => typeof v === "string" && v in WIX_DOC_TYPES;
|
|
66
|
+
|
|
67
|
+
/** `pages` is off: a headless site has no Wix pages (total 0 on every probe). */
|
|
68
|
+
export const DEFAULT_TYPES: SearchDocType[] = ["products", "services", "posts", "events"];
|
|
69
|
+
/** The routes the verticals ship: storefront /products/[slug], bookings /services/[slug], blog /blog/[...slug], events /events/[slug]. */
|
|
70
|
+
export const DEFAULT_ROUTES: Record<SearchDocType, string> = {
|
|
71
|
+
products: "/products/[slug]",
|
|
72
|
+
services: "/services/[slug]",
|
|
73
|
+
posts: "/blog/[slug]",
|
|
74
|
+
events: "/events/[slug]",
|
|
75
|
+
pages: "",
|
|
76
|
+
};
|
|
77
|
+
export const DEFAULT_LABELS: Record<SearchDocType, string> = {
|
|
78
|
+
products: "Products",
|
|
79
|
+
services: "Services",
|
|
80
|
+
posts: "Blog posts",
|
|
81
|
+
events: "Events",
|
|
82
|
+
pages: "Pages",
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** The plan's siteSearch entry (or nothing) → a complete config; unknown type names are dropped. */
|
|
86
|
+
export function resolveConfig(plan: SiteSearchPlan | null | undefined): SiteSearchConfig {
|
|
87
|
+
const wanted = Array.isArray(plan?.types) ? plan!.types!.filter(isDocType) : DEFAULT_TYPES;
|
|
88
|
+
const types = [...new Set(wanted)];
|
|
89
|
+
const routes = { ...DEFAULT_ROUTES };
|
|
90
|
+
const labels = { ...DEFAULT_LABELS };
|
|
91
|
+
for (const [k, v] of Object.entries(plan?.routes ?? {})) if (isDocType(k) && typeof v === "string") routes[k] = v;
|
|
92
|
+
for (const [k, v] of Object.entries(plan?.labels ?? {})) if (isDocType(k) && typeof v === "string" && v) labels[k] = v;
|
|
93
|
+
return {
|
|
94
|
+
types: types.length ? types : DEFAULT_TYPES,
|
|
95
|
+
routes,
|
|
96
|
+
labels,
|
|
97
|
+
language: typeof plan?.language === "string" && plan.language ? plan.language : null,
|
|
98
|
+
fuzzy: plan?.fuzzy ?? true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ---- queries -------------------------------------------------------------------------------------
|
|
103
|
+
/** Trim, collapse whitespace, cut at the service's limit — the shape every query is sent in. */
|
|
104
|
+
export function clampQuery(q: string | null | undefined, max = MAX_QUERY): string {
|
|
105
|
+
return (q ?? "").replace(/\s+/g, " ").trim().slice(0, max).trim();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** The preview surface's own field: with it a product document is the store-front entity (`urlPart`, `media`) and loses `title`/`_highlights`. */
|
|
109
|
+
export const STORE_FRONT_PROPERTIES: Raw[] = [{ name: "result-format", value: "store-front" }];
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* federatedSearch — one request, all configured types, `limit` per type, no paging (page 2 is a
|
|
113
|
+
* single-type `search`). POST /sitesearch/v1/search/federated
|
|
114
|
+
*/
|
|
115
|
+
export function federatedBody(
|
|
116
|
+
q: string,
|
|
117
|
+
cfg: SiteSearchConfig,
|
|
118
|
+
{ limit = GROUP_LIMIT, types = cfg.types, storeFront = false }: { limit?: number; types?: SearchDocType[]; storeFront?: boolean } = {},
|
|
119
|
+
): Raw {
|
|
120
|
+
return {
|
|
121
|
+
query: clampQuery(q),
|
|
122
|
+
documentTypes: types.map((t) => WIX_DOC_TYPES[t]),
|
|
123
|
+
limit: Math.min(100, Math.max(1, limit)),
|
|
124
|
+
fuzzy: cfg.fuzzy,
|
|
125
|
+
highlight: !storeFront,
|
|
126
|
+
...(cfg.language ? { language: cfg.language } : {}),
|
|
127
|
+
...(storeFront ? { properties: STORE_FRONT_PROPERTIES } : {}),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const SORTS: Record<SearchSort, { label: string; types: SearchDocType[] }> = {
|
|
132
|
+
relevance: { label: "Relevance", types: ["products", "services", "posts", "events", "pages"] },
|
|
133
|
+
"price-asc": { label: "Price: low to high", types: ["products"] },
|
|
134
|
+
"price-desc": { label: "Price: high to low", types: ["products"] },
|
|
135
|
+
"date-desc": { label: "Newest", types: ["posts", "events"] },
|
|
136
|
+
};
|
|
137
|
+
// Sortable fields per the schema page: products discountedPriceNumeric (observed live), posts
|
|
138
|
+
// publishDate, events startDate (schema only — not observed).
|
|
139
|
+
const SORT_FIELDS: Partial<Record<SearchSort, Partial<Record<SearchDocType, string>>>> = {
|
|
140
|
+
"price-asc": { products: "discountedPriceNumeric" },
|
|
141
|
+
"price-desc": { products: "discountedPriceNumeric" },
|
|
142
|
+
"date-desc": { posts: "publishDate", events: "startDate" },
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const sortsFor = (type: SearchDocType): SearchSort[] =>
|
|
146
|
+
(Object.keys(SORTS) as SearchSort[]).filter((s) => SORTS[s].types.includes(type));
|
|
147
|
+
|
|
148
|
+
/** `ordering.ordering[]{fieldName, direction}`; undefined for relevance or a sort the type lacks. */
|
|
149
|
+
export function orderingFor(sort: SearchSort | undefined, type: SearchDocType): Raw | undefined {
|
|
150
|
+
const fieldName = sort ? SORT_FIELDS[sort]?.[type] : undefined;
|
|
151
|
+
if (!fieldName) return undefined;
|
|
152
|
+
return { ordering: [{ fieldName, direction: sort === "price-asc" ? "ASC" : "DESC" }] };
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The platformized filter `{ field: { $op: value } }`. `inStock $eq` is observed live; `$hasSome` on
|
|
157
|
+
* `collections` and `$gte`/`$lte` on `discountedPriceNumeric` follow the schema page's operators and
|
|
158
|
+
* are not observed. Products only — the other types carry no filterable field the UI exposes.
|
|
159
|
+
*/
|
|
160
|
+
export function searchFilter(f: SearchFilter | undefined, type: SearchDocType): Raw | undefined {
|
|
161
|
+
if (!f || type !== "products") return undefined;
|
|
162
|
+
const out: Raw = {};
|
|
163
|
+
if (f.inStockOnly) out.inStock = { $eq: true };
|
|
164
|
+
if (f.collections?.length) out.collections = { $hasSome: f.collections };
|
|
165
|
+
const range: Raw = {};
|
|
166
|
+
if (f.minPrice != null && Number.isFinite(f.minPrice)) range.$gte = f.minPrice;
|
|
167
|
+
if (f.maxPrice != null && Number.isFinite(f.maxPrice)) range.$lte = f.maxPrice;
|
|
168
|
+
if (Object.keys(range).length) out.discountedPriceNumeric = range;
|
|
169
|
+
return Object.keys(out).length ? out : undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Facet clauses per type (`facets.clauses[]`). Products observed live; the schema page marks blog
|
|
173
|
+
// `tags` and events `startDate`/`location`/`eventType` facetable too — add a clause here when a
|
|
174
|
+
// surface needs one, and the panel reads it from `facets.terms`.
|
|
175
|
+
const FACET_CLAUSES: Partial<Record<SearchDocType, Raw[]>> = {
|
|
176
|
+
products: [
|
|
177
|
+
{ term: { name: "collections", limit: 20 } },
|
|
178
|
+
{ term: { name: "inStock" } },
|
|
179
|
+
{ aggregation: { name: "discountedPriceNumeric", aggregation: "MIN" } },
|
|
180
|
+
{ aggregation: { name: "discountedPriceNumeric", aggregation: "MAX" } },
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* search — one document type, offset paging, ordering, filter, facets. POST /sitesearch/v1/search
|
|
186
|
+
* `fields` is never sent: it may name schema fields only (`url`, `documentImage`, `_highlights` → 400
|
|
187
|
+
* SE-1118), and everything the mappers read comes back regardless.
|
|
188
|
+
*/
|
|
189
|
+
export function searchBody(o: SearchOptions, cfg: SiteSearchConfig, { storeFront = false } = {}): Raw {
|
|
190
|
+
const limit = Math.min(100, Math.max(1, o.limit ?? PAGE_LIMIT));
|
|
191
|
+
const filter = searchFilter(o.filter, o.type);
|
|
192
|
+
const ordering = orderingFor(o.sort, o.type);
|
|
193
|
+
const facets = FACET_CLAUSES[o.type];
|
|
194
|
+
return {
|
|
195
|
+
query: clampQuery(o.q),
|
|
196
|
+
documentType: WIX_DOC_TYPES[o.type],
|
|
197
|
+
paging: { limit, offset: Math.max(0, o.offset ?? 0) },
|
|
198
|
+
fuzzy: o.fuzzy ?? cfg.fuzzy,
|
|
199
|
+
highlight: !storeFront,
|
|
200
|
+
...(cfg.language ? { language: cfg.language } : {}),
|
|
201
|
+
...(filter ? { filter } : {}),
|
|
202
|
+
...(ordering ? { ordering } : {}),
|
|
203
|
+
...(facets && !storeFront ? { facets: { clauses: facets } } : {}),
|
|
204
|
+
...(storeFront ? { properties: STORE_FRONT_PROPERTIES } : {}),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** federatedSuggest — `query` ≤ 50, `limit` per type. `result-format` is rejected here (400 SE-1113), so product suggestions carry no slug. POST /sitesearch/v1/suggest/federated */
|
|
209
|
+
export function suggestBody(q: string, cfg: SiteSearchConfig, limit = SUGGEST_LIMIT): Raw {
|
|
210
|
+
return {
|
|
211
|
+
query: clampQuery(q, MAX_SUGGEST_QUERY),
|
|
212
|
+
documentTypes: cfg.types.map((t) => WIX_DOC_TYPES[t]),
|
|
213
|
+
limit: Math.min(100, Math.max(1, limit)),
|
|
214
|
+
...(cfg.language ? { language: cfg.language } : {}),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// ---- safe HTML -----------------------------------------------------------------------------------
|
|
219
|
+
/** Plain text → HTML text. */
|
|
220
|
+
export function escapeText(s: string): string {
|
|
221
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** An HTML fragment → its text (tags dropped, the common entities decoded). */
|
|
225
|
+
export function stripTags(html: string): string {
|
|
226
|
+
return html
|
|
227
|
+
.replace(/<[^>]*>/g, " ")
|
|
228
|
+
.replace(/ /g, " ")
|
|
229
|
+
.replace(/&/g, "&")
|
|
230
|
+
.replace(/</g, "<")
|
|
231
|
+
.replace(/>/g, ">")
|
|
232
|
+
.replace(/"/g, '"')
|
|
233
|
+
.replace(/'|'/g, "'")
|
|
234
|
+
.replace(/\s+/g, " ")
|
|
235
|
+
.trim();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* A `_highlights` fragment → HTML with ONLY <mark> kept. The fragments arrive as raw HTML — the
|
|
240
|
+
* source's own tags (a description's <p>) plus the injected <mark> — so every other tag is dropped
|
|
241
|
+
* and every stray angle bracket escaped; the text between is already HTML-encoded by the index and
|
|
242
|
+
* is passed through. The only thing a component may hand to dangerouslySetInnerHTML.
|
|
243
|
+
*/
|
|
244
|
+
export function safeHighlight(fragment: string): string {
|
|
245
|
+
return fragment
|
|
246
|
+
.split(/(<\/?mark>)/i)
|
|
247
|
+
.map((part, i) => (i % 2 ? part.toLowerCase() : part.replace(/<[^>]*>/g, "").replace(/</g, "<").replace(/>/g, ">")))
|
|
248
|
+
.join("")
|
|
249
|
+
.replace(/\s+/g, " ")
|
|
250
|
+
.trim();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export function truncate(s: string, n = EXCERPT_CHARS): string {
|
|
254
|
+
if (s.length <= n) return s;
|
|
255
|
+
const cut = s.slice(0, n);
|
|
256
|
+
return `${cut.slice(0, Math.max(cut.lastIndexOf(" "), n - 20))}…`;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// ---- mapping -------------------------------------------------------------------------------------
|
|
260
|
+
const str = (v: unknown): string => (typeof v === "string" ? v : v == null ? "" : String(v));
|
|
261
|
+
const strings = (v: unknown): string[] => (Array.isArray(v) ? v.map(str).filter(Boolean) : []);
|
|
262
|
+
const docId = (raw: Raw): string => str(raw?.id ?? raw?._id ?? raw?.documentId);
|
|
263
|
+
|
|
264
|
+
/** The last path segment of an absolute or relative URL, decoded; "" when there is none. */
|
|
265
|
+
export function slugFromUrl(url: unknown): string {
|
|
266
|
+
const s = str(url).trim();
|
|
267
|
+
if (!s) return "";
|
|
268
|
+
const path = s.replace(/^[a-z]+:\/\/[^/]+/i, "").split(/[?#]/)[0];
|
|
269
|
+
const last = path.split("/").filter(Boolean).pop() ?? "";
|
|
270
|
+
try {
|
|
271
|
+
return decodeURIComponent(last);
|
|
272
|
+
} catch {
|
|
273
|
+
return last;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** The route for a hit: the type's template with `[slug]` URL-encoded in; "" when there is no slug or no route. */
|
|
278
|
+
export function hrefFor(type: SearchDocType, slug: string, cfg: SiteSearchConfig): string {
|
|
279
|
+
const route = cfg.routes[type];
|
|
280
|
+
if (!route || !slug) return "";
|
|
281
|
+
return route.replace("[slug]", encodeURIComponent(slug));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const STATIC_MEDIA = "https://static.wixstatic.com/media/";
|
|
285
|
+
|
|
286
|
+
/** `documentImage.name` (default format) or `media[0].url` (store-front) is a bare wixstatic file id — prefixed to the absolute form media.ts scales. */
|
|
287
|
+
export function imageOf(raw: Raw | null | undefined, imgSrc: ImgSrc): string {
|
|
288
|
+
const name = str(raw?.documentImage?.name) || str(raw?.media?.[0]?.url) || str(raw?.image);
|
|
289
|
+
if (!name) return "";
|
|
290
|
+
const url = /^https?:\/\//.test(name) ? name : STATIC_MEDIA + name.replace(/^\/+/, "");
|
|
291
|
+
return imgSrc(url, IMAGE_SIZE, IMAGE_SIZE);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function highlightOf(raw: Raw, field: string): string {
|
|
295
|
+
const list = raw?._highlights?.[field];
|
|
296
|
+
const first = Array.isArray(list) ? list.find((x) => typeof x === "string" && x.trim()) : null;
|
|
297
|
+
return first ? safeHighlight(first) : "";
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function excerptOf(raw: Raw): string {
|
|
301
|
+
const highlighted = highlightOf(raw, "description");
|
|
302
|
+
if (highlighted) return highlighted;
|
|
303
|
+
const plain = stripTags(str(raw?.description));
|
|
304
|
+
return plain ? escapeText(truncate(plain)) : "";
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function isoDate(v: unknown): string {
|
|
308
|
+
if (v instanceof Date) return Number.isNaN(v.getTime()) ? "" : v.toISOString();
|
|
309
|
+
const s = str(typeof v === "object" && v !== null ? (v as Raw).$date : v);
|
|
310
|
+
if (!s) return "";
|
|
311
|
+
const t = new Date(s);
|
|
312
|
+
return Number.isNaN(t.getTime()) ? "" : t.toISOString();
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/** An ISO date for a meta line — "" for an absent or unparseable value, never "Invalid Date". */
|
|
316
|
+
export function formatHitDate(iso: string, locale = "en-US", options: Intl.DateTimeFormatOptions = { dateStyle: "medium" }): string {
|
|
317
|
+
if (!iso) return "";
|
|
318
|
+
const t = new Date(iso);
|
|
319
|
+
return Number.isNaN(t.getTime()) ? "" : new Intl.DateTimeFormat(locale, options).format(t);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** Events carry `minPrice` + `currency` as numbers/strings, no formatted string (schema page; not observed). */
|
|
323
|
+
function eventPrice(raw: Raw): string {
|
|
324
|
+
const min = raw?.minPrice;
|
|
325
|
+
if (min == null || min === "") return "";
|
|
326
|
+
if (Number(min) === 0) return "Free";
|
|
327
|
+
try {
|
|
328
|
+
return `From ${new Intl.NumberFormat(undefined, { style: "currency", currency: str(raw?.currency) || "USD" }).format(Number(min))}`;
|
|
329
|
+
} catch {
|
|
330
|
+
return `From ${min} ${str(raw?.currency)}`.trim();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* One raw document → the DTO of its type. `storeFront` is the same product in `result-format:
|
|
336
|
+
* store-front` (the only place a product's slug, `urlPart`, exists on the wire); null when the pass
|
|
337
|
+
* failed or the id did not match — the hit then renders unlinked rather than at a Wix URL.
|
|
338
|
+
*/
|
|
339
|
+
export function toHit(raw: Raw, type: SearchDocType, cfg: SiteSearchConfig, imgSrc: ImgSrc, storeFront: Raw | null = null): SearchHit {
|
|
340
|
+
const title = stripTags(str(raw?.title)) || stripTags(str(storeFront?.name));
|
|
341
|
+
const base = {
|
|
342
|
+
id: docId(raw),
|
|
343
|
+
title,
|
|
344
|
+
titleHtml: highlightOf(raw, "title") || escapeText(title),
|
|
345
|
+
excerptHtml: excerptOf(raw),
|
|
346
|
+
imageUrl: imageOf(raw, imgSrc) || imageOf(storeFront, imgSrc),
|
|
347
|
+
};
|
|
348
|
+
switch (type) {
|
|
349
|
+
case "products": {
|
|
350
|
+
// Observed: `url` is "" for products on a headless site; the slug is store-front `urlPart`.
|
|
351
|
+
const slug = str(storeFront?.urlPart);
|
|
352
|
+
const hit: ProductHit = {
|
|
353
|
+
...base,
|
|
354
|
+
type,
|
|
355
|
+
slug,
|
|
356
|
+
href: hrefFor(type, slug, cfg),
|
|
357
|
+
price: str(raw?.discountedPrice) || str(storeFront?.formattedPrice),
|
|
358
|
+
inStock: typeof raw?.inStock === "boolean" ? raw.inStock : storeFront?.isInStock !== false,
|
|
359
|
+
collections: strings(raw?.collections),
|
|
360
|
+
};
|
|
361
|
+
return hit;
|
|
362
|
+
}
|
|
363
|
+
case "services": {
|
|
364
|
+
// Observed: `url` is the Wix fallback host's /service-page/<slug> — the slug is its last segment.
|
|
365
|
+
const slug = slugFromUrl(raw?.url);
|
|
366
|
+
const hit: ServiceHit = { ...base, type, slug, href: hrefFor(type, slug, cfg), category: str(raw?.category), tagLine: str(raw?.tagLine) };
|
|
367
|
+
return hit;
|
|
368
|
+
}
|
|
369
|
+
case "posts": {
|
|
370
|
+
// Not observed: assumed the same /<page>/<slug> shape as services; "" (unlinked) when `url` is empty.
|
|
371
|
+
const slug = slugFromUrl(raw?.url);
|
|
372
|
+
const hit: PostHit = {
|
|
373
|
+
...base,
|
|
374
|
+
type,
|
|
375
|
+
slug,
|
|
376
|
+
href: hrefFor(type, slug, cfg),
|
|
377
|
+
publishDate: isoDate(raw?.publishDate),
|
|
378
|
+
author: str(raw?.author),
|
|
379
|
+
tags: strings(raw?.tags),
|
|
380
|
+
};
|
|
381
|
+
return hit;
|
|
382
|
+
}
|
|
383
|
+
case "events": {
|
|
384
|
+
// Not observed: same assumption as posts.
|
|
385
|
+
const slug = slugFromUrl(raw?.url);
|
|
386
|
+
const hit: EventHit = {
|
|
387
|
+
...base,
|
|
388
|
+
type,
|
|
389
|
+
slug,
|
|
390
|
+
href: hrefFor(type, slug, cfg),
|
|
391
|
+
startDate: isoDate(raw?.startDate),
|
|
392
|
+
location: str(raw?.location),
|
|
393
|
+
price: eventPrice(raw),
|
|
394
|
+
};
|
|
395
|
+
return hit;
|
|
396
|
+
}
|
|
397
|
+
default:
|
|
398
|
+
return { ...base, type: "pages", href: "" };
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** The store-front pass's documents by id — what `toHit` joins a product on. */
|
|
403
|
+
export function storeFrontById(docs: Raw[] | null | undefined): Map<string, Raw> {
|
|
404
|
+
const m = new Map<string, Raw>();
|
|
405
|
+
for (const d of docs ?? []) {
|
|
406
|
+
const id = docId(d);
|
|
407
|
+
if (id) m.set(id, d);
|
|
408
|
+
}
|
|
409
|
+
return m;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** The products slice of a federated response — the input of storeFrontById. */
|
|
413
|
+
export function productsOf(results: Raw[] | null | undefined): Raw[] {
|
|
414
|
+
return (results ?? []).find((r) => r?.documentType === WIX_DOC_TYPES.products)?.documents ?? [];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const hitOf = (raw: Raw, type: SearchDocType, cfg: SiteSearchConfig, imgSrc: ImgSrc, storeFront: Map<string, Raw>): SearchHit =>
|
|
418
|
+
toHit(raw, type, cfg, imgSrc, type === "products" ? (storeFront.get(docId(raw)) ?? null) : null);
|
|
419
|
+
|
|
420
|
+
/** federatedSearch `results[]` → groups in the config's type order; types outside it and empty groups are dropped (the widget does the same). */
|
|
421
|
+
export function toGroups(results: Raw[] | null | undefined, cfg: SiteSearchConfig, imgSrc: ImgSrc, storeFront: Map<string, Raw> = new Map()): SearchGroup[] {
|
|
422
|
+
const byType = new Map<SearchDocType, Raw>();
|
|
423
|
+
for (const r of results ?? []) {
|
|
424
|
+
const type = docTypeOf(r?.documentType);
|
|
425
|
+
if (type) byType.set(type, r);
|
|
426
|
+
}
|
|
427
|
+
const groups: SearchGroup[] = [];
|
|
428
|
+
for (const type of cfg.types) {
|
|
429
|
+
const r = byType.get(type);
|
|
430
|
+
const docs: Raw[] = r?.documents ?? [];
|
|
431
|
+
if (!docs.length) continue;
|
|
432
|
+
groups.push({ type, label: cfg.labels[type], total: typeof r?.total === "number" ? r.total : docs.length, hits: docs.map((d) => hitOf(d, type, cfg, imgSrc, storeFront)) });
|
|
433
|
+
}
|
|
434
|
+
return groups;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The "is anything indexed" reading of a federated response. An indexed site lists every enabled
|
|
439
|
+
* document type even when a type has no match (observed live), so a response with NO types at all
|
|
440
|
+
* is read as no index — the Wix Site Search app is not installed. Zero documents across listed
|
|
441
|
+
* types stays null: no match, an empty catalog and an index still back-filling look identical.
|
|
442
|
+
*/
|
|
443
|
+
export function indexedFrom(results: Raw[] | null | undefined): boolean | null {
|
|
444
|
+
if (!Array.isArray(results) || results.length === 0) return false;
|
|
445
|
+
if (results.some((r) => (r?.documents?.length ?? 0) > 0 || (r?.total ?? 0) > 0)) return true;
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export function toSearchAll(results: Raw[] | null | undefined, cfg: SiteSearchConfig, imgSrc: ImgSrc, storeFront?: Map<string, Raw>): SearchAllResult {
|
|
450
|
+
return { groups: toGroups(results, cfg, imgSrc, storeFront), indexed: indexedFrom(results) };
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/** `facets[]` (each a one-of: terms | minAggregation | maxAggregation | minMaxAggregation | …) → terms and ranges by field. */
|
|
454
|
+
export function toFacets(facets: Raw[] | null | undefined): SearchFacets {
|
|
455
|
+
const out: SearchFacets = { terms: {}, ranges: {} };
|
|
456
|
+
const range = (name: string) => (out.ranges[name] ??= { min: null, max: null });
|
|
457
|
+
for (const f of facets ?? []) {
|
|
458
|
+
if (f?.terms?.facet) {
|
|
459
|
+
out.terms[f.terms.facet] = ((f.terms.facets ?? []) as Raw[])
|
|
460
|
+
.map((v): FacetValue => ({ value: str(v.facetValue), count: Number(v.count ?? 0) }))
|
|
461
|
+
.filter((v) => v.value);
|
|
462
|
+
}
|
|
463
|
+
if (f?.minAggregation?.facet) range(f.minAggregation.facet).min = f.minAggregation.minValue ?? null;
|
|
464
|
+
if (f?.maxAggregation?.facet) range(f.maxAggregation.facet).max = f.maxAggregation.maxValue ?? null;
|
|
465
|
+
if (f?.minMaxAggregation?.facet) {
|
|
466
|
+
const r = range(f.minMaxAggregation.facet);
|
|
467
|
+
r.min = f.minMaxAggregation.minValue ?? null;
|
|
468
|
+
r.max = f.minMaxAggregation.maxValue ?? null;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return out;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/** A `search` response → one page. `hasNext` is arithmetic on `nextPage.total` (the service sends no flag). */
|
|
475
|
+
export function toPage(res: Raw | null | undefined, o: SearchOptions, cfg: SiteSearchConfig, imgSrc: ImgSrc, storeFront: Map<string, Raw> = new Map()): SearchPage {
|
|
476
|
+
const docs: Raw[] = res?.documents ?? [];
|
|
477
|
+
const offset = Math.max(0, o.offset ?? 0);
|
|
478
|
+
const limit = Math.min(100, Math.max(1, o.limit ?? PAGE_LIMIT));
|
|
479
|
+
const total = typeof res?.nextPage?.total === "number" ? res.nextPage.total : offset + docs.length;
|
|
480
|
+
return {
|
|
481
|
+
type: o.type,
|
|
482
|
+
hits: docs.map((d) => hitOf(d, o.type, cfg, imgSrc, storeFront)),
|
|
483
|
+
total,
|
|
484
|
+
offset,
|
|
485
|
+
limit,
|
|
486
|
+
hasNext: offset + docs.length < total,
|
|
487
|
+
facets: toFacets(res?.facets),
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export const toSuggestHit = (hit: SearchHit): SuggestHit => ({ id: hit.id, type: hit.type, title: hit.title, titleHtml: hit.titleHtml, imageUrl: hit.imageUrl, href: hit.href });
|
|
492
|
+
|
|
493
|
+
/** federatedSuggest `results[]` → suggestion groups (no totals; product rows carry no href — see suggestBody). */
|
|
494
|
+
export function toSuggestGroups(results: Raw[] | null | undefined, cfg: SiteSearchConfig, imgSrc: ImgSrc): SuggestGroup[] {
|
|
495
|
+
return toGroups(results, cfg, imgSrc).map((g) => ({ type: g.type, label: g.label, hits: g.hits.map(toSuggestHit) }));
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** The one meta line under a hit, per type — "" when the type carries nothing to say. */
|
|
499
|
+
export function metaLine(hit: SearchHit): string {
|
|
500
|
+
switch (hit.type) {
|
|
501
|
+
case "products":
|
|
502
|
+
return [hit.price, hit.inStock ? "" : "Sold out"].filter(Boolean).join(" · ");
|
|
503
|
+
case "services":
|
|
504
|
+
return [hit.category, hit.tagLine].filter(Boolean).join(" · ");
|
|
505
|
+
case "posts":
|
|
506
|
+
return [formatHitDate(hit.publishDate), hit.author].filter(Boolean).join(" · ");
|
|
507
|
+
case "events":
|
|
508
|
+
return [formatHitDate(hit.startDate), hit.location, hit.price].filter(Boolean).join(" · ");
|
|
509
|
+
default:
|
|
510
|
+
return "";
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/** The results page's URL for a query (and a type) — one spelling for the box, the page and the store. */
|
|
515
|
+
export function searchHref(q: string, type: SearchDocType | null = null, searchPath = "/search"): string {
|
|
516
|
+
const p = new URLSearchParams();
|
|
517
|
+
p.set("q", clampQuery(q));
|
|
518
|
+
if (type) p.set("type", type);
|
|
519
|
+
return `${searchPath}?${p.toString()}`;
|
|
520
|
+
}
|