@wix/agent-skills 1.17.0 → 1.18.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.
Files changed (246) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +115 -12
  3. package/skills/wix-app/references/APP_MARKET_REVIEW.md +1 -1
  4. package/skills/wix-app/references/BACKEND_API.md +18 -0
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +6 -0
  6. package/skills/wix-app/references/DASHBOARD_MODAL.md +10 -2
  7. package/skills/wix-app/references/DASHBOARD_PAGE.md +32 -70
  8. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +14 -3
  9. package/skills/wix-app/references/SITE_PLUGIN.md +12 -0
  10. package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +74 -68
  11. package/skills/wix-app/references/dashboard-page/COLLECTION_TOOLKIT.md +79 -0
  12. package/skills/wix-app/references/dashboard-page/ENTITY_PAGE_TOOLKIT.md +73 -0
  13. package/skills/wix-app/references/dashboard-page/PATTERNS_BUNDLE_READING.md +52 -0
  14. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +184 -0
  15. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +12 -11
  16. package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +1 -0
  17. package/skills/wix-app/references/editor-react-component/BROWSER-SUPPORT.md +56 -0
  18. package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +16 -8
  19. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +19 -1
  20. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +3 -0
  21. package/skills/wix-base44-connector/SKILL.md +133 -44
  22. package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +78 -0
  23. package/skills/wix-base44-connector/scripts/utils.js +216 -30
  24. package/skills/wix-headless/entry/skill.md +1 -1
  25. package/skills/wix-headless/references/CAPABILITIES.md +9 -1
  26. package/skills/wix-headless/references/DESIGN.md +1 -0
  27. package/skills/wix-headless/references/DISCOVERY.md +2 -1
  28. package/skills/wix-headless/references/IMAGE_GENERATION.md +1 -0
  29. package/skills/wix-headless/references/SDK_HANDOFF.md +4 -1
  30. package/skills/wix-headless/references/SEED.md +2 -1
  31. package/skills/wix-headless/references/SETUP.md +1 -0
  32. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +2 -2
  33. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +26 -8
  34. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +26 -10
  35. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +8 -8
  36. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +1 -1
  37. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +1 -1
  38. package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +254 -0
  39. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +13 -0
  40. package/skills/wix-headless/references/inline-recipes/setup-rentals.md +254 -0
  41. package/skills/wix-headless/references/non-astro.md +1 -1
  42. package/skills/wix-headless-fast/SKILL.md +166 -0
  43. package/skills/wix-headless-fast/entry/skill.md +99 -0
  44. package/skills/wix-headless-fast/install/deploy.mjs +433 -0
  45. package/skills/wix-headless-fast/install/fast-path.mjs +141 -0
  46. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +137 -0
  47. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +137 -0
  48. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +113 -0
  49. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +42 -0
  50. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +123 -0
  51. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +70 -0
  52. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +99 -0
  53. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +76 -0
  54. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +62 -0
  55. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +40 -0
  56. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +99 -0
  57. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +24 -0
  58. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +16156 -0
  59. package/skills/wix-headless-fast/references/blog/seed/SEED.md +72 -0
  60. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +287 -0
  61. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +129 -0
  62. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +143 -0
  63. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +119 -0
  64. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +138 -0
  65. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +54 -0
  66. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +206 -0
  67. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +96 -0
  68. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +70 -0
  69. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +40 -0
  70. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +76 -0
  71. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +22 -0
  72. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +11962 -0
  73. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +61 -0
  74. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +302 -0
  75. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +179 -0
  76. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +83 -0
  77. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +57 -0
  78. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +151 -0
  79. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +75 -0
  80. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +41 -0
  81. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +11262 -0
  82. package/skills/wix-headless-fast/references/cms/seed/SEED.md +103 -0
  83. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +324 -0
  84. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +149 -0
  85. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +66 -0
  86. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +176 -0
  87. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +118 -0
  88. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +117 -0
  89. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +59 -0
  90. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +136 -0
  91. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +128 -0
  92. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +61 -0
  93. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +40 -0
  94. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +12 -0
  95. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +80 -0
  96. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +21 -0
  97. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +11884 -0
  98. package/skills/wix-headless-fast/references/events/seed/SEED.md +86 -0
  99. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +276 -0
  100. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +150 -0
  101. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +317 -0
  102. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +269 -0
  103. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +231 -0
  104. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +135 -0
  105. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +10593 -0
  106. package/skills/wix-headless-fast/references/forms/seed/SEED.md +108 -0
  107. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +320 -0
  108. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +63 -0
  109. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +60 -0
  110. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +155 -0
  111. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +78 -0
  112. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +47 -0
  113. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +66 -0
  114. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +88 -0
  115. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +53 -0
  116. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +122 -0
  117. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +50 -0
  118. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +21 -0
  119. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +42 -0
  120. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +10 -0
  121. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +11 -0
  122. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +10329 -0
  123. package/skills/wix-headless-fast/references/members/seed/SEED.md +39 -0
  124. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +94 -0
  125. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +134 -0
  126. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
  127. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
  128. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +115 -0
  129. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +59 -0
  130. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +39 -0
  131. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +58 -0
  132. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +165 -0
  133. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +55 -0
  134. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
  135. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
  136. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +21 -0
  137. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +29 -0
  138. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +10197 -0
  139. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +78 -0
  140. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +258 -0
  141. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +133 -0
  142. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +58 -0
  143. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +126 -0
  144. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +37 -0
  145. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +39 -0
  146. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +75 -0
  147. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +45 -0
  148. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +30 -0
  149. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
  150. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +40 -0
  151. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +21 -0
  152. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +11226 -0
  153. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +71 -0
  154. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +279 -0
  155. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +165 -0
  156. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +142 -0
  157. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
  158. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
  159. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +155 -0
  160. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +55 -0
  161. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +43 -0
  162. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +177 -0
  163. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +165 -0
  164. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +103 -0
  165. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +254 -0
  166. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +146 -0
  167. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +168 -0
  168. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
  169. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +22 -0
  170. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +12 -0
  171. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +12560 -0
  172. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +81 -0
  173. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +479 -0
  174. package/skills/wix-headless-fast/references/shared/CONTENT.md +22 -0
  175. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +73 -0
  176. package/skills/wix-headless-fast/references/shared/DESIGN.md +26 -0
  177. package/skills/wix-headless-fast/references/shared/app/styles/global.css +52 -0
  178. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +15 -0
  179. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +27 -0
  180. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +24 -0
  181. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +76 -0
  182. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
  183. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +46 -0
  184. package/skills/wix-headless-fast/references/shared/seed/images.mjs +145 -0
  185. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +149 -0
  186. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +26 -0
  187. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +121 -0
  188. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductCard.tsx +100 -0
  189. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductDetailView.tsx +130 -0
  190. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductGrid.tsx +48 -0
  191. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ShopView.tsx +66 -0
  192. package/skills/wix-headless-fast/references/storefront/app/components/storefront/VariantPicker.tsx +103 -0
  193. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +48 -0
  194. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +140 -0
  195. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +80 -0
  196. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +101 -0
  197. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +221 -0
  198. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +215 -0
  199. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +109 -0
  200. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +46 -0
  201. package/skills/wix-headless-fast/references/storefront/app-astro/pages/products/[slug].astro +56 -0
  202. package/skills/wix-headless-fast/references/storefront/app-astro/pages/shop.astro +23 -0
  203. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +12247 -0
  204. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +85 -0
  205. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +415 -0
  206. package/skills/wix-manage/SKILL.md +18 -2
  207. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +141 -0
  208. package/skills/wix-manage/references/google-business-profile/connect-google-business-profile.md +134 -0
  209. package/skills/wix-manage/references/google-business-profile/manage-google-business-profile-locations.md +182 -0
  210. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +3 -0
  211. package/skills/wix-manage/references/stores/create-product-catalog-v3.md +21 -6
  212. package/skills/wix-manage/references/stores/update-product-with-options.md +83 -0
  213. package/skills/wix-vibe-headless/SKILL.md +18 -4
  214. package/skills/wix-vibe-headless/install/deploy.cjs +12 -4
  215. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +2 -1
  216. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +3 -1
  217. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +3 -1
  218. package/skills/wix-vibe-headless/platforms/base44.md +23 -61
  219. package/skills/wix-vibe-headless/platforms/generic.md +6 -3
  220. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +43 -0
  221. package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +67 -0
  222. package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +128 -0
  223. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +5 -3
  224. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +250 -0
  225. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +12 -5
  226. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +41 -0
  227. package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.js +267 -0
  228. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +6 -3
  229. package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +470 -0
  230. package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +425 -0
  231. package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +187 -0
  232. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +238 -0
  233. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +108 -0
  234. package/skills/wix-vibe-headless/references/forms/seed/SEED.md +1762 -0
  235. package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +13 -0
  236. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +137 -84
  237. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +15 -8
  238. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +37 -0
  239. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +18 -6
  240. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +30 -7
  241. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +46 -10
  242. package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +0 -110
  243. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +0 -51
  244. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +0 -49
  245. package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +0 -92
  246. package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +0 -139
