@wix/agent-skills 1.16.3 → 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 (283) 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 +145 -127
  9. package/skills/wix-app/references/SITE_PLUGIN.md +14 -2
  10. package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +74 -68
  11. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +2 -2
  12. package/skills/wix-app/references/dashboard-page/COLLECTION_TOOLKIT.md +79 -0
  13. package/skills/wix-app/references/dashboard-page/ENTITY_PAGE_TOOLKIT.md +73 -0
  14. package/skills/wix-app/references/dashboard-page/PATTERNS_BUNDLE_READING.md +52 -0
  15. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +184 -0
  16. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +182 -99
  17. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +94 -49
  18. package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +16 -6
  19. package/skills/wix-app/references/editor-react-component/BROWSER-SUPPORT.md +56 -0
  20. package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +275 -0
  21. package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +35 -40
  22. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +167 -445
  23. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +56 -29
  24. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +53 -158
  25. package/skills/wix-app/references/editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md +78 -0
  26. package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +42 -134
  27. package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +11 -3
  28. package/skills/wix-app/references/editor-react-component/PARTS.md +46 -24
  29. package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +63 -179
  30. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +79 -163
  31. package/skills/wix-app/references/editor-react-component/SITE-CONTEXT-HOOKS.md +36 -21
  32. package/skills/wix-app/references/editor-react-component/SSR.md +30 -99
  33. package/skills/wix-base44-connector/SKILL.md +156 -50
  34. package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +78 -0
  35. package/skills/wix-base44-connector/scripts/utils.js +239 -45
  36. package/skills/wix-headless/entry/bootstrap.mjs +9 -2
  37. package/skills/wix-headless/entry/skill.md +1 -1
  38. package/skills/wix-headless/references/CAPABILITIES.md +9 -1
  39. package/skills/wix-headless/references/DESIGN.md +1 -0
  40. package/skills/wix-headless/references/DISCOVERY.md +2 -1
  41. package/skills/wix-headless/references/IMAGE_GENERATION.md +1 -0
  42. package/skills/wix-headless/references/SDK_HANDOFF.md +5 -2
  43. package/skills/wix-headless/references/SEED.md +2 -1
  44. package/skills/wix-headless/references/SETUP.md +1 -0
  45. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +2 -2
  46. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +68 -31
  47. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +26 -10
  48. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +8 -8
  49. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +1 -1
  50. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +1 -1
  51. package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +10 -8
  52. package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +254 -0
  53. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +27 -24
  54. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +13 -0
  55. package/skills/wix-headless/references/inline-recipes/setup-rentals.md +254 -0
  56. package/skills/wix-headless/references/managed/AUTHENTICATION.md +5 -0
  57. package/skills/wix-headless/references/non-astro.md +1 -1
  58. package/skills/wix-headless-fast/SKILL.md +166 -0
  59. package/skills/wix-headless-fast/entry/skill.md +99 -0
  60. package/skills/wix-headless-fast/install/deploy.mjs +433 -0
  61. package/skills/wix-headless-fast/install/fast-path.mjs +141 -0
  62. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +137 -0
  63. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +137 -0
  64. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +113 -0
  65. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +42 -0
  66. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +123 -0
  67. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +70 -0
  68. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +99 -0
  69. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +76 -0
  70. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +62 -0
  71. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +40 -0
  72. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +99 -0
  73. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +24 -0
  74. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +16156 -0
  75. package/skills/wix-headless-fast/references/blog/seed/SEED.md +72 -0
  76. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +287 -0
  77. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +129 -0
  78. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +143 -0
  79. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +119 -0
  80. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +138 -0
  81. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +54 -0
  82. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +206 -0
  83. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +96 -0
  84. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +70 -0
  85. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +40 -0
  86. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +76 -0
  87. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +22 -0
  88. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +11962 -0
  89. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +61 -0
  90. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +302 -0
  91. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +179 -0
  92. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +83 -0
  93. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +57 -0
  94. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +151 -0
  95. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +75 -0
  96. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +41 -0
  97. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +11262 -0
  98. package/skills/wix-headless-fast/references/cms/seed/SEED.md +103 -0
  99. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +324 -0
  100. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +149 -0
  101. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +66 -0
  102. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +176 -0
  103. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +118 -0
  104. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +117 -0
  105. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +59 -0
  106. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +136 -0
  107. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +128 -0
  108. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +61 -0
  109. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +40 -0
  110. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +12 -0
  111. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +80 -0
  112. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +21 -0
  113. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +11884 -0
  114. package/skills/wix-headless-fast/references/events/seed/SEED.md +86 -0
  115. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +276 -0
  116. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +150 -0
  117. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +317 -0
  118. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +269 -0
  119. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +231 -0
  120. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +135 -0
  121. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +10593 -0
  122. package/skills/wix-headless-fast/references/forms/seed/SEED.md +108 -0
  123. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +320 -0
  124. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +63 -0
  125. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +60 -0
  126. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +155 -0
  127. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +78 -0
  128. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +47 -0
  129. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +66 -0
  130. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +88 -0
  131. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +53 -0
  132. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +122 -0
  133. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +50 -0
  134. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +21 -0
  135. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +42 -0
  136. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +10 -0
  137. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +11 -0
  138. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +10329 -0
  139. package/skills/wix-headless-fast/references/members/seed/SEED.md +39 -0
  140. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +94 -0
  141. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +134 -0
  142. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
  143. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
  144. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +115 -0
  145. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +59 -0
  146. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +39 -0
  147. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +58 -0
  148. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +165 -0
  149. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +55 -0
  150. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
  151. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
  152. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +21 -0
  153. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +29 -0
  154. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +10197 -0
  155. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +78 -0
  156. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +258 -0
  157. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +133 -0
  158. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +58 -0
  159. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +126 -0
  160. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +37 -0
  161. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +39 -0
  162. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +75 -0
  163. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +45 -0
  164. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +30 -0
  165. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
  166. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +40 -0
  167. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +21 -0
  168. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +11226 -0
  169. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +71 -0
  170. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +279 -0
  171. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +165 -0
  172. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +142 -0
  173. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
  174. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
  175. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +155 -0
  176. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +55 -0
  177. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +43 -0
  178. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +177 -0
  179. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +165 -0
  180. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +103 -0
  181. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +254 -0
  182. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +146 -0
  183. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +168 -0
  184. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
  185. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +22 -0
  186. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +12 -0
  187. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +12560 -0
  188. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +81 -0
  189. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +479 -0
  190. package/skills/wix-headless-fast/references/shared/CONTENT.md +22 -0
  191. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +73 -0
  192. package/skills/wix-headless-fast/references/shared/DESIGN.md +26 -0
  193. package/skills/wix-headless-fast/references/shared/app/styles/global.css +52 -0
  194. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +15 -0
  195. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +27 -0
  196. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +24 -0
  197. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +76 -0
  198. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
  199. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +46 -0
  200. package/skills/wix-headless-fast/references/shared/seed/images.mjs +145 -0
  201. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +149 -0
  202. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +26 -0
  203. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +121 -0
  204. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductCard.tsx +100 -0
  205. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductDetailView.tsx +130 -0
  206. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductGrid.tsx +48 -0
  207. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ShopView.tsx +66 -0
  208. package/skills/wix-headless-fast/references/storefront/app/components/storefront/VariantPicker.tsx +103 -0
  209. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +48 -0
  210. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +140 -0
  211. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +80 -0
  212. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +101 -0
  213. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +221 -0
  214. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +215 -0
  215. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +109 -0
  216. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +46 -0
  217. package/skills/wix-headless-fast/references/storefront/app-astro/pages/products/[slug].astro +56 -0
  218. package/skills/wix-headless-fast/references/storefront/app-astro/pages/shop.astro +23 -0
  219. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +12247 -0
  220. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +85 -0
  221. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +415 -0
  222. package/skills/wix-manage/SKILL.md +28 -2
  223. package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +20 -13
  224. package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +24 -11
  225. package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +5 -5
  226. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +141 -0
  227. package/skills/wix-manage/references/google-business-profile/connect-google-business-profile.md +134 -0
  228. package/skills/wix-manage/references/google-business-profile/manage-google-business-profile-locations.md +182 -0
  229. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +3 -0
  230. package/skills/wix-manage/references/seo/manage-seo-tags.md +315 -0
  231. package/skills/wix-manage/references/seo/manage-url-redirects.md +250 -0
  232. package/skills/wix-manage/references/sites/query-sites.md +72 -161
  233. package/skills/wix-manage/references/stores/create-product-catalog-v3.md +21 -6
  234. package/skills/wix-manage/references/stores/update-product-with-options.md +83 -0
  235. package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +5 -6
  236. package/skills/wix-vibe-headless/SKILL.md +18 -4
  237. package/skills/wix-vibe-headless/install/deploy.cjs +12 -4
  238. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +2 -1
  239. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +16 -10
  240. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +13 -8
  241. package/skills/wix-vibe-headless/platforms/base44.md +27 -62
  242. package/skills/wix-vibe-headless/platforms/generic.md +6 -3
  243. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +45 -0
  244. package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +67 -0
  245. package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +128 -0
  246. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +5 -3
  247. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +9 -8
  248. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +250 -0
  249. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +12 -5
  250. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +41 -0
  251. package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.js +267 -0
  252. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +6 -3
  253. package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +470 -0
  254. package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +425 -0
  255. package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +187 -0
  256. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +238 -0
  257. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +108 -0
  258. package/skills/wix-vibe-headless/references/forms/seed/SEED.md +1762 -0
  259. package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +13 -0
  260. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +4 -1
  261. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +23 -11
  262. package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +1 -1
  263. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +29 -31
  264. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +152 -92
  265. package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +37 -38
  266. package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +2 -2
  267. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +15 -8
  268. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +37 -0
  269. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +35 -35
  270. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +18 -6
  271. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +30 -7
  272. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +46 -10
  273. package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +0 -172
  274. package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +0 -143
  275. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +0 -516
  276. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +0 -225
  277. package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +0 -6
  278. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +0 -95
  279. package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +0 -110
  280. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +0 -51
  281. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +0 -49
  282. package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +0 -92
  283. package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +0 -139
