@wix/agent-skills 1.25.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 +18 -17
- package/skills/wix-app/references/BUSINESS_MANAGER_THEME.md +1 -2
- package/skills/wix-app/references/BUSINESS_MANAGER_TOKENS.md +1 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +12 -12
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +3 -2
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +75 -66
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
- package/skills/wix-app/references/data-collection/LIFECYCLE.md +6 -4
- 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-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +0 -184
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +0 -204
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +0 -44
- 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,428 @@
|
|
|
1
|
+
// FAQ rules and DTO mapping — transport-agnostic, imported by BOTH transports: ./faq.ts (the SDK,
|
|
2
|
+
// managed Astro and React) and the REST twin in templates/faq/rest/faq.ts (fetch, a static site or a
|
|
3
|
+
// port to another language). Every rule about ordering, grouping, search, deep links, the answer's
|
|
4
|
+
// Ricos-to-HTML rendering, the FAQPage structured data, and the wire spelling of a query lives HERE,
|
|
5
|
+
// once. A raw entity may come from the SDK (`_id`) or from REST (`id`); the mappers accept both.
|
|
6
|
+
// Imports are type-only so a strip to JS emits no imports.
|
|
7
|
+
import type { FaqCategory, FaqData, FaqQuestion, FaqQuestionPage, FaqSection, FetchQuestionsOptions } from "./types";
|
|
8
|
+
|
|
9
|
+
/** A raw FAQ entity (Category, QuestionEntry) as either transport returns it. */
|
|
10
|
+
export type Raw = Record<string, any>;
|
|
11
|
+
/** Media value + size → https URL. Injected: the SDK transport scales through @wix/sdk, REST through the URL form. */
|
|
12
|
+
export type ImgSrc = (value: any, width: number, height: number) => string;
|
|
13
|
+
|
|
14
|
+
/** The Wix FAQ app id — what the seed installs and read-site.mjs checks for. */
|
|
15
|
+
export const FAQ_APP_ID = "14c92d28-031e-7910-c9a8-a670011e062d";
|
|
16
|
+
/** The API's page cap: CursorPaging.limit is at most 100 on both services. */
|
|
17
|
+
export const PAGE_LIMIT = 100;
|
|
18
|
+
/** fetchFaq stops after this many questions and sets `truncated` — a guard, not a feature (an FAQ is small). */
|
|
19
|
+
export const MAX_QUESTIONS = 500;
|
|
20
|
+
/** Ask for the Ricos answer (the format the Wix dashboard writes) and the share links (only returned when asked). */
|
|
21
|
+
export const CONTENT_FORMAT = "RICH_CONTENT" as const;
|
|
22
|
+
export const FIELD_SET = ["SHARE_LINKS"] as const;
|
|
23
|
+
/** Owner order for categories AND questions: "lower sort order values appear first" (both entities). */
|
|
24
|
+
export const SORT = [{ fieldName: "sortOrder", order: "ASC" }] as const;
|
|
25
|
+
/** Size an answer's inline image is resolved at — one URL per image, wide enough for a prose column. */
|
|
26
|
+
export const ANSWER_IMAGE_WIDTH = 1200;
|
|
27
|
+
export const ANSWER_IMAGE_HEIGHT = 800;
|
|
28
|
+
/** The synthetic section for a question whose categoryId matches no loaded category. */
|
|
29
|
+
export const OTHER_CATEGORY_ID = "uncategorized";
|
|
30
|
+
export const OTHER_CATEGORY_TITLE = "Other";
|
|
31
|
+
|
|
32
|
+
export const rawId = (r: Raw | null | undefined): string => r?._id ?? r?.id ?? "";
|
|
33
|
+
|
|
34
|
+
const numberOrNull = (v: unknown): number | null => (typeof v === "number" && Number.isFinite(v) ? v : null);
|
|
35
|
+
|
|
36
|
+
// ---- DTO mapping --------------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
export function toCategory(raw: Raw): FaqCategory {
|
|
39
|
+
return { id: rawId(raw), title: raw.title ?? "", sortOrder: numberOrNull(raw.sortOrder), questionCount: 0 };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The answer is a oneof — richContent | plainText | draftjs — and the request's `contentFormat`
|
|
44
|
+
* decides which one the response carries. Priority here: richContent (what we ask for), then
|
|
45
|
+
* plainText, then a minimal Draft.js read (legacy content; the request never asks for DRAFTJS, but a
|
|
46
|
+
* conversion the backend declines could still arrive that way), then an empty answer.
|
|
47
|
+
*/
|
|
48
|
+
export function toQuestion(raw: Raw, imgSrc: ImgSrc): FaqQuestion {
|
|
49
|
+
let answerHtml = "";
|
|
50
|
+
let answerText = "";
|
|
51
|
+
if (raw.richContent?.nodes) {
|
|
52
|
+
answerHtml = richContentToHtml(raw.richContent, imgSrc);
|
|
53
|
+
answerText = richContentToText(raw.richContent);
|
|
54
|
+
} else if (typeof raw.plainText === "string" && raw.plainText) {
|
|
55
|
+
answerHtml = plainTextToHtml(raw.plainText);
|
|
56
|
+
answerText = raw.plainText.trim();
|
|
57
|
+
} else if (typeof raw.draftjs === "string" && raw.draftjs) {
|
|
58
|
+
const blocks = draftjsBlocks(raw.draftjs);
|
|
59
|
+
answerHtml = draftjsToHtml(blocks);
|
|
60
|
+
answerText = blocks.map((b) => b.text).join("\n").trim();
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
id: rawId(raw),
|
|
64
|
+
slug: raw.slug ?? "",
|
|
65
|
+
question: raw.question ?? "",
|
|
66
|
+
answerHtml,
|
|
67
|
+
answerText,
|
|
68
|
+
categoryId: raw.categoryId ?? "",
|
|
69
|
+
sortOrder: numberOrNull(raw.sortOrder),
|
|
70
|
+
shareLink: raw.shareLink ?? "",
|
|
71
|
+
labels: Array.isArray(raw.labels) ? raw.labels.map((l: Raw) => l?.title ?? "").filter(Boolean) : [],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ---- ordering and grouping -------------------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
const bySortOrder = (a: number | null, b: number | null): number => {
|
|
78
|
+
if (a === null && b === null) return 0;
|
|
79
|
+
if (a === null) return 1; // unnumbered after the numbered ones
|
|
80
|
+
if (b === null) return -1;
|
|
81
|
+
return a - b;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** sortOrder ascending, nulls last, then title — a stable order whatever the API returned. */
|
|
85
|
+
export function sortCategories(cs: FaqCategory[]): FaqCategory[] {
|
|
86
|
+
return [...cs].sort((a, b) => bySortOrder(a.sortOrder, b.sortOrder) || a.title.localeCompare(b.title));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** sortOrder ascending, nulls last, then question text. */
|
|
90
|
+
export function sortQuestions(qs: FaqQuestion[]): FaqQuestion[] {
|
|
91
|
+
return [...qs].sort((a, b) => bySortOrder(a.sortOrder, b.sortOrder) || a.question.localeCompare(b.question));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Categories with `questionCount` filled from ALL loaded questions (not the filtered view). */
|
|
95
|
+
export function withCounts(cats: FaqCategory[], qs: FaqQuestion[]): FaqCategory[] {
|
|
96
|
+
const counts = new Map<string, number>();
|
|
97
|
+
for (const q of qs) counts.set(q.categoryId, (counts.get(q.categoryId) ?? 0) + 1);
|
|
98
|
+
return cats.map((c) => ({ ...c, questionCount: counts.get(c.id) ?? 0 }));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Sections in category order, each with its questions in owner order; categories with no question
|
|
103
|
+
* in `qs` are omitted. A question whose categoryId matches no category lands in a synthetic "Other"
|
|
104
|
+
* section at the end (every question must have a category, so this is a stale-reference guard).
|
|
105
|
+
*/
|
|
106
|
+
export function groupByCategory(cats: FaqCategory[], qs: FaqQuestion[]): FaqSection[] {
|
|
107
|
+
const buckets = new Map<string, FaqQuestion[]>();
|
|
108
|
+
for (const q of qs) {
|
|
109
|
+
const list = buckets.get(q.categoryId) ?? [];
|
|
110
|
+
list.push(q);
|
|
111
|
+
buckets.set(q.categoryId, list);
|
|
112
|
+
}
|
|
113
|
+
const sections: FaqSection[] = [];
|
|
114
|
+
for (const c of sortCategories(cats)) {
|
|
115
|
+
const list = buckets.get(c.id);
|
|
116
|
+
if (list?.length) sections.push({ category: { ...c, questionCount: list.length }, questions: sortQuestions(list) });
|
|
117
|
+
buckets.delete(c.id);
|
|
118
|
+
}
|
|
119
|
+
const orphans = [...buckets.values()].flat();
|
|
120
|
+
if (orphans.length) {
|
|
121
|
+
sections.push({
|
|
122
|
+
category: { id: OTHER_CATEGORY_ID, title: OTHER_CATEGORY_TITLE, sortOrder: null, questionCount: orphans.length },
|
|
123
|
+
questions: sortQuestions(orphans),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return sections;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Categories (sorted, counted) + questions (sorted) → the page's data unit. Both transports end here. */
|
|
130
|
+
export function assembleFaq(cats: FaqCategory[], qs: FaqQuestion[], truncated: boolean): FaqData {
|
|
131
|
+
const questions = sortQuestions(qs);
|
|
132
|
+
return { categories: sortCategories(withCounts(cats, questions)), questions, truncated };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Every question, paged until the API says there is no next page or MAX_QUESTIONS is reached. Takes
|
|
137
|
+
* the transport's fetchQuestions so the drain rule lives once; `truncated` says the cap was hit.
|
|
138
|
+
*/
|
|
139
|
+
export async function loadAllQuestions(
|
|
140
|
+
fetchPage: (o: FetchQuestionsOptions) => Promise<FaqQuestionPage>,
|
|
141
|
+
): Promise<{ questions: FaqQuestion[]; truncated: boolean }> {
|
|
142
|
+
const questions: FaqQuestion[] = [];
|
|
143
|
+
let cursor: string | null = null;
|
|
144
|
+
do {
|
|
145
|
+
const page: FaqQuestionPage = await fetchPage({ limit: PAGE_LIMIT, cursor });
|
|
146
|
+
questions.push(...page.questions);
|
|
147
|
+
cursor = page.nextCursor;
|
|
148
|
+
if (cursor && questions.length >= MAX_QUESTIONS) return { questions: questions.slice(0, MAX_QUESTIONS), truncated: true };
|
|
149
|
+
} while (cursor);
|
|
150
|
+
return { questions, truncated: false };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ---- search (client-side by design) -----------------------------------------------------------------
|
|
154
|
+
// The API filters `question` with $startsWith only (the query spec: no $contains, no full-text), so
|
|
155
|
+
// visitor search is a substring match over the loaded set — question AND answer text, case-insensitive
|
|
156
|
+
// — the rule the Wix FAQ widget applies. Never re-implement it against the API.
|
|
157
|
+
|
|
158
|
+
/** Trim, lowercase, collapse whitespace. */
|
|
159
|
+
export const normalizeQuery = (q: string): string => q.trim().toLowerCase().replace(/\s+/g, " ");
|
|
160
|
+
|
|
161
|
+
export function matches(q: FaqQuestion, needle: string): boolean {
|
|
162
|
+
if (!needle) return true;
|
|
163
|
+
return normalizeQuery(q.question).includes(needle) || normalizeQuery(q.answerText).includes(needle);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** "" → qs unchanged. */
|
|
167
|
+
export function search(qs: FaqQuestion[], query: string): FaqQuestion[] {
|
|
168
|
+
const needle = normalizeQuery(query);
|
|
169
|
+
return needle ? qs.filter((q) => matches(q, needle)) : qs;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Category filter first, then search; sorted. What the accordion renders. */
|
|
173
|
+
export function visibleQuestions(data: FaqData | null, activeCategoryId: string | null, query: string): FaqQuestion[] {
|
|
174
|
+
if (!data) return [];
|
|
175
|
+
const inCategory = activeCategoryId ? data.questions.filter((q) => q.categoryId === activeCategoryId) : data.questions;
|
|
176
|
+
return sortQuestions(search(inCategory, query));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ---- deep links -----------------------------------------------------------------------------------------
|
|
180
|
+
// `/faq?category=<id>#q-<slug>`: the category pre-selects the nav, the fragment expands one question. The
|
|
181
|
+
// slug is the API's readonly slug; the id is the fallback so a question without one still has an anchor.
|
|
182
|
+
|
|
183
|
+
export const anchorId = (q: Pick<FaqQuestion, "slug" | "id">): string => `q-${q.slug || q.id}`;
|
|
184
|
+
|
|
185
|
+
export function faqDeepLink(q: Pick<FaqQuestion, "slug" | "id">, base = "/faq", categoryId?: string | null): string {
|
|
186
|
+
return `${base}${categoryId ? `?category=${encodeURIComponent(categoryId)}` : ""}#${anchorId(q)}`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** location.search + location.hash → the deep link's parts (either null when absent). */
|
|
190
|
+
export function parseDeepLink(search: string, hash: string): { categoryId: string | null; anchor: string | null } {
|
|
191
|
+
let categoryId: string | null = null;
|
|
192
|
+
try {
|
|
193
|
+
categoryId = new URLSearchParams(search).get("category") || null;
|
|
194
|
+
} catch {
|
|
195
|
+
/* malformed query string — no category */
|
|
196
|
+
}
|
|
197
|
+
const h = hash.startsWith("#") ? hash.slice(1) : hash;
|
|
198
|
+
let anchor: string | null = null;
|
|
199
|
+
if (h.startsWith("q-") && h.length > 2) {
|
|
200
|
+
try {
|
|
201
|
+
anchor = decodeURIComponent(h.slice(2));
|
|
202
|
+
} catch {
|
|
203
|
+
anchor = h.slice(2);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return { categoryId, anchor };
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** The question an anchor names — by slug, then by id (a slug can change when the question is edited). */
|
|
210
|
+
export function findByAnchor(qs: FaqQuestion[], anchor: string): FaqQuestion | undefined {
|
|
211
|
+
return qs.find((q) => q.slug && q.slug === anchor) ?? qs.find((q) => q.id === anchor);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// ---- structured data ----------------------------------------------------------------------------------
|
|
215
|
+
|
|
216
|
+
/** schema.org FAQPage over the questions. Answer.text carries the sanitized HTML (Google accepts limited HTML there). */
|
|
217
|
+
export function faqJsonLd(qs: FaqQuestion[], pageUrl?: string): Record<string, unknown> {
|
|
218
|
+
return {
|
|
219
|
+
"@context": "https://schema.org",
|
|
220
|
+
"@type": "FAQPage",
|
|
221
|
+
mainEntity: qs.map((q) => ({
|
|
222
|
+
"@type": "Question",
|
|
223
|
+
name: q.question,
|
|
224
|
+
...(pageUrl ? { url: `${pageUrl}#${anchorId(q)}` } : {}),
|
|
225
|
+
acceptedAnswer: { "@type": "Answer", text: q.answerHtml },
|
|
226
|
+
})),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// ---- Ricos → HTML / text --------------------------------------------------------------------------------
|
|
231
|
+
// The subset FAQ answers use. Text is always escaped, attribute values are escaped, no inline styles, no
|
|
232
|
+
// event attributes; a node type outside the table degrades to its text; `htmlData` is never emitted.
|
|
233
|
+
|
|
234
|
+
export function escapeHtml(s: string): string {
|
|
235
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const isHttpUrl = (u: unknown): u is string => typeof u === "string" && /^https?:\/\//i.test(u);
|
|
239
|
+
|
|
240
|
+
/** Ricos Link → the anchor's attributes, or null when the URL is not http(s) (javascript:, data:, relative). */
|
|
241
|
+
function linkAttrs(link: Raw | undefined): string | null {
|
|
242
|
+
if (!link) return null;
|
|
243
|
+
if (isHttpUrl(link.url)) {
|
|
244
|
+
const rel = ["noopener", "noreferrer"];
|
|
245
|
+
if (link.rel?.nofollow) rel.push("nofollow");
|
|
246
|
+
if (link.rel?.sponsored) rel.push("sponsored");
|
|
247
|
+
if (link.rel?.ugc) rel.push("ugc");
|
|
248
|
+
const target = link.target === "BLANK" ? ` target="_blank"` : "";
|
|
249
|
+
return `href="${escapeHtml(link.url)}" rel="${rel.join(" ")}"${target}`;
|
|
250
|
+
}
|
|
251
|
+
if (typeof link.anchor === "string" && link.anchor) return `href="#${escapeHtml(link.anchor)}"`;
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** One TEXT node → inline HTML: escaped text wrapped by its decorations (unknown decorations keep the text). */
|
|
256
|
+
function textNodeToHtml(node: Raw): string {
|
|
257
|
+
let html = escapeHtml(String(node.textData?.text ?? ""));
|
|
258
|
+
for (const d of (node.textData?.decorations ?? []) as Raw[]) {
|
|
259
|
+
switch (d?.type) {
|
|
260
|
+
case "BOLD":
|
|
261
|
+
// The editor writes fontWeightValue 700 for bold and a lighter weight to un-bold inside a bold block.
|
|
262
|
+
if (typeof d.fontWeightValue !== "number" || d.fontWeightValue >= 600) html = `<strong>${html}</strong>`;
|
|
263
|
+
break;
|
|
264
|
+
case "ITALIC":
|
|
265
|
+
if (d.italicData !== false) html = `<em>${html}</em>`;
|
|
266
|
+
break;
|
|
267
|
+
case "UNDERLINE": html = `<u>${html}</u>`; break;
|
|
268
|
+
case "STRIKETHROUGH": html = `<s>${html}</s>`; break;
|
|
269
|
+
case "SUPERSCRIPT": html = `<sup>${html}</sup>`; break;
|
|
270
|
+
case "SUBSCRIPT": html = `<sub>${html}</sub>`; break;
|
|
271
|
+
case "LINK": {
|
|
272
|
+
const attrs = linkAttrs(d.linkData?.link);
|
|
273
|
+
if (attrs) html = `<a ${attrs}>${html}</a>`;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
case "ANCHOR":
|
|
277
|
+
if (typeof d.anchorData?.anchor === "string" && d.anchorData.anchor) html = `<a href="#${escapeHtml(d.anchorData.anchor)}">${html}</a>`;
|
|
278
|
+
break;
|
|
279
|
+
default:
|
|
280
|
+
break; // COLOR, FONT_SIZE, FONT_FAMILY, MENTION, SPOILER, SKETCH, EXTERNAL — text kept, styling dropped
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return html;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The media value in the form imgSrc scales: `wix:image://v1/<id>/<id>#originWidth=W&originHeight=H`
|
|
288
|
+
* (the Ricos FileSource has no filename; the id stands in — the scaler reads only the id). An absolute
|
|
289
|
+
* https URL passes through; anything else is no image.
|
|
290
|
+
*/
|
|
291
|
+
export function imageValue(image: Raw | undefined): string {
|
|
292
|
+
const src = image?.src;
|
|
293
|
+
if (!src) return "";
|
|
294
|
+
if (typeof src.id === "string" && src.id) {
|
|
295
|
+
const size = image?.width && image?.height ? `#originWidth=${image.width}&originHeight=${image.height}` : "";
|
|
296
|
+
return `wix:image://v1/${src.id}/${src.id}${size}`;
|
|
297
|
+
}
|
|
298
|
+
return isHttpUrl(src.url) ? src.url : "";
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function childrenToHtml(node: Raw, imgSrc: ImgSrc): string {
|
|
302
|
+
return ((node.nodes ?? []) as Raw[]).map((n) => nodeToHtml(n, imgSrc)).join("");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function nodeToHtml(node: Raw, imgSrc: ImgSrc): string {
|
|
306
|
+
switch (node?.type) {
|
|
307
|
+
case "TEXT": return textNodeToHtml(node);
|
|
308
|
+
case "PARAGRAPH": return `<p>${childrenToHtml(node, imgSrc)}</p>`;
|
|
309
|
+
// Every answer heading renders as h4: the page's h1 is the FAQ title, h2 the category, h3 the question.
|
|
310
|
+
case "HEADING": return `<h4>${childrenToHtml(node, imgSrc)}</h4>`;
|
|
311
|
+
case "BULLETED_LIST": return `<ul>${childrenToHtml(node, imgSrc)}</ul>`;
|
|
312
|
+
case "ORDERED_LIST": return `<ol>${childrenToHtml(node, imgSrc)}</ol>`;
|
|
313
|
+
case "LIST_ITEM": return `<li>${childrenToHtml(node, imgSrc)}</li>`;
|
|
314
|
+
case "BLOCKQUOTE": return `<blockquote>${childrenToHtml(node, imgSrc)}</blockquote>`;
|
|
315
|
+
case "CODE_BLOCK": return `<pre><code>${childrenToHtml(node, imgSrc)}</code></pre>`;
|
|
316
|
+
case "DIVIDER": return "<hr>";
|
|
317
|
+
case "IMAGE": {
|
|
318
|
+
const src = imgSrc(imageValue(node.imageData?.image), ANSWER_IMAGE_WIDTH, ANSWER_IMAGE_HEIGHT);
|
|
319
|
+
if (!src) return "";
|
|
320
|
+
const alt = escapeHtml(String(node.imageData?.altText ?? ""));
|
|
321
|
+
const img = `<img src="${escapeHtml(src)}" alt="${alt}" loading="lazy" decoding="async">`;
|
|
322
|
+
const attrs = linkAttrs(node.imageData?.link);
|
|
323
|
+
return attrs ? `<a ${attrs}>${img}</a>` : img;
|
|
324
|
+
}
|
|
325
|
+
default: {
|
|
326
|
+
// TABLE, COLLAPSIBLE_LIST, VIDEO, GIF, GALLERY, HTML, EMBED, APP_EMBED, BUTTON, … — text only.
|
|
327
|
+
const text = nodeToText(node).trim();
|
|
328
|
+
return text ? `<p>${escapeHtml(text)}</p>` : "";
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/** Sanitized HTML for a Ricos document ("" for none). */
|
|
334
|
+
export function richContentToHtml(rc: Raw | null | undefined, imgSrc: ImgSrc): string {
|
|
335
|
+
return ((rc?.nodes ?? []) as Raw[]).map((n) => nodeToHtml(n, imgSrc)).join("");
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const INLINE_TYPES = new Set(["TEXT"]);
|
|
339
|
+
|
|
340
|
+
function nodeToText(node: Raw): string {
|
|
341
|
+
if (node?.type === "TEXT") return String(node.textData?.text ?? "");
|
|
342
|
+
if (node?.type === "BUTTON") return String(node.buttonData?.text ?? "");
|
|
343
|
+
const children = (node?.nodes ?? []) as Raw[];
|
|
344
|
+
const parts = children.map(nodeToText);
|
|
345
|
+
// Blocks join with newlines; inline runs concatenate.
|
|
346
|
+
return children.every((c) => INLINE_TYPES.has(c?.type)) ? parts.join("") : parts.filter(Boolean).join("\n");
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/** Plain text of a Ricos document — one line per block ("" for none). */
|
|
350
|
+
export function richContentToText(rc: Raw | null | undefined): string {
|
|
351
|
+
return ((rc?.nodes ?? []) as Raw[]).map(nodeToText).filter(Boolean).join("\n").trim();
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** A plainText answer → one <p> per blank-line paragraph, single newlines as <br>. */
|
|
355
|
+
export function plainTextToHtml(text: string): string {
|
|
356
|
+
return text
|
|
357
|
+
.trim()
|
|
358
|
+
.split(/\n\s*\n/)
|
|
359
|
+
.map((p) => p.trim())
|
|
360
|
+
.filter(Boolean)
|
|
361
|
+
.map((p) => `<p>${escapeHtml(p).replace(/\n/g, "<br>")}</p>`)
|
|
362
|
+
.join("");
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// ---- Draft.js (legacy answers) — a minimal read: block text and block type, no inline styles or entities.
|
|
366
|
+
interface DraftBlock { text: string; type: string }
|
|
367
|
+
|
|
368
|
+
/** The `blocks[]` of a Draft.js raw content string; [] when it is not one. */
|
|
369
|
+
export function draftjsBlocks(raw: string): DraftBlock[] {
|
|
370
|
+
try {
|
|
371
|
+
const parsed = JSON.parse(raw);
|
|
372
|
+
return Array.isArray(parsed?.blocks)
|
|
373
|
+
? parsed.blocks.map((b: Raw) => ({ text: String(b?.text ?? ""), type: String(b?.type ?? "unstyled") }))
|
|
374
|
+
: [];
|
|
375
|
+
} catch {
|
|
376
|
+
return [];
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export function draftjsToHtml(blocks: DraftBlock[]): string {
|
|
381
|
+
let html = "";
|
|
382
|
+
let openList: "ul" | "ol" | null = null;
|
|
383
|
+
const closeList = () => { if (openList) { html += `</${openList}>`; openList = null; } };
|
|
384
|
+
for (const b of blocks) {
|
|
385
|
+
const text = escapeHtml(b.text);
|
|
386
|
+
const list = b.type === "unordered-list-item" ? "ul" : b.type === "ordered-list-item" ? "ol" : null;
|
|
387
|
+
if (list) {
|
|
388
|
+
if (openList !== list) { closeList(); html += `<${list}>`; openList = list; }
|
|
389
|
+
html += `<li>${text}</li>`;
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
closeList();
|
|
393
|
+
if (!b.text.trim()) continue;
|
|
394
|
+
if (b.type.startsWith("header-")) html += `<h4>${text}</h4>`;
|
|
395
|
+
else if (b.type === "blockquote") html += `<blockquote><p>${text}</p></blockquote>`;
|
|
396
|
+
else if (b.type === "code-block") html += `<pre><code>${text}</code></pre>`;
|
|
397
|
+
else html += `<p>${text}</p>`;
|
|
398
|
+
}
|
|
399
|
+
closeList();
|
|
400
|
+
return html;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// ---- the REST spelling of a query -------------------------------------------------------------------
|
|
404
|
+
// The SDK's query builder serializes these itself; the REST twin sends them literally. A cursor encodes
|
|
405
|
+
// the original filter+sort, so a cursor request carries ONLY cursorPaging; the first page carries the
|
|
406
|
+
// sort and the filter. contentFormat and fieldSet sit beside `query`, not inside it.
|
|
407
|
+
|
|
408
|
+
/** POST /faq/v2/categories/query body: every category, owner order, one page (a site has few). */
|
|
409
|
+
export function categoriesQueryBody(): Raw {
|
|
410
|
+
return { query: { sort: SORT, cursorPaging: { limit: PAGE_LIMIT } } };
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** POST /faq/v2/question-entries/query body for one page. */
|
|
414
|
+
export function questionsQueryBody({ categoryId = null, limit = PAGE_LIMIT, cursor = null }: FetchQuestionsOptions = {}): Raw {
|
|
415
|
+
const size = Math.min(Math.max(1, limit), PAGE_LIMIT);
|
|
416
|
+
const query: Raw = cursor
|
|
417
|
+
? { cursorPaging: { limit: size, cursor } }
|
|
418
|
+
: { ...(categoryId ? { filter: { categoryId: { $eq: categoryId } } } : {}), sort: SORT, cursorPaging: { limit: size } };
|
|
419
|
+
return { query, contentFormat: CONTENT_FORMAT, fieldSet: [...FIELD_SET] };
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/** POST /faq/v2/question-entries/query body for one question by id — the same read (and permission) as the page. */
|
|
423
|
+
export function questionByIdBody(id: string): Raw {
|
|
424
|
+
return { query: { filter: { _id: { $eq: id } }, cursorPaging: { limit: 1 } }, contentFormat: CONTENT_FORMAT, fieldSet: [...FIELD_SET] };
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/** `pagingMetadata` → the next cursor, or null when the response says there is no next page. */
|
|
428
|
+
export const nextCursor = (pm: Raw | undefined | null): string | null => (pm?.hasNext ? pm.cursors?.next ?? null : null);
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// FAQ page state — a module-scope store, deliberately NOT a React context and not a per-surface
|
|
2
|
+
// factory: the category nav, the search box, and the accordion are separate Astro islands on one
|
|
3
|
+
// page and must share one state (a context can't span islands; each island is its own React root).
|
|
4
|
+
// Framework-free — consume it through useFaq() (hooks/), or subscribe directly from a static page,
|
|
5
|
+
// Vue, or Svelte. Same shape as the storefront cart store: getState/subscribe + actions, emit after
|
|
6
|
+
// every change.
|
|
7
|
+
//
|
|
8
|
+
// Seeding: every island receives the SSR data and calls seedFaq(); on the server every seed replaces
|
|
9
|
+
// the state (a request renders its own props), in the browser the first seed wins and the rest are
|
|
10
|
+
// no-ops, so the SSR HTML and the first client paint agree. A page with no SSR data (a SPA) fetches on
|
|
11
|
+
// the first subscription.
|
|
12
|
+
//
|
|
13
|
+
// URL state (syncUrl, default on): `?category=<id>` and `#q-<slug>` are read once when the first
|
|
14
|
+
// island subscribes and written with history.replaceState on every change — a visitor can copy the
|
|
15
|
+
// address bar at any point and get back to the same view.
|
|
16
|
+
import { fetchFaq } from "./faq";
|
|
17
|
+
import { anchorId, findByAnchor, parseDeepLink, visibleQuestions } from "./faq-core";
|
|
18
|
+
import type { FaqData, FaqQuestion } from "./types";
|
|
19
|
+
|
|
20
|
+
export interface FaqState {
|
|
21
|
+
/** null while the first load is in flight and nothing was seeded — render skeletons, not an empty state. */
|
|
22
|
+
data: FaqData | null;
|
|
23
|
+
/** null = all categories (sections); an id = that category only. */
|
|
24
|
+
activeCategoryId: string | null;
|
|
25
|
+
query: string;
|
|
26
|
+
/** Expanded question ids; at most one when expandOnlyOne. */
|
|
27
|
+
expandedIds: string[];
|
|
28
|
+
/** Derived on every change: category filter, then search, in owner order — what the accordion renders. */
|
|
29
|
+
visible: FaqQuestion[];
|
|
30
|
+
/** visible.length while a query is typed, 0 otherwise — for the results announcement. */
|
|
31
|
+
resultsCount: number;
|
|
32
|
+
loading: boolean;
|
|
33
|
+
/** The last failed load's message — render it with a retry; a new load clears it. */
|
|
34
|
+
error: string | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface FaqStoreOptions {
|
|
38
|
+
/** SSR data — no client fetch happens when present. */
|
|
39
|
+
initialData?: FaqData;
|
|
40
|
+
/** The `?category=` the server saw (validated by the page); null/undefined = all. */
|
|
41
|
+
initialCategoryId?: string | null;
|
|
42
|
+
/** One open answer at a time (default true — the accordion behaviour). */
|
|
43
|
+
expandOnlyOne?: boolean;
|
|
44
|
+
/** Open the first visible answer on load (default false). */
|
|
45
|
+
openFirst?: boolean;
|
|
46
|
+
/** Read `?category` and `#q-…` on start and write them on change (default true). */
|
|
47
|
+
syncUrl?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const EMPTY_DATA: FaqData = { categories: [], questions: [], truncated: false };
|
|
51
|
+
|
|
52
|
+
let state: FaqState = {
|
|
53
|
+
data: null,
|
|
54
|
+
activeCategoryId: null,
|
|
55
|
+
query: "",
|
|
56
|
+
expandedIds: [],
|
|
57
|
+
visible: [],
|
|
58
|
+
resultsCount: 0,
|
|
59
|
+
loading: false,
|
|
60
|
+
error: null,
|
|
61
|
+
};
|
|
62
|
+
let expandOnlyOne = true;
|
|
63
|
+
let openFirst = false;
|
|
64
|
+
let syncUrl = true;
|
|
65
|
+
let seeded = false;
|
|
66
|
+
let started = false;
|
|
67
|
+
let generation = 0; // bumped by every load; a response from an older generation is dropped
|
|
68
|
+
const listeners = new Set<() => void>();
|
|
69
|
+
|
|
70
|
+
const isBrowser = (): boolean => typeof window !== "undefined";
|
|
71
|
+
|
|
72
|
+
function setState(patch: Partial<FaqState>): void {
|
|
73
|
+
const next = { ...state, ...patch };
|
|
74
|
+
next.visible = visibleQuestions(next.data, next.activeCategoryId, next.query);
|
|
75
|
+
next.resultsCount = next.query.trim() ? next.visible.length : 0;
|
|
76
|
+
state = next;
|
|
77
|
+
for (const l of listeners) l();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function writeUrl(): void {
|
|
81
|
+
if (!syncUrl || !isBrowser() || typeof history === "undefined") return;
|
|
82
|
+
const url = new URL(location.href);
|
|
83
|
+
if (state.activeCategoryId) url.searchParams.set("category", state.activeCategoryId);
|
|
84
|
+
else url.searchParams.delete("category");
|
|
85
|
+
const open = state.expandedIds.length === 1 ? state.visible.find((q) => q.id === state.expandedIds[0]) : undefined;
|
|
86
|
+
url.hash = open ? anchorId(open) : "";
|
|
87
|
+
try {
|
|
88
|
+
history.replaceState(history.state, "", url.pathname + url.search + url.hash);
|
|
89
|
+
} catch {
|
|
90
|
+
/* a sandboxed frame may refuse — the view is right, only the address bar lags */
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** `?category` and `#q-…` from the address bar → state: the anchor's question expands and its category is shown. */
|
|
95
|
+
function applyDeepLink(): void {
|
|
96
|
+
if (!syncUrl || !isBrowser() || !state.data) return;
|
|
97
|
+
const { categoryId, anchor } = parseDeepLink(location.search, location.hash);
|
|
98
|
+
const patch: Partial<FaqState> = {};
|
|
99
|
+
if (categoryId && state.data.categories.some((c) => c.id === categoryId)) patch.activeCategoryId = categoryId;
|
|
100
|
+
const target = anchor ? findByAnchor(state.data.questions, anchor) : undefined;
|
|
101
|
+
if (target) {
|
|
102
|
+
patch.expandedIds = expandOnlyOne ? [target.id] : [...new Set([...state.expandedIds, target.id])];
|
|
103
|
+
// The deep link decides the category: a question hidden by the active filter switches the filter to its own.
|
|
104
|
+
const active = patch.activeCategoryId ?? state.activeCategoryId;
|
|
105
|
+
if (active && active !== target.categoryId) patch.activeCategoryId = target.categoryId;
|
|
106
|
+
}
|
|
107
|
+
if (Object.keys(patch).length) setState(patch);
|
|
108
|
+
if (target && typeof document !== "undefined") {
|
|
109
|
+
requestAnimationFrame(() => document.getElementById(anchorId(target))?.scrollIntoView({ block: "start" }));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function load(): void {
|
|
114
|
+
const id = ++generation;
|
|
115
|
+
setState({ loading: true, error: null });
|
|
116
|
+
fetchFaq()
|
|
117
|
+
.then((data) => {
|
|
118
|
+
if (generation !== id) return; // superseded — drop it
|
|
119
|
+
setState({ data, loading: false, expandedIds: openFirst ? firstId(data) : state.expandedIds });
|
|
120
|
+
applyDeepLink();
|
|
121
|
+
})
|
|
122
|
+
.catch((e) => {
|
|
123
|
+
if (generation !== id) return;
|
|
124
|
+
// An empty data set with an error: the accordion shows the error line and a retry, not skeletons forever.
|
|
125
|
+
setState({ data: state.data ?? EMPTY_DATA, loading: false, error: e instanceof Error ? e.message : String(e) });
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function firstId(data: FaqData): string[] {
|
|
130
|
+
const first = visibleQuestions(data, state.activeCategoryId, state.query)[0];
|
|
131
|
+
return first ? [first.id] : [];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function start(): void {
|
|
135
|
+
if (started) return;
|
|
136
|
+
started = true;
|
|
137
|
+
if (state.data) applyDeepLink();
|
|
138
|
+
else load();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Hand the store its SSR data and options. Call from every island (useFaq does) — on the server each
|
|
143
|
+
* call replaces the state (one request, one data set); in the browser the first call seeds and later
|
|
144
|
+
* calls are no-ops, so hydration matches the server HTML.
|
|
145
|
+
*/
|
|
146
|
+
export function seedFaq(o: FaqStoreOptions = {}): void {
|
|
147
|
+
if (o.expandOnlyOne !== undefined) expandOnlyOne = o.expandOnlyOne;
|
|
148
|
+
if (o.openFirst !== undefined) openFirst = o.openFirst;
|
|
149
|
+
if (o.syncUrl !== undefined) syncUrl = o.syncUrl;
|
|
150
|
+
if (!o.initialData || (seeded && isBrowser())) return;
|
|
151
|
+
seeded = true;
|
|
152
|
+
const activeCategoryId =
|
|
153
|
+
o.initialCategoryId && o.initialData.categories.some((c) => c.id === o.initialCategoryId) ? o.initialCategoryId : null;
|
|
154
|
+
const data = o.initialData;
|
|
155
|
+
state = { ...state, data, activeCategoryId, loading: false, error: null };
|
|
156
|
+
state.visible = visibleQuestions(data, activeCategoryId, state.query);
|
|
157
|
+
state.resultsCount = 0;
|
|
158
|
+
state.expandedIds = openFirst ? firstId(data) : [];
|
|
159
|
+
// No emit: seeding happens during render, before any subscriber exists.
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function getFaqState(): FaqState {
|
|
163
|
+
return state;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** The first browser subscriber starts the store: the deep link is applied, and unseeded data is fetched. */
|
|
167
|
+
export function subscribeFaq(listener: () => void): () => void {
|
|
168
|
+
listeners.add(listener);
|
|
169
|
+
if (isBrowser()) start();
|
|
170
|
+
return () => listeners.delete(listener);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Show one category (null = all). Keeps the search query — the two compose. */
|
|
174
|
+
export function selectCategory(id: string | null): void {
|
|
175
|
+
if (id === state.activeCategoryId) return;
|
|
176
|
+
setState({ activeCategoryId: id });
|
|
177
|
+
writeUrl();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Set the search query (debounce lives in the component). */
|
|
181
|
+
export function setQuery(q: string): void {
|
|
182
|
+
if (q === state.query) return;
|
|
183
|
+
setState({ query: q });
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function toggleQuestion(id: string): void {
|
|
187
|
+
if (state.expandedIds.includes(id)) collapseQuestion(id);
|
|
188
|
+
else expandQuestion(id);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function expandQuestion(id: string): void {
|
|
192
|
+
if (state.expandedIds.includes(id)) return;
|
|
193
|
+
setState({ expandedIds: expandOnlyOne ? [id] : [...state.expandedIds, id] });
|
|
194
|
+
writeUrl();
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function collapseQuestion(id: string): void {
|
|
198
|
+
if (!state.expandedIds.includes(id)) return;
|
|
199
|
+
setState({ expandedIds: state.expandedIds.filter((x) => x !== id) });
|
|
200
|
+
writeUrl();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function collapseAll(): void {
|
|
204
|
+
if (!state.expandedIds.length) return;
|
|
205
|
+
setState({ expandedIds: [] });
|
|
206
|
+
writeUrl();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Re-run the load after an error. */
|
|
210
|
+
export function retry(): void {
|
|
211
|
+
load();
|
|
212
|
+
}
|