@wix/agent-skills 1.17.0 → 1.18.1

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 (253) 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 +74 -83
  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 +47 -14
  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-forms.md +57 -10
  40. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +13 -0
  41. package/skills/wix-headless/references/inline-recipes/setup-rentals.md +254 -0
  42. package/skills/wix-headless/references/non-astro.md +1 -1
  43. package/skills/wix-headless-fast/SKILL.md +166 -0
  44. package/skills/wix-headless-fast/entry/skill.md +99 -0
  45. package/skills/wix-headless-fast/install/deploy.mjs +433 -0
  46. package/skills/wix-headless-fast/install/fast-path.mjs +141 -0
  47. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +137 -0
  48. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +137 -0
  49. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +113 -0
  50. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +42 -0
  51. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +123 -0
  52. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +70 -0
  53. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +99 -0
  54. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +76 -0
  55. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +62 -0
  56. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +40 -0
  57. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +99 -0
  58. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +24 -0
  59. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +16156 -0
  60. package/skills/wix-headless-fast/references/blog/seed/SEED.md +72 -0
  61. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +287 -0
  62. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +129 -0
  63. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +143 -0
  64. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +119 -0
  65. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +138 -0
  66. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +54 -0
  67. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +206 -0
  68. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +96 -0
  69. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +70 -0
  70. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +40 -0
  71. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +76 -0
  72. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +22 -0
  73. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +11962 -0
  74. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +61 -0
  75. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +302 -0
  76. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +179 -0
  77. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +83 -0
  78. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +57 -0
  79. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +151 -0
  80. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +75 -0
  81. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +41 -0
  82. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +11262 -0
  83. package/skills/wix-headless-fast/references/cms/seed/SEED.md +103 -0
  84. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +324 -0
  85. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +149 -0
  86. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +66 -0
  87. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +176 -0
  88. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +118 -0
  89. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +117 -0
  90. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +59 -0
  91. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +136 -0
  92. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +128 -0
  93. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +61 -0
  94. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +40 -0
  95. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +12 -0
  96. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +80 -0
  97. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +21 -0
  98. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +11884 -0
  99. package/skills/wix-headless-fast/references/events/seed/SEED.md +86 -0
  100. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +276 -0
  101. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +150 -0
  102. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +317 -0
  103. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +269 -0
  104. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +231 -0
  105. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +135 -0
  106. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +10593 -0
  107. package/skills/wix-headless-fast/references/forms/seed/SEED.md +108 -0
  108. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +320 -0
  109. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +63 -0
  110. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +60 -0
  111. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +155 -0
  112. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +78 -0
  113. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +47 -0
  114. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +66 -0
  115. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +88 -0
  116. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +53 -0
  117. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +122 -0
  118. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +50 -0
  119. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +21 -0
  120. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +42 -0
  121. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +10 -0
  122. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +11 -0
  123. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +10329 -0
  124. package/skills/wix-headless-fast/references/members/seed/SEED.md +39 -0
  125. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +94 -0
  126. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +134 -0
  127. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
  128. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
  129. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +115 -0
  130. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +59 -0
  131. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +39 -0
  132. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +58 -0
  133. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +165 -0
  134. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +55 -0
  135. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
  136. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
  137. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +21 -0
  138. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +29 -0
  139. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +10197 -0
  140. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +78 -0
  141. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +258 -0
  142. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +133 -0
  143. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +58 -0
  144. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +126 -0
  145. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +37 -0
  146. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +39 -0
  147. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +75 -0
  148. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +45 -0
  149. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +30 -0
  150. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
  151. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +40 -0
  152. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +21 -0
  153. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +11226 -0
  154. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +71 -0
  155. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +279 -0
  156. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +165 -0
  157. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +142 -0
  158. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
  159. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
  160. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +155 -0
  161. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +55 -0
  162. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +43 -0
  163. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +177 -0
  164. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +165 -0
  165. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +103 -0
  166. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +254 -0
  167. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +146 -0
  168. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +168 -0
  169. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
  170. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +22 -0
  171. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +12 -0
  172. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +12560 -0
  173. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +81 -0
  174. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +479 -0
  175. package/skills/wix-headless-fast/references/shared/CONTENT.md +22 -0
  176. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +73 -0
  177. package/skills/wix-headless-fast/references/shared/DESIGN.md +26 -0
  178. package/skills/wix-headless-fast/references/shared/app/styles/global.css +52 -0
  179. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +15 -0
  180. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +27 -0
  181. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +24 -0
  182. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +76 -0
  183. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
  184. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +46 -0
  185. package/skills/wix-headless-fast/references/shared/seed/images.mjs +145 -0
  186. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +149 -0
  187. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +26 -0
  188. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +121 -0
  189. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductCard.tsx +100 -0
  190. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductDetailView.tsx +130 -0
  191. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductGrid.tsx +48 -0
  192. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ShopView.tsx +66 -0
  193. package/skills/wix-headless-fast/references/storefront/app/components/storefront/VariantPicker.tsx +103 -0
  194. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +48 -0
  195. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +140 -0
  196. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +80 -0
  197. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +101 -0
  198. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +221 -0
  199. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +215 -0
  200. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +109 -0
  201. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +46 -0
  202. package/skills/wix-headless-fast/references/storefront/app-astro/pages/products/[slug].astro +56 -0
  203. package/skills/wix-headless-fast/references/storefront/app-astro/pages/shop.astro +23 -0
  204. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +12247 -0
  205. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +85 -0
  206. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +415 -0
  207. package/skills/wix-manage/SKILL.md +113 -89
  208. package/skills/wix-manage/references/dashboard-navigation/routes.json +12 -52
  209. package/skills/wix-manage/references/ecommerce/shipping/ecom-shipping-api.md +0 -2
  210. package/skills/wix-manage/references/forms/create-form.md +272 -184
  211. package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +13 -10
  212. package/skills/wix-manage/references/forms/update-form.md +122 -0
  213. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +141 -0
  214. package/skills/wix-manage/references/google-business-profile/connect-google-business-profile.md +134 -0
  215. package/skills/wix-manage/references/google-business-profile/manage-google-business-profile-locations.md +182 -0
  216. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +3 -0
  217. package/skills/wix-manage/references/media/generate-image-with-ai.md +86 -0
  218. package/skills/wix-manage/references/stores/create-product-catalog-v3.md +37 -7
  219. package/skills/wix-manage/references/stores/update-product-with-options.md +83 -0
  220. package/skills/wix-vibe-headless/SKILL.md +18 -4
  221. package/skills/wix-vibe-headless/install/deploy.cjs +12 -4
  222. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +2 -1
  223. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +3 -1
  224. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +3 -1
  225. package/skills/wix-vibe-headless/platforms/base44.md +27 -61
  226. package/skills/wix-vibe-headless/platforms/generic.md +6 -3
  227. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +43 -0
  228. package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +67 -0
  229. package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +128 -0
  230. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +5 -3
  231. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +250 -0
  232. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +12 -5
  233. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +41 -0
  234. package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.js +267 -0
  235. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +6 -3
  236. package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +486 -0
  237. package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +425 -0
  238. package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +187 -0
  239. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +238 -0
  240. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +108 -0
  241. package/skills/wix-vibe-headless/references/forms/seed/SEED.md +1836 -0
  242. package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +13 -0
  243. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +137 -84
  244. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +15 -8
  245. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +37 -0
  246. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +18 -6
  247. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +30 -7
  248. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +46 -10
  249. package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +0 -110
  250. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +0 -51
  251. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +0 -49
  252. package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +0 -92
  253. package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +0 -139