@@ -1,143 +0,0 @@
1
- # Editor React Component A11y Review
2
-
3
- Use this reference to audit and fix accessibility issues in an Editor React Component. This complements [`ACCESSIBILITY.md`](ACCESSIBILITY.md), which covers ARIA prop conventions and patterns, with an automated scan and triage workflow over the component's runtime, manifest extension, and shared code.
4
-
5
- This is not a separate skill. It runs as part of the Editor React Component workflow described in [`../EDITOR_REACT_COMPONENT.md`](../EDITOR_REACT_COMPONENT.md). Run it after editing the React/CSS sources and before `npx wix build && npx wix generate manifest`.
6
-
7
- ## Scanner Invocation
8
-
9
- Two scanners are bundled under `<SKILL_ROOT>/scripts`, where `<SKILL_ROOT>` is
10
- the absolute path to the directory containing the active skill's `SKILL.md`:
11
-
12
- ```bash
13
- node <SKILL_ROOT>/scripts/scan-a11y-eslint.cjs <file1> [file2] ...
14
- node <SKILL_ROOT>/scripts/scan-a11y-code.cjs <file1> [file2] ...
15
- ```
16
-
17
- Replace `<SKILL_ROOT>` with that absolute path, but run the commands from the
18
- consumer project root (the Wix CLI app's working directory) so dependencies
19
- resolve from the project's `package.json`. Pass target paths relative to that
20
- cwd. The dependency preflight is part of the workflow in
21
- [`../EDITOR_REACT_COMPONENT.md`](../EDITOR_REACT_COMPONENT.md).
22
-
23
- The ESLint scanner uses the explicitly declared `eslint-plugin-jsx-a11y` dev dependency. The semantic scanner follows imports up to four levels deep and adds resolution evidence and confidence to its findings.
24
-
25
- ## When To Run
26
-
27
- Run the review when:
28
-
29
- - You finished editing an Editor React Component's `.tsx` / `.module.css` files.
30
- - The user asks for an a11y audit, accessibility review, or a11y fix on an Editor React Component.
31
- - The user mentions missing alt text, invalid ARIA, broken semantics, direction issues, icon-only controls, or wrappers that hide accessibility issues.
32
-
33
- Do not run on generated files (`*.generated.ts`); they are regenerated from JSX and CSS Modules.
34
-
35
- ## Target Resolution
36
-
37
- Resolve scope before scanning:
38
-
39
- | User says | Required scope |
40
- |-----------|----------------|
41
- | Specific file | That file plus any imported wrappers / shared components it renders |
42
- | "this component" | `<componentName>.tsx`, `component.tsx`, `<componentName>.extension.ts`, plus shared imports |
43
- | A component name | All in-component files (excluding `*.generated.ts`) |
44
- | "full audit" | Every Editor React Component folder under `src/extensions/site/components/`, excluding `*.generated.ts` |
45
-
46
- ## Workflow
47
-
48
- Execute every phase inline while editing. Do not pause for approval or add a separate summary phase.
49
-
50
- ### Phase 1: Resolve Topology
51
-
52
- 1. Enumerate in-scope files under `src/extensions/site/components/<componentName>/`.
53
- 2. Include imported shared components or utilities that affect rendered semantics.
54
- 3. Exclude `*.generated.ts`.
55
- 4. Trace the topology from the component through wrappers and shared primitives to the rendered element.
56
-
57
- ### Phase 2a: ESLint JSX A11y Scan (Tier 0)
58
-
59
- ```bash
60
- node <SKILL_ROOT>/scripts/scan-a11y-eslint.cjs <file1> [file2] ...
61
- ```
62
-
63
- Use each finding's rule ID, message, and location as the rule-specific context. Validate the finding against the component implementation before editing.
64
-
65
- ### Phase 2b: Semantic Scan (Tier 1)
66
-
67
- ```bash
68
- node <SKILL_ROOT>/scripts/scan-a11y-code.cjs <file1> [file2] ...
69
- ```
70
-
71
- Use the emitted resolution path, evidence, and confidence to trace each finding. The scanner output is the source of rule-specific details; the reference only defines how to evaluate and act on those details.
72
-
73
- Neither scanner validates manifest contracts or all Editor React Component patterns. Complete Phase 3 even when both scanners return zero findings.
74
-
75
- ### Deduplication and Triage
76
-
77
- Evaluate every finding before fixing it.
78
-
79
- **Deduplicate.** When both scanners flag the same location for the same issue, keep the finding with richer evidence. Prefer the semantic scanner when it resolved the component topology; prefer ESLint when the issue is outside the semantic scanner's scope.
80
-
81
- | Verdict | Meaning | Action |
82
- |---------|---------|--------|
83
- | `confirmed` | The violation is real | Fix it |
84
- | `false-positive` | The rule fires but the rendered behavior is correct | Discard it |
85
- | `not-relevant` | The rule does not apply to this architecture | Discard it |
86
-
87
- Use this order to evaluate a finding:
88
-
89
- 1. Trace the component implementation and confirm that the flagged behavior reaches the rendered element.
90
- 2. Check delegated semantics. Editor React Components route ARIA through the typed `a11y` prop and `convertA11yKeysToHtmlFormat(a11y)` (see [`ACCESSIBILITY.md`](ACCESSIBILITY.md)). If the attributes reach the correct element through a runtime path the scanner cannot see, discard the finding as a false positive.
91
- 3. Check conditional interactivity. When `onClick` is spread conditionally with `role`, `tabIndex`, and `onKeyDown`, discard the finding as a false positive. If only `onClick` is conditional, confirm it.
92
- 4. Apply the semantic checks in [`A11Y-REVIEW-REFERENCE.md`](A11Y-REVIEW-REFERENCE.md#tier-2-manual-review-checklist).
93
- 5. When uncertain, continue tracing the implementation. Default to `confirmed` only after checking the available code and evidence.
94
-
95
- Only confirmed findings proceed to edits.
96
-
97
- ### Phase 3: Editor React Component Semantic Review
98
-
99
- Perform a manual semantic review even when scanners return zero findings.
100
-
101
- - All ARIA attributes come through the typed `a11y?: A11y` prop, never individual `ariaLabel?: string`, `role?: string`, and similar props. See [`ACCESSIBILITY.md`](ACCESSIBILITY.md).
102
- - `a11y` is forwarded to the root via `{...(a11y && convertA11yKeysToHtmlFormat(a11y))}`, or to an inner element via `elementProps.<name>.a11y` when requirements specify.
103
- - Icon-only interactive elements (icon/emoji/image/svg with no text node) have an accessible name from `constants.ts` or user-configurable `a11y`, never a hardcoded string literal.
104
- - Direction support is mandatory: props include `direction?: Direction`, the root applies `dir={direction}` and the unconditional `fallbackDirection` class, and CSS defines `.fallbackDirection:not([dir])`. See [`DIRECTIONALITY.md`](DIRECTIONALITY.md).
105
- - Every `ReactNode` content prop is rendered inside an element with `dir="ltr"` so user-provided nested content does not inherit the component direction.
106
- - `<componentName>.extension.ts` overrides do not strip a11y-relevant manifest fields generated from the JSX.
107
- - Decorative-only output is hidden with `aria-hidden` when appropriate.
108
- - Heading/tag selection, when configurable, reaches the rendered semantic element.
109
- - Interactive-looking elements expose the required keyboard behavior and roles.
110
-
111
- Use the full Tier 2 checklist in [`A11Y-REVIEW-REFERENCE.md`](A11Y-REVIEW-REFERENCE.md#tier-2-manual-review-checklist).
112
-
113
- ### Phase 4: Fix
114
-
115
- Apply fixes only to findings that survived triage:
116
-
117
- - `high`: fix immediately
118
- - `medium`: read the surrounding code, confirm, then fix
119
- - `low`: resolve the semantics from code and evidence; fix only when confirmed
120
-
121
- Confirmed safe/local fixes must be applied. Leave code unchanged only when the semantics remain ambiguous or the fix requires a risky, non-local behavior change. See [`A11Y-REVIEW-REFERENCE.md`](A11Y-REVIEW-REFERENCE.md#confidence-model).
122
-
123
- Fix principles:
124
-
125
- - Preserve intended visual and runtime behavior.
126
- - Fix the real semantic owner: component root, inner element via `elementProps`, or shared base.
127
- - Follow established Editor React Component patterns: route ARIA through `a11y`, use `constants.ts` for required labels, and never hardcode string literals.
128
- - Before adding `role`, `tabIndex`, or keyboard handlers to a non-interactive element, run the [pre-fix checks](A11Y-REVIEW-REFERENCE.md#pre-fix-checks-for-adding-button-semantics-to-a-non-interactive-element).
129
-
130
- ### Phase 5: Verify
131
-
132
- If any `.tsx` / `.jsx` file was edited:
133
-
134
- 1. Re-run both scanners on the modified files.
135
- 2. Run `npx wix build && npx wix generate manifest` so the manifest reflects any JSX changes.
136
- 3. Run the project's TypeScript check (`npx tsc --noEmit`), which is already part of the wix-app validation flow.
137
-
138
- Verification is mandatory after edits. Continue directly from fixes to verification, and do not consider the workflow complete while a required check remains unrun.
139
-
140
- ## References
141
-
142
- - [`A11Y-REVIEW-REFERENCE.md`](A11Y-REVIEW-REFERENCE.md) - triage, confidence, semantic resolution, Tier 2 checks, and pre-fix safeguards
143
- - [`ACCESSIBILITY.md`](ACCESSIBILITY.md) - ARIA conventions for Editor React Components
@@ -1,516 +0,0 @@
1
- # Component API
2
-
3
- Rules and patterns for props structure, elementProps, data types, file structure, containers, data-driven components, and array props.
4
-
5
- ---
6
-
7
- ## Should This Use elementProps or CSS?
8
-
9
- ```
10
- Is this element a named part (carries a global class string)?
11
- │
12
- ├─ YES
13
- │ └─ ✅ It gets an elementProps entry — spread it + merge its className.
14
- │ Add config fields inside the entry only as needed
15
- │ (data, direction, event handlers).
16
- │
17
- └─ NO → purely visual/decorative non-part
18
- (icons, separators, decorations, layout wrappers,
19
- elements only hidden/shown via CSS)
20
- └─ ❌ CSS class only — no elementProps entry
21
- ```
22
-
23
- ---
24
-
25
- ## Rules
26
-
27
- ### Component Props Structure
28
-
29
- ```typescript
30
- interface ComponentProps {
31
- // Identity
32
- id?: string;
33
- className?: string;
34
-
35
- // Mandatory features (from @wix/editor-react-types)
36
- direction?: Direction;
37
- a11y?: A11y; // ALL ARIA attributes come through this (ariaLabel, role, etc.)
38
-
39
- // Component-specific props (NO children unless container-type - see container rules below)
40
- label?: string;
41
- items?: Array<ItemType>;
42
- // ... from specification
43
- // NEVER add: ariaLabel, ariaDescribedBy, role, etc. - use a11y prop instead
44
-
45
- // Sub-component configuration (only if needed - see elementProps rules)
46
- elementProps?: {
47
- [partName]?: {
48
- [configProp]?: string | boolean | number; // Only include if element needs config beyond className
49
- direction?: Direction;
50
- };
51
- };
52
- }
53
- ```
54
-
55
- ### Propagate `elementProps` to inner elements
56
-
57
- `elementProps` is a map keyed by the manifest's inner-element keys; each entry
58
- carries that element's `className` (the editor sets it — this is how design
59
- states reach the element) plus any data.
60
-
61
- **Every named inner element — every element that carries a global class
62
- string — gets an `elementProps` entry, and you spread that entry onto the
63
- element.** This is mandatory, even when the element needs no other config:
64
- without it the editor cannot style that element or drive its states.
65
-
66
- How `className` gets merged depends on what the element is:
67
-
68
- - **Raw HTML element** (`<button>`, `<li>`, `<div>`): merge
69
- `elementProps?.<key>.className` inline, alongside the global string and module
70
- class — there's no component to do it.
71
- - **Sub-component built with this skill** (`<Inner/>`): the spread alone is
72
- enough. `className` rides along inside it, and the sub-component merges it onto
73
- its own root (every skill component merges its incoming `className`). Don't
74
- merge it again at the call site.
75
-
76
- ```tsx
77
- interface PlanCardProps {
78
- className?: string;
79
- elementProps?: {
80
- cta?: { className?: string; href?: string };
81
- };
82
- }
83
-
84
- // Raw HTML element — spread + merge className inline.
85
- // Note: the elementProps key is the short part name (`cta`), while the global
86
- // class is prefixed with the component name (`plan-card-cta`). Keep them as-is.
87
- <button {...elementProps?.cta} className={classNames('plan-card-cta', styles.cta, elementProps?.cta?.className)}>
88
- {label}
89
- </button>
90
-
91
- // Sub-component built with this skill — spread is enough (it merges className itself):
92
- <PlanRow {...elementProps?.planRow} />
93
- ```
94
-
95
- **Non-parts** (module-class-only elements: icons, decorations, separators,
96
- layout wrappers — no global class) get no entry. Style them with CSS.
97
-
98
- **Inside each entry**, add only the config the element needs (data, direction,
99
- event handlers). Never add a bare `className?` as the *only* field to decide
100
- whether an element qualifies — `className` always flows through; the entry
101
- exists because the element is a named part.
102
-
103
- ### What Qualifies as a Part
104
-
105
- See [`PARTS.md`](PARTS.md) for root election (Step 0), the mandatory filter, and full rules. The root gets no `elementProps` entry — its `className`, `a11y`, and `direction` arrive as top-level props.
106
-
107
- ### Derived values are not props
108
-
109
- If a displayed value can be computed with a simple pure function from
110
- other props and/or internal state, compute it internally — don't
111
- expose it as a prop. Expose only the source inputs (use numeric types
112
- when arithmetic is needed: `price: number`, not `price: string`).
113
-
114
- **Example:** subtotal = `price × quantity` → computed inside the component, not a prop.
115
-
116
- ### Data-Driven Components (NO children in exported props)
117
-
118
- - Component's **exported interface** must NOT accept `children` prop
119
- - ALL content MUST come through explicit named props (see "Derived values" above for what stays internal):
120
- - Text (labels, placeholders, messages) → `label`, `text`, `placeholder`, etc.
121
- - Media (images, videos, icons) → `imageSrc`, `videoUrl`, `iconName`, etc.
122
- - Links (URLs, hrefs) → `link`, `href`, `url`, etc.
123
- - Collections (list items, options, menu items) → `items`, `options`, `menuItems`, etc.
124
- - **Internal implementation** can use children for composition between sub-components
125
- - Hardcoded values are ONLY for fallback defaults when props are undefined
126
-
127
- **Exception — Container-type components:** Components whose purpose is to wrap arbitrary child elements (e.g., BoxContainer) MAY accept `children: React.ReactNode`. This applies only to structural containers — data-driven leaf components (Button, Tabs, Accordion, etc.) must NOT use `children`.
128
-
129
- ### Array Props: Data on Parent Only
130
-
131
- When the parent component defines an array prop (e.g., `items`), child/item components receive a single item directly. They do NOT redeclare the data structure in their own props.
132
-
133
- ### Active-item components (one body visible at a time)
134
-
135
- Apply when the UI shows **one array item body at a time** (tabs, slideshow,
136
- steps). Skip for always-visible lists, multi-select, or multi-expand accordion.
137
-
138
- - Each item needs **`name: string`** — Studio hat labels (not `label` or other keys).
139
- - Pair the array with **`ActiveItemIndex<'arrayPropName'>`** from
140
- `@wix/react-component-utils`; the type param must match the array prop name.
141
- Default the index to `0` in `defaultProps`.
142
- - Render **all** item bodies (`.map`); toggle visibility with `--active` +
143
- `display: none` on inactive panels (functional visibility — see
144
- [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md)), plus `aria-hidden` and `inert` on
145
- inactive bodies.
146
- - Keyboard navigation between triggers; ARIA roles per
147
- [`ACCESSIBILITY.md`](ACCESSIBILITY.md).
148
-
149
- ```typescript
150
- import type { ActiveItemIndex } from '@wix/react-component-utils';
151
-
152
- export type ItemType = { name: string; body: string };
153
-
154
- export type MyComponentProps = {
155
- items: Array<ItemType>;
156
- activeItem: ActiveItemIndex<'items'>;
157
- };
158
-
159
- export const defaultProps = {
160
- items: [{ name: 'Item 1', body: '…' }],
161
- activeItem: 0,
162
- } satisfies Omit<MyComponentProps, 'id' | 'className'>;
163
- ```
164
-
165
- ### Array Element Types: Always Objects with Named Keys
166
-
167
- Array elements MUST be objects with named keys. This enables stable item identity (each item can carry its own `id`/`key`), non-breaking extension (new fields can be added later without changing the prop signature), and semantic naming (each value has meaning instead of being an opaque scalar).
168
-
169
- **Allowed forms:**
170
-
171
- - Inline object literal: `Array<{ key: ValueType, ... }>`
172
- - Named interface where the interface itself is an object with named keys (e.g. `Array<AccordionItem>` is OK because `AccordionItem` is `{ name, content }`)
173
-
174
- **Never allowed as the array element:**
175
-
176
- - Primitives: `Array<string>`, `Array<number>`, `Array<boolean>`
177
- - Leaf data types from `@wix/editor-react-types`: `Array<Image>`, `Array<Link>`, `Array<Video>`, `Array<Audio>`, `Array<VectorArt>`, `Array<RichText>`. Wrap them in an object instead.
178
- - Nested arrays: `Array<Array<{cover: image, caption: string}>>` `Array<{items: Array<image>, caption: string}>`
179
-
180
- **❌ Wrong:**
181
-
182
- ```typescript
183
- tags: Array<string>;
184
- prices: Array<number>;
185
- flags: Array<boolean>;
186
- images: Array<Image>;
187
- links: Array<Link>;
188
- nestedArrays: Array<Array<any>>
189
- ```
190
-
191
- **✅ Correct:**
192
-
193
- ```typescript
194
- tags: Array<{ label: string }>;
195
- prices: Array<{ amount: number }>;
196
- flags: Array<{ enabled: boolean }>;
197
- gallery: Array<{ image: Image, caption?: string }>;
198
- links: Array<{ link: Link, label: string }>;
199
- items: Array<AccordionItem>; // AccordionItem is { name, content }
200
- ```
201
-
202
- ### Container Components (Blackbox Content)
203
-
204
- When a component specification indicates a "container" or "slot" area where users can add nested content, use `React.ReactNode` for that content prop.
205
-
206
- **When to use `React.ReactNode` for a content prop:**
207
-
208
- - The specification describes a "container" or "content area"
209
- - Users should be able to add arbitrary nested components
210
- - The component doesn't control what goes inside that area
211
-
212
- **RTL Support:** Elements that render `React.ReactNode` content MUST have `dir="ltr"` to prevent RTL inheritance from the parent component. See [`DIRECTIONALITY.md`](DIRECTIONALITY.md).
213
-
214
- ### Component Data Types
215
-
216
- When creating TypeScript interfaces for component props, use types from `@wix/editor-react-types` for more complex types, to see the allowed type from this library, look at the following file `node_modules/@wix/react-component-schema/dist/editor-react-types.d.ts`:
217
-
218
- ```typescript
219
- import type { Link } from "@wix/editor-react-types"; // Reference at node_modules/@wix/react-component-schema/dist/editor-react-types.d.ts
220
- ```
221
-
222
- For **function event handler props** (`onClick`, `onDblClick`, `onChange`, `onFocus`, `onBlur`, `onMouseIn`, `onMouseOut`) and custom callbacks, follow [`FUNCTION-HANDLERS.md`](FUNCTION-HANDLERS.md). Key rules:
223
-
224
- - Use the exact SDK prop names from that file — the manifest system recognizes them
225
- - Wire them to the correct DOM events (note: `onDblClick` → `onDoubleClick`, `onMouseIn` → `onMouseEnter`, `onMouseOut` → `onMouseLeave`)
226
- - Custom callbacks not tied to DOM events use `() => void` (no React event parameter)
227
-
228
- ### External resources are forbidden
229
-
230
- All resources rendered or fetched by the component (images, icons, fonts,
231
- videos, audio, JSON data, etc.) MUST come from Wix services. Never reference
232
- or call external (non-Wix) hosts — no `unsplash.com`, `placehold.co`,
233
- `picsum.photos`, third-party CDN icon sets, or any custom backend the user
234
- hasn't asked for. This rule covers both `src`/`href` attributes and any
235
- runtime fetching.
236
-
237
- Allowed image hosts: `static.wixstatic.com` (and other `*.wixstatic.com`
238
- subdomains). Allowed data: values supplied through props (populated by the
239
- editor) or imported local assets bundled with the component.
240
-
241
- ### Default values for `Image` props
242
-
243
- Image defaults belong in the `<componentName>.props.ts` file's exported
244
- `defaultProps` constant (consumed by `withDefaults(Component, defaultProps)` in
245
- `component.tsx`). Use a Wix-hosted image from the Free-from-Wix public
246
- media catalog and populate **only** `uri`, `url`, and `alt` — leave
247
- `width`, `height`, `focalPoint`, etc. unset so the editor fills them when
248
- the user picks a real image.
249
-
250
- By default, use the canonical fallback URL from the examples below for
251
- every `Image` default (`url` and `uri` derived from the same `fileName`).
252
- **Only when the user explicitly asks for different/better default images**,
253
- fetch candidates from the Wix Free-from-Wix catalog:
254
-
255
- ```
256
- GET https://publicmedia.wix.com/public/light_items?guid=bca5cb9f-45d2-4b11-8d6c-c9a7e7bd2873%3Aglobal%3Awix&pageSize=20&pageNumber=1&language=en&tags=free&mediaType=picture
257
- ```
258
-
259
- The endpoint is unauthenticated. Pick an item whose `displayTags` /
260
- `title` fit the component's purpose, then build the `Image` default from
261
- its `fileName`:
262
-
263
- - `url` → `` `https://static.wixstatic.com/media/${fileName}` ``
264
- - `uri` → `fileName`
265
- - `alt` → a short human description (use the item's `title` or
266
- `displayTags`)
267
-
268
- Do not call this endpoint when the user hasn't asked for it — the
269
- canonical fallback URL is fine for unattended scaffolds.
270
-
271
- **Default image pool — use a different image for each slot:**
272
-
273
- | # | fileName | Description |
274
- |---|----------|-------------|
275
- | 1 | `11062b_2f97b87dcea2446fa48e9ad9c5457ae1~mv2.jpg` | Tropical beach aerial |
276
- | 2 | `11062b_73f31c7e7d3544c69dc8ecd8d34c5717~mv2.jpg` | Dead Sea landscape |
277
- | 3 | `11062b_3682ebfcb08e4da5b3168b62819a1e68~mv2.jpg` | Palm tree sunset |
278
- | 4 | `11062b_45e67783d39c4963ab9e4fc418173233~mv2.jpg` | Abstract pink waves |
279
- | 5 | `11062b_4c11f014b0d04948b2e6f554076bc40a~mv2.jpg` | Coastal village aerial |
280
-
281
- When a component needs **more than one** image default, cycle through
282
- the pool above so every slot gets a visually distinct image. For a
283
- single image, use image #1.
284
-
285
- **Single `Image` prop:**
286
-
287
- ```typescript
288
- export const defaultProps = {
289
- image: {
290
- url: "https://static.wixstatic.com/media/11062b_2f97b87dcea2446fa48e9ad9c5457ae1~mv2.jpg",
291
- uri: "11062b_2f97b87dcea2446fa48e9ad9c5457ae1~mv2.jpg",
292
- alt: "Default image",
293
- },
294
- } as const satisfies Omit<ExampleComponentProps, "id" | "className">;
295
- ```
296
-
297
- **Array of objects with an `Image` field:**
298
-
299
- ```typescript
300
- export const defaultProps = {
301
- cards: [
302
- {
303
- title: "First card",
304
- image: {
305
- url: "https://static.wixstatic.com/media/11062b_2f97b87dcea2446fa48e9ad9c5457ae1~mv2.jpg",
306
- uri: "11062b_2f97b87dcea2446fa48e9ad9c5457ae1~mv2.jpg",
307
- alt: "First card image",
308
- },
309
- },
310
- {
311
- title: "Second card",
312
- image: {
313
- url: "https://static.wixstatic.com/media/11062b_73f31c7e7d3544c69dc8ecd8d34c5717~mv2.jpg",
314
- uri: "11062b_73f31c7e7d3544c69dc8ecd8d34c5717~mv2.jpg",
315
- alt: "Second card image",
316
- },
317
- },
318
- ],
319
- } as const satisfies Omit<ExampleComponentProps, "id" | "className">;
320
- ```
321
-
322
- **Inline fallback for HTML `src` / `href`:** when rendering a raw HTML
323
- attribute that takes a URL (`<img src>`, `<source src>`, `<video poster>`,
324
- `<a href>` for an image link, etc.) and the value could be empty, fall
325
- back to the same Wix-hosted URL — never to an external host or a relative
326
- path that doesn't exist:
327
-
328
- ```tsx
329
- <img
330
- src={
331
- image?.url ||
332
- "https://static.wixstatic.com/media/11062b_2f97b87dcea2446fa48e9ad9c5457ae1~mv2.jpg"
333
- }
334
- alt={image?.alt || "Default image"}
335
- />
336
- ```
337
-
338
- ### Component File Splitting
339
-
340
- Split logical UI pieces into separate named components. Never write inline JSX blocks for distinct complex UI pieces.
341
-
342
- **File structure for complex components (many subcomponents):**
343
-
344
- ```
345
- ComponentName/
346
- ├── components/ # Subcomponents folder
347
- │ ├── SubComponent1/
348
- │ │ ├── SubComponent1.tsx
349
- │ │ ├── SubComponent1.module.scss
350
- │ │ └── index.ts
351
- │ └── SubComponent2/
352
- │ ├── SubComponent2.tsx
353
- │ └── index.ts
354
- ├── hooks/ # Custom hooks folder
355
- │ ├── index.ts
356
- │ └── useCustomHook.ts
357
- ```
358
-
359
- **When to extract a sub-component:**
360
-
361
- - JSX block represents a logical complex unit (button, control, section, item)
362
- - Component has its own props interface
363
- - Logic is reusable or testable independently
364
- - Block has more than 15-20 lines of JSX
365
-
366
- ---
367
-
368
- ## Patterns
369
-
370
- ### Data-Driven Pattern
371
-
372
- **❌ Wrong:**
373
-
374
- ```typescript
375
- export interface ButtonProps {
376
- children: React.ReactNode; // ❌
377
- }
378
- <Button>Click Me</Button>
379
- ```
380
-
381
- **✅ Correct:**
382
-
383
- ```typescript
384
- export interface ButtonProps {
385
- label?: string;
386
- icon?: string;
387
- }
388
- <Button label={label} icon={icon} />
389
- ```
390
-
391
- Component controls rendering internally:
392
-
393
- ```typescript
394
- const List = ({ items }) => (
395
- <div>
396
- {items.map(item => (
397
- <ListItem key={item.id}>{item.label}</ListItem>
398
- ))}
399
- </div>
400
- );
401
- ```
402
-
403
- ### Array Props Pattern
404
-
405
- Parent defines array structure, child receives single item:
406
-
407
- ```typescript
408
- // Parent
409
- interface ParentProps {
410
- items: Array<AccordionItem>; // Array defined here
411
- }
412
-
413
- interface AccordionItem {
414
- name: string;
415
- content: React.ReactNode;
416
- }
417
-
418
- // Child receives single item
419
- interface ChildProps {
420
- item: AccordionItem & { id: string }; // Single item
421
- isOpen?: boolean;
422
- }
423
-
424
- // Parent maps
425
- items.map((item, index) => (
426
- <Child key={index} item={{ ...item, id: index.toString() }} />
427
- ))
428
- ```
429
-
430
- ### Container Components Pattern
431
-
432
- For "container" or "slot" areas, use `React.ReactNode`:
433
-
434
- ```typescript
435
- interface AccordionItem {
436
- name: string;
437
- content: React.ReactNode; // Users add any content here
438
- }
439
-
440
- // Render
441
- {items.map((item, index) => (
442
- <div key={index} dir="ltr">
443
- {typeof item.content === 'function' ? item.content({}) : item.content}
444
- </div>
445
- ))}
446
- ```
447
-
448
- ---
449
-
450
- ## Common Mistakes
451
-
452
- ### Using children prop in exported interface
453
-
454
- **❌ Wrong:**
455
-
456
- ```typescript
457
- export interface CardProps {
458
- children: React.ReactNode; // ❌ children + React.ReactNode both forbidden
459
- }
460
- <Card><CardHeader>Title</CardHeader></Card>
461
- ```
462
-
463
- **✅ Correct:**
464
-
465
- ```typescript
466
- export interface CardProps {
467
- title: string;
468
- content: React.ReactNode;
469
- }
470
- <Card title="Title" content={<div>Content</div>} />
471
- ```
472
-
473
- ### Adding elementProps for CSS-only elements
474
-
475
- **❌ Wrong:**
476
-
477
- ```typescript
478
- elementProps?: {
479
- icon?: { className?: string; } // ❌ Only className
480
- separator?: { className?: string; } // ❌ Only className
481
- }
482
- ```
483
-
484
- **✅ Correct:**
485
-
486
- ```typescript
487
- // No elementProps for purely visual elements (including conditionally displayed)
488
- // Style via CSS classes directly
489
- ```
490
-
491
- **Why:** Don't declare a `className?:` field — `className` already flows through each named inner element's `elementProps` entry (see "Propagate `elementProps` to inner elements"). Conditional display is controlled via CSS, not React props.
492
-
493
- ### Using T[] array syntax
494
-
495
- Use `Array<T>` over `T[]`.
496
-
497
- **❌ Wrong:**
498
-
499
- ```typescript
500
- interface ComponentProps {
501
- items: Item[]; // ❌ Wrong syntax
502
- tags: string[]; // ❌ Wrong syntax
503
- tags: Array<string>; // ❌ Element must be an object with named keys
504
- }
505
- ```
506
-
507
- **✅ Correct:**
508
-
509
- ```typescript
510
- interface ComponentProps {
511
- items: Array<Item>; // ✅ Correct syntax
512
- tags: Array<{ label: string }>; // ✅ Element is an object with named keys
513
- }
514
- ```
515
-
516
- See also: [Array Element Types: Always Objects with Named Keys](#array-element-types-always-objects-with-named-keys) — items must be objects with named keys.