@@ -0,0 +1,215 @@
1
+ // Catalog reads (Wix Stores Catalog V3) — the only file that touches raw catalog entities.
2
+ // Everything it returns is a plain DTO from ./types: images resolved, prices formatted,
3
+ // variants normalized. Copy as-is; extend by adding functions, not by editing these.
4
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/search-products.md
5
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/get-product-by-slug.md
6
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/categories/query-categories.md
7
+ import { productsV3 } from "@wix/stores";
8
+ import { categories as categoriesModule } from "@wix/categories";
9
+ import { wixModule } from "../sdk";
10
+ import { imgSrc } from "../media";
11
+ import type {
12
+ Category,
13
+ ProductDetail,
14
+ ProductOption,
15
+ ProductModifier,
16
+ ProductSummary,
17
+ ProductVariant,
18
+ Availability,
19
+ } from "./types";
20
+
21
+ const products = wixModule(productsV3);
22
+ const categories = wixModule(categoriesModule);
23
+
24
+ // Requested on every product read. CURRENCY populates formattedAmount (without it, prices render
25
+ // as bare unlocalized numbers); MEDIA_ITEMS_INFO populates the gallery; the detail read adds
26
+ // PLAIN_DESCRIPTION and VARIANT_OPTION_CHOICE_NAMES (which populates variantsInfo.variants).
27
+ const LIST_FIELDS = ["CURRENCY", "MEDIA_ITEMS_INFO"];
28
+ const DETAIL_FIELDS = [...LIST_FIELDS, "PLAIN_DESCRIPTION", "VARIANT_OPTION_CHOICE_NAMES"];
29
+
30
+ type RawProduct = Record<string, any>;
31
+
32
+ function toAvailability(raw: RawProduct): Availability {
33
+ const status = raw.inventory?.availabilityStatus;
34
+ return status === "OUT_OF_STOCK" || status === "PARTIALLY_OUT_OF_STOCK"
35
+ ? status
36
+ : "IN_STOCK";
37
+ }
38
+
39
+ function toSummary(raw: RawProduct): ProductSummary {
40
+ const options: RawProduct[] = raw.options ?? [];
41
+ const galleryItems: RawProduct[] = raw.media?.itemsInfo?.items ?? [];
42
+ const mainUrl = imgSrc(raw.media?.main, 800, 800);
43
+ const hover = galleryItems
44
+ .map((m) => imgSrc(m.image ?? m, 800, 800))
45
+ .filter((u) => u && u !== mainUrl);
46
+ const availability = toAvailability(raw);
47
+ const preorder = raw.inventory?.preorderStatus === "ENABLED" && availability === "OUT_OF_STOCK";
48
+ const optionsSummary = options
49
+ .map((o) => {
50
+ const visible = (o.choicesSettings?.choices ?? []).filter((c: RawProduct) => c.visible !== false);
51
+ return `${visible.length} ${String(o.name ?? "").toLowerCase()}${visible.length === 1 ? "" : "s"}`;
52
+ })
53
+ .join(" · ");
54
+ return {
55
+ id: raw._id ?? "",
56
+ slug: raw.slug ?? "",
57
+ name: raw.name ?? "",
58
+ price: raw.actualPriceRange?.minValue?.formattedAmount ?? "",
59
+ maxPrice: raw.actualPriceRange?.maxValue?.formattedAmount ?? "",
60
+ compareAtPrice: raw.compareAtPriceRange?.minValue?.formattedAmount ?? null,
61
+ ribbon: raw.ribbon?.name ?? null,
62
+ availability,
63
+ preorder,
64
+ imageUrl: mainUrl,
65
+ hoverImageUrl: hover[0] ?? "",
66
+ optionsSummary,
67
+ quickAddable: options.length === 0 && availability === "IN_STOCK",
68
+ };
69
+ }
70
+
71
+ function toOptions(raw: RawProduct): ProductOption[] {
72
+ return (raw.options ?? []).map((o: RawProduct) => {
73
+ const isColor = o.optionRenderType === "SWATCH_CHOICES" || o.optionRenderType === "COLOR_CHOICES";
74
+ return {
75
+ id: o._id ?? o.id ?? o.name ?? "",
76
+ name: o.name ?? "",
77
+ isColor,
78
+ choices: (o.choicesSettings?.choices ?? [])
79
+ .filter((c: RawProduct) => c.visible !== false)
80
+ .map((c: RawProduct) => ({
81
+ choiceId: c.choiceId ?? "",
82
+ name: c.name ?? "",
83
+ colorCode: c.colorCode ?? null,
84
+ inStock: c.inStock !== false,
85
+ })),
86
+ };
87
+ });
88
+ }
89
+
90
+ function toModifiers(raw: RawProduct): ProductModifier[] {
91
+ return (raw.modifiers ?? []).map((m: RawProduct) => ({
92
+ key: m.key ?? m.freeTextSettings?.key ?? m.name ?? "",
93
+ name: m.name ?? "",
94
+ mandatory: m.mandatory === true,
95
+ type: m.modifierRenderType === "FREE_TEXT" ? ("text" as const) : ("choices" as const),
96
+ choices: (m.choicesSettings?.choices ?? []).map((c: RawProduct) => ({
97
+ key: c.key ?? c.name ?? "",
98
+ name: c.name ?? "",
99
+ })),
100
+ }));
101
+ }
102
+
103
+ function toVariants(raw: RawProduct): ProductVariant[] {
104
+ return (raw.variantsInfo?.variants ?? []).map((v: RawProduct) => {
105
+ const choices: Record<string, string> = {};
106
+ for (const c of v.choices ?? []) {
107
+ const names = c.optionChoiceNames;
108
+ if (names?.optionName) choices[names.optionName] = names.choiceName ?? "";
109
+ }
110
+ return {
111
+ variantId: v._id ?? v.variantId ?? "",
112
+ choices,
113
+ price: v.price?.actualPrice?.formattedAmount ?? "",
114
+ compareAtPrice: v.price?.compareAtPrice?.formattedAmount ?? null,
115
+ inStock: v.inventoryStatus?.inStock !== false,
116
+ };
117
+ });
118
+ }
119
+
120
+ function toDetail(raw: RawProduct): ProductDetail {
121
+ const summary = toSummary(raw);
122
+ const gallery = [
123
+ summary.imageUrl,
124
+ ...(raw.media?.itemsInfo?.items ?? []).map((m: RawProduct) => imgSrc(m.image ?? m, 1200, 1200)),
125
+ ].filter((u, i, arr) => u && arr.indexOf(u) === i);
126
+ return {
127
+ ...summary,
128
+ descriptionHtml: raw.plainDescription ?? "",
129
+ gallery,
130
+ options: toOptions(raw),
131
+ modifiers: toModifiers(raw),
132
+ variants: toVariants(raw),
133
+ };
134
+ }
135
+
136
+ /** List visible products (newest catalog order), mapped to grid-ready DTOs. */
137
+ export async function fetchProducts({ limit = 100 } = {}): Promise<ProductSummary[]> {
138
+ const res = await products
139
+ .queryProducts({ fields: LIST_FIELDS as any })
140
+ .limit(limit)
141
+ .find();
142
+ return (res.items ?? []).map((p) => toSummary(p as RawProduct));
143
+ }
144
+
145
+ /**
146
+ * List visible products in a category, server-side-filtered by the live category id.
147
+ * Category filtering MUST go through searchProducts (the field is not filterable in
148
+ * queryProducts) with the $matchItems operator — this is encoded here so callers never
149
+ * reconstruct it.
150
+ */
151
+ export async function fetchProductsByCategory(
152
+ categoryId: string,
153
+ { limit = 100 } = {},
154
+ ): Promise<ProductSummary[]> {
155
+ const res: RawProduct = await products.searchProducts(
156
+ {
157
+ filter: { "allCategoriesInfo.categories": { $matchItems: [{ id: categoryId }] } },
158
+ cursorPaging: { limit },
159
+ },
160
+ { fields: LIST_FIELDS as any },
161
+ );
162
+ return (res.products ?? []).map((p: RawProduct) => toSummary(p));
163
+ }
164
+
165
+ /** Fetch one product by its URL slug, with options/modifiers/variants. Null when not found. */
166
+ export async function fetchProductBySlug(slug: string): Promise<ProductDetail | null> {
167
+ try {
168
+ const res = await products.getProductBySlug(slug, { fields: DETAIL_FIELDS as any });
169
+ return res.product ? toDetail(res.product as RawProduct) : null;
170
+ } catch {
171
+ return null;
172
+ }
173
+ }
174
+
175
+ /**
176
+ * List the store's categories for nav/filter UI, minus Wix's auto-created "all-products"
177
+ * system category. The query must carry a filter condition (`.exists("name", true)` — a
178
+ * tautology): a bare .find() serializes an empty filter that the API rejects on the
179
+ * visitor-client path. Treat a failure as "no category nav", not a fatal error.
180
+ */
181
+ export async function fetchCategories(): Promise<Category[]> {
182
+ try {
183
+ const res = await categories
184
+ .queryCategories({ treeReference: { appNamespace: "@wix/stores" } })
185
+ .exists("name", true)
186
+ .find();
187
+ return (res.items ?? [])
188
+ .map((c) => ({
189
+ id: (c as RawProduct)._id ?? "",
190
+ slug: (c as RawProduct).slug ?? "",
191
+ name: (c as RawProduct).name ?? "",
192
+ }))
193
+ .filter((c) => c.slug !== "all-products");
194
+ } catch {
195
+ return [];
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Resolve the variant for the buyer's selections (optionName -> choiceName).
201
+ * A product with no options resolves to its single variant; with options, every option
202
+ * must be selected and match. Returns null while the selection is incomplete.
203
+ */
204
+ export function resolveVariant(
205
+ detail: ProductDetail,
206
+ selections: Record<string, string>,
207
+ ): ProductVariant | null {
208
+ if (detail.options.length === 0) return detail.variants[0] ?? null;
209
+ if (!detail.options.every((o) => selections[o.name])) return null;
210
+ return (
211
+ detail.variants.find((v) =>
212
+ detail.options.every((o) => v.choices[o.name] === selections[o.name]),
213
+ ) ?? null
214
+ );
215
+ }
@@ -0,0 +1,109 @@
1
+ // Storefront DTOs — the serializable shapes every hook, component, and page consumes.
2
+ // These are plain JSON: safe to pass as Astro island props or across a server/client
3
+ // boundary. Image values are already-resolved https URLs (never wix:image://), and every
4
+ // displayable price is a ready formatted string.
5
+
6
+ export type Availability = "IN_STOCK" | "OUT_OF_STOCK" | "PARTIALLY_OUT_OF_STOCK";
7
+
8
+ /** A product as a listing/grid tile needs it. */
9
+ export interface ProductSummary {
10
+ id: string;
11
+ slug: string;
12
+ name: string;
13
+ /** Lowest price, formatted with currency symbol (e.g. "€34.99"). */
14
+ price: string;
15
+ /** Highest price, formatted — differs from `price` when variants are priced differently. */
16
+ maxPrice: string;
17
+ /** Strikethrough "was" price, formatted; null when not on sale. */
18
+ compareAtPrice: string | null;
19
+ /** Merchant-set badge ("New", "Best Seller"); null when none. */
20
+ ribbon: string | null;
21
+ availability: Availability;
22
+ /** OUT_OF_STOCK but pre-orderable — label "Pre-order", not "Sold out". */
23
+ preorder: boolean;
24
+ /** Resolved https URL of the main image ("" when the product has none). */
25
+ imageUrl: string;
26
+ /** Resolved https URL of the second gallery image ("" when there is only one). */
27
+ hoverImageUrl: string;
28
+ /** e.g. "2 colors · 3 sizes"; "" for a single-variant product. */
29
+ optionsSummary: string;
30
+ /** True when the product can be added to the cart with no choices (single variant, in stock). */
31
+ quickAddable: boolean;
32
+ }
33
+
34
+ export interface OptionChoice {
35
+ choiceId: string;
36
+ name: string;
37
+ /** Hex color for swatch rendering; null for text choices. */
38
+ colorCode: string | null;
39
+ inStock: boolean;
40
+ }
41
+
42
+ export interface ProductOption {
43
+ id: string;
44
+ name: string;
45
+ /** Render choices as color swatches (true) or text pills (false). */
46
+ isColor: boolean;
47
+ choices: OptionChoice[];
48
+ }
49
+
50
+ export interface ProductModifier {
51
+ key: string;
52
+ name: string;
53
+ mandatory: boolean;
54
+ /** "choices" renders pills; "text" renders a free-text input. */
55
+ type: "choices" | "text";
56
+ choices: { key: string; name: string }[];
57
+ }
58
+
59
+ export interface ProductVariant {
60
+ variantId: string;
61
+ /** The option selections this variant answers to: optionName -> choiceName. */
62
+ choices: Record<string, string>;
63
+ price: string;
64
+ compareAtPrice: string | null;
65
+ inStock: boolean;
66
+ }
67
+
68
+ /** A product as the detail page needs it. */
69
+ export interface ProductDetail extends ProductSummary {
70
+ /** Product description as an HTML string — render with innerHTML, not as text. */
71
+ descriptionHtml: string;
72
+ /** Every gallery image as a resolved https URL, main image first, de-duplicated. */
73
+ gallery: string[];
74
+ options: ProductOption[];
75
+ modifiers: ProductModifier[];
76
+ variants: ProductVariant[];
77
+ }
78
+
79
+ export interface Category {
80
+ id: string;
81
+ slug: string;
82
+ name: string;
83
+ }
84
+
85
+ export interface CartLine {
86
+ /** The cart line id — what update/remove take (NOT the product id). */
87
+ lineItemId: string;
88
+ productName: string;
89
+ quantity: number;
90
+ /** Per-unit price, formatted. */
91
+ unitPrice: string;
92
+ /** Line total, formatted. */
93
+ linePrice: string;
94
+ /** Resolved https URL ("" when none). */
95
+ imageUrl: string;
96
+ /** Human-readable option/modifier labels, e.g. ["Color: Ink", "Size: M"]. */
97
+ descriptionLines: string[];
98
+ /** Not IN_STOCK → the line can't be checked out as-is. */
99
+ status: string;
100
+ }
101
+
102
+ export interface Cart {
103
+ lines: CartLine[];
104
+ /** Sum of line quantities. */
105
+ itemCount: number;
106
+ /** Formatted subtotal (after discounts) — from the cart estimate, not hand-summed. */
107
+ subtotal: string;
108
+ currency: string;
109
+ }
@@ -0,0 +1,46 @@
1
+ ---
2
+ // The site chrome for every storefront page — THIS file (header/footer/nav) plus the @theme
3
+ // token block in src/styles/global.css are what you brand. Keep:
4
+ // - the <slot name="seo-tags" /> in <head> (the product page's owner-editable SEO lands there)
5
+ // - the global.css import (Tailwind + the design tokens every shipped component reads)
6
+ // - one <CartButton> in the header and one <CartDrawer> per page (both client:only —
7
+ // they read browser cart state and must not server-render)
8
+ import CartButton from "../components/storefront/CartButton";
9
+ import CartDrawer from "../components/storefront/CartDrawer";
10
+ import "../styles/global.css";
11
+
12
+ interface Props {
13
+ title: string;
14
+ description?: string;
15
+ }
16
+ const { title, description } = Astro.props;
17
+ ---
18
+
19
+ <!doctype html>
20
+ <html lang="en">
21
+ <head>
22
+ <meta charset="UTF-8" />
23
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
24
+ <title>{title}</title>
25
+ {description && <meta name="description" content={description} />}
26
+ <slot name="seo-tags" />
27
+ </head>
28
+ <body>
29
+ <header class="sticky top-0 z-40 border-b border-border bg-background/80 backdrop-blur">
30
+ <div class="mx-auto flex h-16 max-w-6xl items-center justify-between px-6">
31
+ <a href="/" class="text-base font-bold tracking-tight text-foreground no-underline">Brand Name</a>
32
+ <nav class="flex items-center gap-6 text-sm">
33
+ <a href="/shop" class="text-foreground no-underline transition-colors hover:text-muted-foreground">Shop</a>
34
+ <CartButton client:only="react" />
35
+ </nav>
36
+ </div>
37
+ </header>
38
+ <main class="mx-auto max-w-6xl px-6 pb-24 pt-10">
39
+ <slot />
40
+ </main>
41
+ <footer class="border-t border-border px-6 py-10 text-center text-sm text-muted-foreground">
42
+ © Brand Name
43
+ </footer>
44
+ <CartDrawer client:only="react" />
45
+ </body>
46
+ </html>
@@ -0,0 +1,56 @@
1
+ ---
2
+ // Product detail page — wire as-is; theme via SiteLayout's tokens.
3
+ //
4
+ // This is a Wix ITEM PAGE: the wixMetadata export + <SEO.Tags> below are what let the site
5
+ // owner edit this page's title/description/OG in the dashboard, and register the route in
6
+ // the sitemap. Keep all three SEO pieces when editing this file.
7
+ import SiteLayout from "../../layouts/SiteLayout.astro";
8
+ import ProductDetailView from "../../components/storefront/ProductDetailView";
9
+ import { fetchProductBySlug } from "../../wix/storefront/catalog";
10
+ import { WIX_APPS } from "@wix/essentials";
11
+ import { SEO } from "@wix/seo/components";
12
+ import { loadSEOTagsServiceConfig } from "@wix/seo/services";
13
+ import { seoTags } from "@wix/seo";
14
+
15
+ export const wixMetadata = {
16
+ appDefId: WIX_APPS.checkoutAndOrders.id,
17
+ pageIdentifier: WIX_APPS.checkoutAndOrders.productPageMetadata.pageIdentifier,
18
+ identifiers: {
19
+ slug: WIX_APPS.checkoutAndOrders.productPageMetadata.identifiers.handle,
20
+ },
21
+ };
22
+
23
+ const slug = Astro.params.slug!;
24
+
25
+ // Behind Wix's proxy the request URL is the internal one — the real public page URL
26
+ // arrives on x-wix-forwarded-url. The SEO service needs the public URL.
27
+ const forwardedUrl = Astro.request.headers.get("x-wix-forwarded-url");
28
+ const pageUrl =
29
+ forwardedUrl && URL.canParse(forwardedUrl) && /^https?:$/.test(new URL(forwardedUrl).protocol)
30
+ ? forwardedUrl
31
+ : Astro.url.href;
32
+
33
+ let product = null;
34
+ let seoTagsServiceConfig = null;
35
+ try {
36
+ [product, seoTagsServiceConfig] = await Promise.all([
37
+ fetchProductBySlug(slug),
38
+ loadSEOTagsServiceConfig({
39
+ pageUrl,
40
+ itemType: seoTags.ItemType.STORES_PRODUCT,
41
+ itemData: { slug },
42
+ }),
43
+ ]);
44
+ } catch {
45
+ // Guarded: an unhandled SSR throw truncates the response mid-stream.
46
+ }
47
+
48
+ if (!product) {
49
+ return new Response(null, { status: 404 });
50
+ }
51
+ ---
52
+
53
+ <SiteLayout title={product.name}>
54
+ <SEO.Tags seoTagsServiceConfig={seoTagsServiceConfig} slot="seo-tags" />
55
+ <ProductDetailView client:load initial={product} />
56
+ </SiteLayout>
@@ -0,0 +1,23 @@
1
+ ---
2
+ // Shop listing — products and categories are fetched SERVER-SIDE (SEO) and handed to the
3
+ // island as serialized DTO props; category switches then filter live on the client.
4
+ // Wire as-is; theme via SiteLayout's tokens.
5
+ import SiteLayout from "../layouts/SiteLayout.astro";
6
+ import ShopView from "../components/storefront/ShopView";
7
+ import { fetchProducts, fetchCategories } from "../wix/storefront/catalog";
8
+ import type { Category, ProductSummary } from "../wix/storefront/types";
9
+
10
+ let products: ProductSummary[] = [];
11
+ let categories: Category[] = [];
12
+ try {
13
+ [products, categories] = await Promise.all([fetchProducts(), fetchCategories()]);
14
+ } catch {
15
+ // An unguarded SSR throw truncates the response mid-stream; the island renders the
16
+ // shipped empty state instead.
17
+ }
18
+ ---
19
+
20
+ <SiteLayout title="Shop">
21
+ <h1 class="mb-8 text-2xl font-semibold tracking-tight">Shop</h1>
22
+ <ShopView client:load initialProducts={products} initialCategories={categories} />
23
+ </SiteLayout>