@@ -0,0 +1,486 @@
1
+ # Wix Forms — client utils (you build the UI)
2
+
3
+ **Intent:** contact / enquiry / lead / signup / waitlist / application / feedback / survey / quote
4
+ request / intake or registration — any form a visitor fills in and submits. Whether the submission
5
+ also becomes a CRM contact is a per-field mapping, not a different vertical.
6
+
7
+ This vertical ships **no UI**: the owner picks the fields in their dashboard, so every form has a
8
+ different field set and no "contact form" component could ship for it. You write one control per
9
+ field — the shipped utils supply the schema behind it, the state, the validation and the submit. Everything runs on the public `WIX_CLIENT_ID`
10
+ (anonymous visitor token) — no SDK, no backend, no elevated credential.
11
+
12
+ > **⚠️ A visitor-fillable form is FORMS, not CMS.** Wiring one to `insertDataItem` works, and is the
13
+ > wrong call: it gives up the dashboard form builder, spam protection, notifications and contact
14
+ > mapping, and needs the owner to set collection permissions before a visitor can submit at all.
15
+ > Use **`cms`** only when the app must **read the entries back** (a gallery, a listing, "my
16
+ > submissions") — a visitor cannot read Forms submissions. Submit-only → forms.
17
+
18
+ > **⚠️ "Add a field" is a SCHEMA change.** *"Add a dropdown for job industry"*, *"make the phone
19
+ > optional"*, *"drop the budget question"* — all reads like UI work and all are a `PATCH` to the live
20
+ > schema (`seed/SEED.md`, REVISE): patch it, verify, rewrite `wix-forms.config.js`, **then** wire the
21
+ > control. A field the visitor can fill that isn't in the schema is **silent data loss** — the value
22
+ > reaches no submission, inbox or contact, and the submit still resolves `true`.
23
+
24
+ ## What ships (utils only)
25
+
26
+ | file | what it is |
27
+ |---|---|
28
+ | `lib/wix-form-schema-utils.js` | **Reading the raw schema** — `orderedInputs`, `submitTextOf`, and per field `targetOf`, `labelOf`, `isRequired`, `validationOf`, `componentOf`, `optionsOf`, `inputTypeOf`, `componentTypeOf`, `choicesOf`, `addressPartsOf`, `phoneCountryOf`, `isMulti`/`isFile`/`isNumber`/`isAddress`. No React, no REST; the hook hands them back as `read`. |
29
+ | `rest/wix-forms.js` | Schema transport: `getForm`, `listForms`, plus `phoneExample` (what a visitor is shown), `normalizePhone` (what goes on the wire), `setSiteCountry`. |
30
+ | `rest/wix-forms-submissions.js` | Write transport: `toSubmissionValues`, `createSubmission`, `SUBMITTED_OK`, the file flow (`getMediaUploadUrl`, `uploadSubmissionFile`, `uploadFormFiles`), `submissionViolations`. |
31
+ | `hooks/useWixForm.js` | The form's non-visual half: `useWixForm(formId)` → `{ form, values, setValues, bind, submit, validate, errors, loading, read }`. Also exports `validateField`, `mapSubmissionErrors`, `FORM_ERROR`. Not on React? Those plus `lib/` are the load-bearing part; port the state around them. |
32
+ | `wix-config.js` *(shared)* | the two ids, written by the install step. |
33
+ | `wix-forms.config.js` *(generated)* | **the gate** — `WIX_FORMS`: each form's `formId` + read-back `targets`, written by the seed after verification. Its one later edit is a verified schema change (REVISE), never a hand-typed field. |
34
+ | `WixManageBanner` *(shared)* | Dev-only manage banner — mount it in your Layout. |
35
+
36
+ ## Prerequisites — a HARD GATE
37
+
38
+ - **`src/rest/wix-forms.config.js` must exist.** No file → the seed hasn't succeeded → **stop and
39
+ run the seed**. It's the one vertical whose client can't be built in parallel with its seed.
40
+ - **Never invent a `formId`, and never write that file early.** Its only value is as proof that a
41
+ verified schema exists; the seed writes it after creating *and* verifying each schema.
42
+ - **The Wix Forms app installed, with at least one form.** This vertical doesn't provision forms.
43
+ - **No permission setup** — unlike CMS, a visitor can read a published form's schema and submit to it
44
+ out of the box.
45
+
46
+ ## Build the UI
47
+
48
+ **The schema is the source of truth, whatever the markup looks like.** Every `target`, label,
49
+ `required` flag, constraint and choice option comes from it, and so does the submission map — nothing
50
+ about a field is yours to invent.
51
+
52
+ **The markup is yours to author.** Write a JSX element per field (step 5) when the layout matters,
53
+ which on a designed page it usually does. Loop over `read.orderedInputs(form)` with a branch per
54
+ control type instead when the owner will keep editing the form, and a dashboard change should reach
55
+ the site with no code touch. The per-field wiring is identical either way.
56
+
57
+ The JSDoc in `hooks/useWixForm.js` and `lib/wix-form-schema-utils.js` covers what each util does;
58
+ this covers which control a field wants and where the obvious implementation is wrong. Markup and
59
+ styling are yours (on base44: shadcn + `src/index.css`).
60
+
61
+ ### 1 · Load the form
62
+
63
+ ```jsx
64
+ import { useWixForm, FORM_ERROR } from "@/hooks/useWixForm";
65
+ import { WIX_FORMS } from "@/rest/wix-forms.config"; // written by the seed — never by hand
66
+
67
+ const { form, values, setValues, submit, validate, errors, loading, read } =
68
+ useWixForm(WIX_FORMS.contact.formId);
69
+
70
+ const fields = read.orderedInputs(form); // what the form contains, in the owner's layout order
71
+ ```
72
+
73
+ | | |
74
+ |---|---|
75
+ | `form` | the Form exactly as Wix returned it (`null` until loaded). Nothing stripped or renamed. |
76
+ | `values` | state, keyed by `target`: string for text/choice/date, **array** for multi-choice and files, **object** for an address. Seeded from the schema's defaults. |
77
+ | `setValues` | plain React setter — `setValues((v) => ({ ...v, [name]: value }))`. |
78
+ | `bind(target)` | the props a text-ish control needs, ready to spread: `name`, `value`, `onChange`, `onBlur`, `aria-describedby`, `aria-invalid`. |
79
+ | `submit(event)` | use as `onSubmit`; resolves **`true`** only when the submission was created. |
80
+ | `validate(target?)` | one field, one address subfield, or the whole form. Returns whether it passed. |
81
+ | `errors` | control name → visitor-facing message; `errors[FORM_ERROR]` is form-level. |
82
+ | `loading` | loading the schema (`form` still `null`) **or** submitting (`form` set). |
83
+ | `read` | the schema accessors, so the UI needs one import. |
84
+
85
+ Fields are the raw objects Wix sent, so anything the accessors don't cover is still on them —
86
+ `pii`, `showLabel`, `buttonText`, `explanationText`, `options[].image`, the `steps[]` a multi-page
87
+ form would need.
88
+
89
+ **`contact` is this example's key.** The seed names each form — `waitlist`, `quote`, `application` —
90
+ so use the keys `wix-forms.config.js` actually contains.
91
+
92
+ **Several forms on one page?** The hook loads one schema each. Past two, call
93
+ `listForms({ formIds: [...] })` once (up to 100 ids) and run `orderedInputs` over each result.
94
+
95
+ **Set the site's country once at app start**, so locale-derived examples match the business, not the
96
+ visitor's browser:
97
+
98
+ ```js
99
+ import { setSiteCountry } from "@/rest/wix-forms";
100
+ setSiteCountry("GB");
101
+ ```
102
+
103
+ ### 2 · Render one control per field
104
+
105
+ Author them or loop over them — every control carries the same four things, and `bind(target)` from
106
+ the hook supplies the first three:
107
+
108
+ 1. **`name` = the field's `target`** — the immutable storage key, and also the state key, the error
109
+ key and the submission key. Keying everything by it makes the submission right by construction;
110
+ it's how a blocked submit finds the control to focus, and it drives autofill.
111
+ 2. **`value` from `values[target]`, written back through `setValues`.** (A choice group carries
112
+ `checked` instead; a file input can't be controlled at all and takes only `onChange`.)
113
+ 3. **`onBlur` → `validate(target)`** — not on the first keystroke of an untouched field, which
114
+ reddens a required field before the visitor types. Once flagged, re-check as they type from an
115
+ **effect on the value**: React hasn't committed the new value when `onChange` runs, so a check
116
+ there judges the value they just replaced.
117
+ 4. **A real `<label>`, and an error node** — see step 6 for the wiring both need. `bind` sets the
118
+ error node's `aria-describedby`/`id` pair (`err-${target}`); you render the node itself.
119
+
120
+ **Stamp the schema's constraints as native attributes.** They reinforce the JS checks and drive
121
+ mobile keyboards:
122
+
123
+ | from the schema | onto the control |
124
+ |---|---|
125
+ | `isRequired(field)` | `required` |
126
+ | `validationOf(field).minLength` / `.maxLength` | `minLength` / `maxLength` |
127
+ | `validationOf(field).pattern` | `pattern` |
128
+ | `validationOf(field).minimum` / `.maximum` | `min` / `max` (number and rating) |
129
+ | `validationOf(field).format` | input `type` — `EMAIL`→`email`, `PHONE`→`tel`, `URL`→`url`, `DATE`→`date`, `TIME`→`time`, `DATE_TIME`→`datetime-local`, else `text`; `isNumber(field)`→`number` |
130
+ | the resolved `type` | `inputMode` — `number`→`decimal`, `tel`/`email`/`url` as themselves; omit for date/time (native picker) |
131
+ | `componentOf(field).placeholder` | `placeholder` |
132
+ | `validationOf(field).fileLimit` | `multiple`, when above 1 |
133
+ | `validationOf(field).uploadFileFormats` | `accept` — map the media kinds a browser knows (`IMAGE`→`image/*`, `VIDEO`, `AUDIO`, `DOCUMENT`); omit `accept` when the owner allows anything |
134
+ | `field.identifier` for `CONTACTS_*` kinds | `autoComplete` — `email`, `tel`, `given-name`, `family-name`, `organization`, `bday`; address subfields take `address-line1`, `address-level2`, `postal-code`, `country` |
135
+
136
+ **A constrained field with no placeholder gets a synthesized one:** PHONE →
137
+ `phoneExample(read.phoneCountryOf(field))` (that country's regulator-reserved fictional number,
138
+ falling back to the site's), URL → `https://…`. It prevents the `must match format "phone"` rejection
139
+ without a hint line under every field.
140
+
141
+ #### Which control
142
+
143
+ `identifier` and `componentType` are **independent axes** — several fields share one component — so
144
+ branch on whichever distinguishes the control, and **never on the `target` name**, which an owner's
145
+ rename silently breaks.
146
+
147
+ | control | branch on | `values[target]` |
148
+ |---|---|---|
149
+ | `<textarea>` | `field.identifier === "TEXT_AREA"` | string |
150
+ | `<select>` | `read.componentTypeOf(field) === "DROPDOWN"` | string |
151
+ | radios | `read.componentTypeOf(field) === "RADIO_GROUP"` | string |
152
+ | checkbox group | `read.isMulti(field)` | **array** of checked values |
153
+ | address group | `read.isAddress(field)` | **object** keyed by subfield |
154
+ | file / signature | `read.isFile(field)` | **`File` objects** until submit |
155
+ | text / email / tel / url / date / time / number | `validationOf(field).format`, `isNumber` | string |
156
+
157
+ Two that bite: `componentType` is `TEXT_INPUT` for short **and** long answer, so keying a textarea
158
+ off it renders every long field single-line; and `IMAGE_CHOICE` is indistinguishable from multi
159
+ choice except by `identifier` — it falls out as plain checkboxes, and its pictures are on
160
+ `componentOf(field).options[].image`.
161
+
162
+ **Coverage check — every field kind an owner can add:**
163
+
164
+ | dashboard field | `identifier` | renders as | `values[target]` |
165
+ |---|---|---|---|
166
+ | Short answer, Link, Company, Position, Tax ID, First/Last name, Email, single-line Address | `TEXT_INPUT`, `URL_INPUT`, `CONTACTS_*` | text input, `type` from `format` | string |
167
+ | Long answer | `TEXT_AREA` | `<textarea>` | string |
168
+ | Phone | `CONTACTS_PHONE` | `type="tel"` + reserved example | string (E.164 on submit) |
169
+ | Number, Rating | `NUMBER_INPUT`, `RATING_INPUT` | `type="number"` (or your stars) | string in state, number on the wire |
170
+ | Dropdown | `DROPDOWN` | `<select>` | string |
171
+ | Single choice | `RADIO_GROUP` | radios | string |
172
+ | Multi choice, Tag picker, Image choice | `CHECKBOX_GROUP`, `TAGS`, `IMAGE_CHOICE` | checkboxes (or a chip / image control) | **array** |
173
+ | Date, Date picker, Date and time, Time, Birthdate | `DATE_INPUT`, `DATE_PICKER`, `DATE_TIME_INPUT`, `TIME_INPUT`, `CONTACTS_BIRTHDATE` | native date/time input | string |
174
+ | Multi-line address | `MULTILINE_ADDRESS` | fieldset of subfields | **object** |
175
+ | File upload, Signature | `FILE_UPLOAD`, `SIGNATURE` | file input (a signature deserves a canvas) | **`File` objects** |
176
+ | Checkbox, Subscribe checkbox | `CHECKBOX`, `CONTACTS_SUBSCRIBE` | not covered here — `BOOLEAN`, and its label is Ricos rich content, not a string | boolean |
177
+ | Product, Fixed price, Custom price, Donation | `PRODUCT_LIST`, `FIXED_PAYMENT`, `PAYMENT_INPUT`, `DONATION` | not covered here — `PAYMENT` | array of product objects |
178
+ | Appointment | `APPOINTMENT` | not covered here — `SCHEDULING` | appointment object |
179
+ | Service picker, Multi-service picker | `SERVICES_DROPDOWN`, `SERVICES_MULTI_CHOICE` | `<select>` / checkboxes, options from the connected app | string / **array** |
180
+
181
+ `orderedInputs` returns the uncovered types too — nothing is filtered for you. Write the control, or
182
+ have the owner drop the field; a **required** field you don't render makes the form unsubmittable.
183
+
184
+ **Display fields never reach this loop.** `RICH_TEXT` blocks and the submit button are
185
+ `fieldType: "DISPLAY"`, so `orderedInputs` drops them. If a form uses rich-content blocks as section
186
+ copy between fields, read them off `form.formFields` yourself — their content is Ricos, not a string.
187
+
188
+ Wix's [About Form Fields](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/about-form-fields.md)
189
+ is the spec behind this table. `seed/SEED.md` carries the same identifiers from the authoring side
190
+ (which JSON creates each field); this one is the rendering side (which control, which value shape) —
191
+ they join on `identifier`.
192
+
193
+ #### Controls that need more than an input
194
+
195
+ **Choice groups** go in a `<fieldset>` with a `<legend>`; the group's `aria-describedby`,
196
+ `aria-invalid` and `aria-required` go on the fieldset, since no single radio can carry them. Options
197
+ come from `read.choicesOf(field)` (`{ value, label }`, label falling back to value). A checkbox
198
+ group's value is an array — toggle values in and out of it.
199
+
200
+ **A dropdown** needs a disabled `<option value="">` first (state starts empty, so otherwise the first
201
+ real option looks pre-selected); use `componentOf(field).placeholder` for its text.
202
+
203
+ **An address** is a group whose value is a nested object. Subfields come from
204
+ `read.addressPartsOf(field)` (`{ sub, required }`, hidden `addressLine2` already dropped); name each
205
+ control **`${target}/${sub}`**, which is exactly the server's error path for a nested field, so
206
+ rejections land on the right control with no mapping of your own. Subfield keys are storage keys —
207
+ humanize them (`postalCode` → "Postal code"). **`country` and `subdivision` are country-dependent
208
+ enums the schema doesn't enumerate**: render `country` as a select over ISO-3166 alpha-2 codes,
209
+ narrowed to `validationOf(field).allowedCountries` when set. Keeping `subdivision` free text means
210
+ leaving it optional and relying on the mapped error.
211
+
212
+ #### File uploads — the value is the upload URL
213
+
214
+ The hook's `submit` runs this before it sends anything:
215
+
216
+ 1. **`getMediaUploadUrl(formId, filename, mimeType)`** → a signed `uploadUrl`. This Forms-scoped
217
+ wrapper is what makes a visitor upload possible at all: `site-media` directly needs a Manage-Media
218
+ credential and 403s for a visitor.
219
+ 2. **`PUT` the bytes to it** with the file's `Content-Type`, via plain `fetch` — the URL is
220
+ pre-signed, and adding the visitor's `Authorization` header turns a working upload into a 400.
221
+ 3. **Submit that same `uploadUrl` as the value** — not the CDN URL the upload returns, not a file id.
222
+ One file submits the string; several submit an array.
223
+
224
+ So `values[target]` holds `File` objects until submit, and validation checks the count (`required`,
225
+ `fileLimit`) since no string rule applies. Three render consequences: the input can't be controlled
226
+ (wire `onChange`, list the picked filenames yourself); clearing it after success needs a `key` you
227
+ bump in `handleSubmit`, because resetting state leaves the browser's own "1 file selected" text; and uploads run inside
228
+ `loading`, so the button's progress state matters more here.
229
+
230
+ **A signature** shares `WIX_FILE`, so a file input accepts one — but the honest control is a canvas:
231
+ `canvas.toBlob(...)` → a `File` named `signature.png` in `values[target]`, same upload path.
232
+
233
+ **Never base64 a file into a value.** It stores no real file and blows past the submission size
234
+ limit. A form with no file field at all is a plan gate — file, signature and payment fields need a
235
+ Core-or-above plan — fixed by the owner's plan, never an inlined blob.
236
+
237
+ ### 3 · Validation — schema-driven on the client, authoritative on the server
238
+
239
+ `validate(target?)` applies only rules the schema states:
240
+
241
+ | rule | from |
242
+ |---|---|
243
+ | required | `isRequired(field)` — including a multi-choice or file field with nothing picked, and each required address subfield |
244
+ | length | `validationOf(field).minLength` / `.maxLength` |
245
+ | shape | `.pattern`, and `.format` — EMAIL, PHONE (E.164 after stripping spaces/dashes/parens), URL |
246
+ | range | `.minimum` / `.maximum` on number and rating, parsed before comparing |
247
+
248
+ Call it as `validate("email")` (the `onBlur` wiring), `validate("address/city")` for one subfield, or
249
+ `validate()` for everything — `submit` already does the last, so reach for it only to gate something
250
+ else. It reads `values`, and it clears what now passes as well as flagging what doesn't. An address
251
+ subfield gets the `required` check only; `country`/`subdivision` content is the server's call.
252
+
253
+ **Show invalid state on the control**, keyed off the same `aria-invalid` the render sets, so visual
254
+ and assistive-tech state can't drift — no parallel `.has-error` class:
255
+
256
+ ```css
257
+ input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"],
258
+ fieldset[aria-invalid="true"] { border-color: var(--destructive); outline-color: var(--destructive); }
259
+ .error:empty { display: none; }
260
+ ```
261
+
262
+ **Never key a check on a field's name** (the classic slip: keying the email check on
263
+ `target === "email"`) — derive it from `format` and the schema's constraints, as `validateField`
264
+ does. And a client rule **laxer** than the server's is worse than none: the visitor
265
+ then learns about the problem after a round trip, in Wix's wording instead of yours.
266
+
267
+ ### 4 · Submit
268
+
269
+ `submit(event)` client-validates → uploads picked files → builds the submission map (empty optionals
270
+ dropped, PHONE normalized to E.164, NUMBER coerced; it walks the *schema*, so a stray key in `values`
271
+ can't reach the API) → creates the submission → maps server violations onto controls and focuses the
272
+ first invalid one. On success it resets `values` to the schema's defaults.
273
+
274
+ **The resolved `true` is the only success signal there is.** Submissions are write-only from the
275
+ browser — reading them back needs an owner scope and 403s for a visitor. The submission lands in the
276
+ owner's dashboard.
277
+
278
+ `CONFIRMED`, `PENDING` and `PAYMENT_WAITING` all mean created. A `PAYMENT_WAITING` form leaves the
279
+ visitor a payment step: surface it **inside** the success state, never as a failed submit.
280
+
281
+ **No captcha** at the default protection level — don't add captcha plumbing speculatively.
282
+
283
+ ### 5 · The whole component
284
+
285
+ Author one JSX element per field, using the `target`s the seed wrote and the constraints the schema
286
+ states. `bind(target)` supplies the wiring every control shares — `name`, `value`, `onChange`,
287
+ `onBlur`, `aria-describedby`, `aria-invalid` — so a field is a label, a control and its error node:
288
+
289
+ ```jsx
290
+ export default function ContactForm() {
291
+ const { form, values, bind, setValues, submit, validate, errors, loading, read } =
292
+ useWixForm(WIX_FORMS.contact.formId);
293
+ const [sent, setSent] = useState(false);
294
+
295
+ async function handleSubmit(event) {
296
+ setSent(await submit(event)); // true only when the submission was created
297
+ }
298
+
299
+ if (loading && !form) return <p>Loading…</p>;
300
+ // A form that can't load is a setup problem — say so; never fall through to a hand-built form,
301
+ // which silently drops real enquiries.
302
+ if (!form) return <p role="alert">This form isn't available right now. {errors[FORM_ERROR]}</p>;
303
+ // Swapping the form out is a silent DOM change, so the success state announces itself.
304
+ if (sent) {
305
+ return (
306
+ <div role="status">
307
+ <h3 tabIndex={-1}>Thank you</h3>
308
+ <p>We'll be in touch shortly.</p>
309
+ <button type="button" onClick={() => setSent(false)}>Send another</button>
310
+ </div>
311
+ );
312
+ }
313
+
314
+ return (
315
+ <form onSubmit={handleSubmit} noValidate>
316
+ <label>
317
+ <span>Your email<span aria-hidden="true"> *</span></span>
318
+ <input {...bind("email_a1b2")} type="email" required autoComplete="email" />
319
+ <p className="error" id="err-email_a1b2" role="alert">{errors.email_a1b2}</p>
320
+ </label>
321
+
322
+ <label>
323
+ <span>How can we help?</span>
324
+ <textarea {...bind("message_c3d4")} rows={5} maxLength={500} />
325
+ <p className="error" id="err-message_c3d4" role="alert">{errors.message_c3d4}</p>
326
+ </label>
327
+
328
+ {/* A choice group carries `checked` rather than `value`, so wire it by hand — same name,
329
+ same onBlur, and the aria-* on the fieldset because no single radio can hold them. */}
330
+ <fieldset aria-describedby="err-budget_e5f6" aria-invalid={Boolean(errors.budget_e5f6) || undefined}>
331
+ <legend>Budget</legend>
332
+ {["Under £5k", "£5k–£20k", "Over £20k"].map((option) => (
333
+ <label key={option}>
334
+ <input type="radio" name="budget_e5f6" value={option}
335
+ checked={values.budget_e5f6 === option}
336
+ onChange={() => setValues((v) => ({ ...v, budget_e5f6: option }))}
337
+ onBlur={() => validate("budget_e5f6")} />
338
+ {option}
339
+ </label>
340
+ ))}
341
+ <p className="error" id="err-budget_e5f6" role="alert">{errors.budget_e5f6}</p>
342
+ </fieldset>
343
+
344
+ <p role="alert">{errors[FORM_ERROR]}</p>
345
+ <button type="submit" disabled={loading}>
346
+ {loading ? "Sending…" : (read.submitTextOf(form) || "Submit")}
347
+ </button>
348
+ </form>
349
+ );
350
+ }
351
+ ```
352
+
353
+ The `target`s (`email_a1b2`, …) come from `WIX_FORMS.<key>.targets` — **never invent or shorten one**,
354
+ since a key that isn't an exact schema `target` 400s the whole submission. Everything else on each
355
+ control comes from that field's schema entry (step 2): its label, its `required`, its length/pattern
356
+ bounds, its choice options. `noValidate` keeps your messages instead of the browser's bubbles; the
357
+ native constraints still drive keyboards and assistive tech.
358
+
359
+ **Authoring beats looping here**, because the layout is the point: a two-column name row, a budget
360
+ group styled as cards, copy between sections. **Loop instead when the owner will keep editing the
361
+ form** — `read.orderedInputs(form).map(...)` with a branch per control type keeps a dashboard change
362
+ reaching the site with no code touch. Either way the wiring per field is what's above.
363
+
364
+ Two things the shell doesn't show:
365
+
366
+ - **Server violations land on controls**, keyed exactly like the client's (`target`, or `target/sub`
367
+ for an address subfield). The copy comes from the violation's `errorType` plus the field's schema;
368
+ an unmapped type degrades to safe copy, and Wix's internal `errorMessage` goes to `console.debug`.
369
+ Only a failure with no per-field violations sets `errors[FORM_ERROR]`.
370
+ - **A required field you didn't render** blocks submit with a message that has no control to display
371
+ it. Check `read.orderedInputs(form)` against your branches before shipping.
372
+
373
+ ### 6 · Accessibility — the controls are generated, so one slip hits every field
374
+
375
+ - **The error node renders always**, empty or filled, with `role="alert"` and a deterministic id
376
+ (`err-${target}`) the control points at via `aria-describedby`. `aria-describedby` alone only reads
377
+ on focus; conditional rendering (`{error && …}`) destroys the live region entirely. Hide the empty
378
+ state with CSS.
379
+ - **`aria-invalid` only when invalid** — `undefined`, never `"false"`.
380
+ - **A group's error and `aria-*` go on the `<fieldset>`** — choice groups and addresses have no
381
+ single control to describe.
382
+ - **Required is programmatic**: the `required` attribute (or `aria-required` on a group) carries the
383
+ meaning, the `*` is `aria-hidden` decoration. Both, never the glyph alone.
384
+ - **Every control has a real `<label>`** — a placeholder disappears on input and fails contrast.
385
+ - **The success state is announced** (`role="status"`, or focus its heading).
386
+
387
+ Don't reach for `role="form"`, an `aria-label` on an input that already has a `<label>`, or a custom
388
+ `role="radio"` — native radios in a `<fieldset>` are already a radiogroup.
389
+
390
+ ## Hard rules
391
+
392
+ - A visitor-fillable form is this vertical, not `cms`.
393
+ - **Never hold a form field in local component state** — a value outside the hook's `values` submits
394
+ nothing. Adding a field is a schema change: `seed/SEED.md`, REVISE.
395
+ - **Never answer a field request with a dashboard link** — that link is for the owner's own edits.
396
+ - Read and write only through the shipped helpers — never hand-build a Wix Forms URL.
397
+ - Never invent a `target`, label, option or constraint — every one comes from the schema (authored
398
+ markup included). Never detect a control by its `target` name either.
399
+ - Read fields through the accessors, not by reaching into `inputOptions` — the block names are enum
400
+ derived, and the accessors map every one of them.
401
+ - Key every control by `target`: `values[target]`, `errors[target]`, `name`. Address subfields use
402
+ `target/sub`.
403
+ - Derive validation from the schema, and keep every client rule at least as strict as the server's.
404
+ - **Never add `auth.elevate`, a backend function or a connector token to make a form work.** The
405
+ visitor token reads the schema and creates the submission; the API spec's owner scopes are wrong
406
+ for the published-site path. This is the most common wrong turn on this vertical.
407
+ - Submissions are write-only from the browser — the resolved `createSubmission` **is** the success
408
+ signal. Listing entries back needs `cms`.
409
+ - Every status the submit resolves on is a created submission: show the thank-you, and put a payment
410
+ step inside it. Treating one as failure costs the owner duplicates.
411
+ - Order comes from `steps[]`, not `formFields[]`; take the order only, not the geometry.
412
+ - Render every field `orderedInputs` returns, or confirm what you skip isn't `required`.
413
+ - A file field submits the URL from `getMediaUploadUrl` — never base64, never a Manage-Media
414
+ credential, never the CDN URL the upload returns.
415
+ - `UNKNOWN_VALUE_ERROR` / `NOT_ALLOWED_VALUE_ERROR` are seed bugs — fix the schema, don't mangle the
416
+ key or value.
417
+ - Never mock a form. No `formId`, or a form that won't load, is a setup problem to surface.
418
+ - Never show a locale-wrong example, and never submit the reserved one you display.
419
+
420
+ ## Fallback
421
+
422
+ Three sources answer what this file doesn't: the **JSDoc** in `hooks/useWixForm.js` and
423
+ `lib/wix-form-schema-utils.js`; the **Wix reference** below; and `seed/SEED.md` for how a field was
424
+ authored, and REVISE for changing one. Calling an endpoint the helpers don't wrap is fine via
425
+ `wixApiRequest` — look up the exact method and body first (or the `wix-docs` skill), never guess.
426
+
427
+ - Form object (the shape `form` and its fields arrive in): https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/form-object.md
428
+ - Form Schemas API: https://dev.wix.com/docs/api-reference/crm/forms/form-schemas.md
429
+ - About Form Fields (every field-level rule): https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/about-form-fields.md
430
+ - Form Submissions API: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions.md
431
+ - About Submission Values (per-`inputType` value shapes): https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/about-submission-values.md
432
+ - Validation errors: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/introduction#validation-errors
433
+ - Get Media Upload URL: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/get-media-upload-url.md
434
+ - Uploading to a generated URL: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/upload-api.md
435
+
436
+ ## Not this vertical
437
+
438
+ An event **RSVP** → `events` (it ships its own registration form). A **bookable service's** form →
439
+ `bookings`. Content the app **lists back** — reviews, galleries, "my items" → `cms`. A form only
440
+ logged-in members may reach → `members` for the gate, forms for the form. `SKILL.md`'s routing table
441
+ is the deciding copy.
442
+
443
+ ## Seeding
444
+
445
+ Seed per `seed/SEED.md`: it installs the Forms app, creates each schema, verifies it (reads it back,
446
+ checks the dashboard summary, sends and deletes one real submission), then writes
447
+ `src/rest/wix-forms.config.js`. Needs an elevated credential, and **does not run in parallel with the
448
+ client** — see Prerequisites.
449
+
450
+ **Changing a form that already exists** — a new field, a relabel, a tightened rule — is that doc's
451
+ **REVISE** action: `PATCH` on the current `revision`, re-verify, rewrite the config, wire the
452
+ control. Never a second create.
453
+
454
+ ## Point the user to their dashboard
455
+
456
+ Substitute the site's `metaSiteId`:
457
+
458
+ - **Forms list** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-forms`
459
+ - **Form builder** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-forms/form/{formId}` → where
460
+ the **owner** edits fields; a relabel or new option reaches a looped form with no code change, a new
461
+ field still needs a control. **Asked to change the form yourself? REVISE, not this link.**
462
+ - **Submissions** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-forms/form/{formId}/submissions`
463
+ → per form, off its builder path; there's no site-wide submissions page to link
464
+ - **Contacts** — `https://manage.wix.com/dashboard/{metaSiteId}/contacts` → contact-mapped fields
465
+ create or update a contact automatically.
466
+
467
+ ## Verify
468
+
469
+ - [ ] `wix-forms.config.js` exists; every `formId` comes from `WIX_FORMS`, none typed by hand.
470
+ - [ ] Every control's `name` inside the `<form>` is a target in `WIX_FORMS.<key>.targets`, and its
471
+ value lives in the hook's `values` — **no field is backed by local state**.
472
+ - [ ] `WIX_CLIENT_ID` set (not the placeholder).
473
+ - [ ] Looped form: relabel a field in the dashboard, reload, the new label appears with no code
474
+ change. Authored form: every `target` in the JSX matches `WIX_FORMS.<key>.targets` exactly.
475
+ - [ ] Every field `read.orderedInputs(form)` returns has a control — long answer is a `<textarea>`,
476
+ choice groups render their options, an address renders its subfields — or what you skipped
477
+ isn't `required`.
478
+ - [ ] Required fields show inline errors on blur, in your wording, before any round trip.
479
+ - [ ] A deliberately invalid email/phone is rejected inline, on the right control.
480
+ - [ ] A real submission shows the thank-you, then appears in the owner's **submissions inbox** and
481
+ (for contact-mapped fields) as a **contact**.
482
+ - [ ] Has a file field? Attached a real file, submitted, and opened the attachment from the
483
+ dashboard — a submission recording an unusable attachment still "succeeds".
484
+ - [ ] Keyboard pass: a blocked submit focuses the first invalid control, errors are announced, every
485
+ control has a real label.
486
+ - [ ] No `auth.elevate`, backend function or connector token in the submit path.