@wix/agent-skills 1.15.1 → 1.16.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 (322) hide show
  1. package/README.md +3 -7
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +4 -1
  4. package/skills/wix-app/references/APP_TOOLS.md +134 -0
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +1 -1
  6. package/skills/wix-app/references/DASHBOARD_PAGE.md +0 -10
  7. package/skills/wix-app/references/DATA_COLLECTION.md +1 -1
  8. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -9
  9. package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
  10. package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
  11. package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +2 -2
  12. package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +172 -0
  13. package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +138 -0
  14. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +23 -2
  15. package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +29 -0
  16. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
  17. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +27 -2
  18. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +5 -3
  19. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +18 -1
  20. package/skills/wix-app/references/editor-react-component/PARTS.md +15 -2
  21. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -3
  22. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +13 -9
  23. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +4 -0
  24. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
  25. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +3 -1
  26. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +4 -0
  27. package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +54 -0
  28. package/skills/wix-app/references/stores/QUERY.md +32 -0
  29. package/skills/wix-docs/SKILL.md +35 -3
  30. package/skills/wix-headless/SKILL.md +3 -1
  31. package/skills/wix-headless/references/CONTENT.md +36 -0
  32. package/skills/wix-headless/references/DESIGN.md +54 -0
  33. package/skills/wix-headless/references/DISCOVERY.md +24 -0
  34. package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
  35. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
  36. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +32 -23
  37. package/skills/wix-headless/references/managed/CONNECT.md +1 -1
  38. package/skills/wix-headless/references/managed/CREATE.md +14 -0
  39. package/skills/wix-headless/references/managed/DEPLOYMENT.md +25 -0
  40. package/skills/wix-manage/SKILL.md +123 -7
  41. package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
  42. package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
  43. package/skills/wix-manage/references/blog/blog-dashboard-navigation.md +56 -0
  44. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +31 -6
  45. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -1
  46. package/skills/wix-manage/references/bookings/bookings-dashboard-navigation.md +63 -0
  47. package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +10 -1
  48. package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +44 -0
  49. package/skills/wix-manage/references/cms/cms-data-items-crud.md +31 -3
  50. package/skills/wix-manage/references/cms/cms-publishing-flow.md +287 -0
  51. package/skills/wix-manage/references/cms/cms-schema-management.md +27 -1
  52. package/skills/wix-manage/references/contacts/contacts-dashboard-navigation.md +46 -0
  53. package/skills/wix-manage/references/contacts/create-a-contact.md +82 -0
  54. package/skills/wix-manage/references/contacts/update-a-contact.md +119 -0
  55. package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +82 -0
  56. package/skills/wix-manage/references/dashboard-navigation/routes.json +1733 -0
  57. package/skills/wix-manage/references/domains/domains-dashboard-navigation.md +32 -0
  58. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +4 -4
  59. package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
  60. package/skills/wix-manage/references/ecommerce/gift-cards/ecom-gift-cards-goal-sell-gift-cards.md +338 -0
  61. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-discount-rule.md +42 -78
  62. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-bundle-and-save.md +1 -1
  63. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-stock-mover.md +1 -1
  64. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-upsell-boost.md +1 -1
  65. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +90 -92
  66. package/skills/wix-manage/references/events/create-wix-event.md +176 -0
  67. package/skills/wix-manage/references/events/manage-wix-events.md +174 -0
  68. package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +44 -0
  69. package/skills/wix-manage/references/get-paid/get-paid-dashboard-navigation.md +52 -0
  70. package/skills/wix-manage/references/google-ads/billing-and-payment.md +80 -0
  71. package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +212 -0
  72. package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +110 -0
  73. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +25 -0
  74. package/skills/wix-manage/references/google-ads/install-and-create-account.md +155 -0
  75. package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +63 -0
  76. package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +155 -0
  77. package/skills/wix-manage/references/marketing/marketing-dashboard-navigation.md +52 -0
  78. package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +99 -1
  79. package/skills/wix-manage/references/pricing-plans/pricing-plans-dashboard-navigation.md +45 -0
  80. package/skills/wix-manage/references/restaurants/restaurants-dashboard-navigation.md +68 -0
  81. package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +94 -125
  82. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +48 -9
  83. package/skills/wix-manage/references/site-properties/site-properties-dashboard-navigation.md +31 -0
  84. package/skills/wix-manage/references/sites/create-headless-site.md +52 -0
  85. package/skills/wix-manage/references/sites/create-site-from-template.md +2 -25
  86. package/skills/wix-manage/references/sites/site-import.md +163 -190
  87. package/skills/wix-manage/references/sites/sites-dashboard-navigation.md +29 -0
  88. package/skills/wix-manage/references/stores/add-store-pages-to-site.md +17 -1
  89. package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +26 -8
  90. package/skills/wix-manage/references/stores/stores-dashboard-navigation.md +65 -0
  91. package/skills/wix-manage/references/stores/update-product-with-options.md +39 -7
  92. package/skills/wix-replatform/.publish-manifest.json +8 -0
  93. package/skills/wix-replatform/SKILL.md +693 -0
  94. package/skills/wix-replatform/lib/artifact-freshness.js +215 -0
  95. package/skills/wix-replatform/lib/completion-report.js +200 -0
  96. package/skills/wix-replatform/lib/config-env.js +59 -0
  97. package/skills/wix-replatform/lib/execution-manifest.js +185 -0
  98. package/skills/wix-replatform/lib/execution-state.js +173 -0
  99. package/skills/wix-replatform/lib/import-recovery.js +313 -0
  100. package/skills/wix-replatform/lib/local-state.js +642 -0
  101. package/skills/wix-replatform/lib/orchestration-preflight.js +143 -0
  102. package/skills/wix-replatform/lib/orchestration-router.js +122 -0
  103. package/skills/wix-replatform/lib/orchestration-state.js +455 -0
  104. package/skills/wix-replatform/lib/progress-log.js +224 -0
  105. package/skills/wix-replatform/lib/progress-log.sh +140 -0
  106. package/skills/wix-replatform/lib/url-preservation-state.js +391 -0
  107. package/skills/wix-replatform/resources/rp-discovery/SKILL.md +184 -0
  108. package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +529 -0
  109. package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +316 -0
  110. package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +64 -0
  111. package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +1114 -0
  112. package/skills/wix-replatform/resources/rp-mapper/SKILL.md +430 -0
  113. package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +217 -0
  114. package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +148 -0
  115. package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +378 -0
  116. package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +183 -0
  117. package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +478 -0
  118. package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +136 -0
  119. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
  120. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +310 -0
  121. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +1081 -0
  122. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +618 -0
  123. package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +949 -0
  124. package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +196 -0
  125. package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +66 -0
  126. package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +60 -0
  127. package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +95 -0
  128. package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +82 -0
  129. package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +256 -0
  130. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +249 -0
  131. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +444 -0
  132. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +774 -0
  133. package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +71 -0
  134. package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +632 -0
  135. package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +330 -0
  136. package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +21 -0
  137. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -0
  138. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +37 -0
  139. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +37 -0
  140. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +39 -0
  141. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +35 -0
  142. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +14 -0
  143. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +35 -0
  144. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +36 -0
  145. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +35 -0
  146. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +14 -0
  147. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +131 -0
  148. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +37 -0
  149. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +37 -0
  150. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +21 -0
  151. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +37 -0
  152. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +37 -0
  153. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +97 -0
  154. package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +528 -0
  155. package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -0
  156. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +38 -0
  157. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +37 -0
  158. package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -0
  159. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +37 -0
  160. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +53 -0
  161. package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +84 -0
  162. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +25 -0
  163. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +37 -0
  164. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +37 -0
  165. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +38 -0
  166. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +37 -0
  167. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +90 -0
  168. package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +64 -0
  169. package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +141 -0
  170. package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +384 -0
  171. package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +260 -0
  172. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +238 -0
  173. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +237 -0
  174. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +238 -0
  175. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +2219 -0
  176. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +31 -0
  177. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +100 -0
  178. package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +107 -0
  179. package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +344 -0
  180. package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +250 -0
  181. package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1927 -0
  182. package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +83 -0
  183. package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +141 -0
  184. package/skills/wix-replatform/scripts/artifact-freshness.js +76 -0
  185. package/skills/wix-replatform/scripts/execution-manifest-validate.js +43 -0
  186. package/skills/wix-replatform/scripts/execution-state-prepare.js +128 -0
  187. package/skills/wix-replatform/scripts/orchestration-preflight.js +48 -0
  188. package/skills/wix-replatform/scripts/orchestration-route.js +46 -0
  189. package/skills/wix-replatform/scripts/orchestration-state.js +245 -0
  190. package/skills/wix-vibe-headless/SKILL.md +48 -25
  191. package/skills/wix-vibe-headless/install/deploy.cjs +95 -0
  192. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +34 -0
  193. package/skills/wix-vibe-headless/platforms/README.md +8 -4
  194. package/skills/wix-vibe-headless/platforms/base44.md +133 -98
  195. package/skills/wix-vibe-headless/platforms/generic.md +99 -64
  196. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +230 -119
  197. package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +43 -0
  198. package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +25 -0
  199. package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +15 -0
  200. package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +35 -0
  201. package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +38 -0
  202. package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +40 -0
  203. package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +54 -0
  204. package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +65 -0
  205. package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +50 -0
  206. package/skills/wix-vibe-headless/references/blog/seed/SEED.md +103 -0
  207. package/skills/wix-vibe-headless/references/blog/seed/seed-blog.js +270 -0
  208. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +260 -149
  209. package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +65 -0
  210. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +47 -0
  211. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +13 -0
  212. package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +126 -0
  213. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +108 -0
  214. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +58 -0
  215. package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +95 -0
  216. package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +94 -0
  217. package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +89 -0
  218. package/skills/wix-vibe-headless/references/bookings/{wix-bookings-checkout.js → app/rest/wix-bookings-checkout.js} +1 -1
  219. package/skills/wix-vibe-headless/references/bookings/{wix-bookings-services.js → app/rest/wix-bookings-services.js} +87 -11
  220. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +117 -0
  221. package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.js +333 -0
  222. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +169 -147
  223. package/skills/wix-vibe-headless/references/cms/app/collection.config.js +31 -0
  224. package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +18 -0
  225. package/skills/wix-vibe-headless/references/cms/{wix-cms.js → app/rest/wix-cms.js} +47 -2
  226. package/skills/wix-vibe-headless/references/cms/seed/SEED.md +145 -0
  227. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +228 -131
  228. package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +23 -0
  229. package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +43 -0
  230. package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +13 -0
  231. package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +29 -0
  232. package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +57 -0
  233. package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +78 -0
  234. package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +27 -0
  235. package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +54 -0
  236. package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +40 -0
  237. package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +81 -0
  238. package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +48 -0
  239. package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +36 -0
  240. package/skills/wix-vibe-headless/references/events/{wix-events-browse.js → app/rest/wix-events-browse.js} +1 -1
  241. package/skills/wix-vibe-headless/references/events/seed/SEED.md +107 -0
  242. package/skills/wix-vibe-headless/references/events/seed/seed-events.js +251 -0
  243. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +276 -188
  244. package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +101 -0
  245. package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +33 -0
  246. package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +21 -0
  247. package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +29 -0
  248. package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +54 -0
  249. package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +77 -0
  250. package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +36 -0
  251. package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +32 -0
  252. package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +35 -0
  253. package/skills/wix-vibe-headless/references/members/{wix-members-auth.js → app/rest/wix-members-auth.js} +6 -3
  254. package/skills/wix-vibe-headless/references/members/install/Register.jsx +22 -0
  255. package/skills/wix-vibe-headless/references/members/seed/SEED.md +22 -0
  256. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +233 -104
  257. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +31 -0
  258. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +15 -0
  259. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +39 -0
  260. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +15 -0
  261. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +29 -0
  262. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +35 -0
  263. package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +27 -0
  264. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +25 -0
  265. package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +39 -0
  266. package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +27 -0
  267. package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +60 -0
  268. package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +94 -0
  269. package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.js +236 -0
  270. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +240 -117
  271. package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +35 -0
  272. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +48 -0
  273. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +16 -0
  274. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +35 -0
  275. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +25 -0
  276. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +28 -0
  277. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +30 -0
  278. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +30 -0
  279. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +53 -0
  280. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +28 -0
  281. package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +86 -0
  282. package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.js +251 -0
  283. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +248 -124
  284. package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +81 -0
  285. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +71 -0
  286. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +43 -0
  287. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +21 -0
  288. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +60 -0
  289. package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +63 -0
  290. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +32 -0
  291. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +73 -0
  292. package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +28 -0
  293. package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +102 -0
  294. package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +180 -0
  295. package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.js +452 -0
  296. package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +56 -0
  297. package/skills/wix-vibe-headless/references/shared/{wix-client.js → app/rest/wix-client.js} +6 -8
  298. package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +6 -0
  299. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +263 -157
  300. package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +20 -0
  301. package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +150 -0
  302. package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +167 -0
  303. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +51 -0
  304. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +54 -0
  305. package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +119 -0
  306. package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +71 -0
  307. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +109 -0
  308. package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +98 -0
  309. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +27 -0
  310. package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +139 -0
  311. package/skills/wix-vibe-headless/references/storefront/app/pages/Shop.jsx +75 -0
  312. package/skills/wix-vibe-headless/references/storefront/{wix-store-cart.js → app/rest/wix-store-cart.js} +1 -1
  313. package/skills/wix-vibe-headless/references/storefront/{wix-store-catalog.js → app/rest/wix-store-catalog.js} +20 -1
  314. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +111 -0
  315. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +299 -0
  316. /package/skills/wix-vibe-headless/references/blog/{wix-blog.js → app/rest/wix-blog.js} +0 -0
  317. /package/skills/wix-vibe-headless/references/events/{wix-events-registration.js → app/rest/wix-events-registration.js} +0 -0
  318. /package/skills/wix-vibe-headless/references/portfolio/{wix-portfolio.js → app/rest/wix-portfolio.js} +0 -0
  319. /package/skills/wix-vibe-headless/references/pricing-plans/{wix-pricing-plans.js → app/rest/wix-pricing-plans.js} +0 -0
  320. /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-menu.js → app/rest/wix-restaurants-menu.js} +0 -0
  321. /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-ordering.js → app/rest/wix-restaurants-ordering.js} +0 -0
  322. /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-reservations.js → app/rest/wix-restaurants-reservations.js} +0 -0
@@ -1,211 +1,299 @@
1
+ # Wix Members — ready-made custom-login client
1
2
 
2
- # Wix Members — custom login (client-only REST)
3
+ The members client is **shipped as real files**, not snippets to regenerate. It's a complete
4
+ **custom login** — email+password sign-up/sign-in, "Continue with Google/Facebook" (and custom SSO),
5
+ a member session, an account area, and route gating — styled with your app's design tokens (base44's
6
+ `src/index.css` — the shadcn palette the design phase already set). Copy it into the app and wire the
7
+ routes — you generate almost none of the auth code (the OAuth state machine, PKCE, the hidden-iframe
8
+ token exchange, and the social `/callback` all ship and are correct).
3
9
 
4
- > **Source files (in this skill):** the shared transport `references/shared/wix-client.js` and this
5
- > vertical's `references/members/wix-members-auth.js`. Copy **both** into your app's `src/rest/` side by
6
- > side — the helper does `import { … } from "./wix-client.js"`, so they must land in the same folder.
10
+ **Custom login only.** The member types credentials in **your own form on your own page** (or clicks
11
+ your own social button) — they are **never redirected to a Wix-hosted login page**. Talks to Wix
12
+ directly over the public `WIX_CLIENT_ID`; login swaps the token set on the one shared client, so
13
+ **every later `wixApiRequest` runs as the member** (their cart, orders, plans, "my …" reads). Never
14
+ mock a logged-in member; never mint a second client after login.
7
15
 
8
- Adds real **member accounts** to a client-only headless front end: sign up, log in, log out, and
9
- member-gated surfaces — all from the browser over the public `WIX_CLIENT_ID`, no SDK, no backend.
16
+ ## Prerequisites
17
+ - The site's **Wix OAuth app** (headless) is the auth target — members **self-register**, so there is
18
+ **nothing to seed** (see **Seeding** below); the client renders the shipped logged-out state until a
19
+ member signs in.
20
+ - The **Members Area app** installed *only if* you need member **profile** data (name, photo, roles,
21
+ custom fields). Pure "logged-in vs. not" gating needs no app — see **Identity vs. profile** below.
22
+ - The public headless **`WIX_CLIENT_ID`** from your prompt (buyer-facing, safe to hardcode/commit).
23
+ - **OAuth-app allow-listing — the #1 gotcha, a manual owner-only step you can't do from client code.**
24
+ Two *different* fields gate the two mechanisms:
10
25
 
11
- **This is *custom* login: the front owns its login UI.** The member types credentials in **your own
12
- form on your own page** (or clicks your own social button) — they are **never redirected to a
13
- Wix-hosted login page**. This is the REST equivalent of the SDK `OAuthStrategy` recipe; the older
14
- "redirect the user to a Wix login page" flow is deliberately **not** used here.
26
+ | Mechanism | What must be allow-listed | OAuth-app field | On `localhost:4321`? |
27
+ | :-- | :-- | :-- | :-- |
28
+ | **credential** (your form) | your app **origin** (the hidden iframe `postMessage`s the code back) | `allowedRedirectDomains` | ✅ allowed by default |
29
+ | **social / SSO** | the **exact `/callback` URL** (full-page redirect target) | `allowedRedirectUris` | ❌ **must be added** |
15
30
 
16
- ## When to use
17
- - User wants members to **sign up / log in** on a page they built (email+password, "Continue with
18
- Google/Facebook", or custom SSO), with the login UI living in their own app.
19
- - User wants **member-gated** content, an **account / profile** page, or a "my orders / my bookings /
20
- my plans" view (those reads need a logged-in member).
21
- - **Pricing-plans is present.** Buying/reading a member's plans is members-only — pair this vertical
22
- with `pricing-plans` so the member can log in *before* the subscribe / "my subscription" surface.
31
+ `localhost:4321` is Wix's default-allowed dev **origin**, so **credential login works there with zero
32
+ setup**; social **still fails** until you add `http://localhost:4321/callback` to `allowedRedirectUris`.
33
+ Any non-default origin (deployed domain, other port) needs both the origin and `<origin>/callback`.
34
+ **Symptoms:** unregistered origin → credential login hangs then throws `MemberAuthError('timeout')`
35
+ (+ a console *"postMessage… target origin does not match"*); unregistered callback → the Wix
36
+ authorize page shows *"Invalid redirect URI"* before returning, so the client can't catch it.
23
37
 
24
- ## Two mechanisms — pick by the brief (a page may use both)
38
+ > **⚠️ AGENT: surface this proactively.** As soon as a run uses social/SSO (or deploys credential
39
+ > login to a non-`4321` origin), **tell the user the exact URIs to add and where** (deep link under
40
+ > **Point the user to their dashboard**), and note that **social login stays dead until they do it**.
25
41
 
26
- | | **(A) Direct-credential** | **(B) Social / SSO** |
27
- | :-- | :-- | :-- |
28
- | **Use when** | your own email+password form, or custom sign-up fields | "Sign in with Google / Facebook", or enterprise SSO |
29
- | **User leaves your page?** | **No** — silent iframe token exchange | **Yes** — full-page redirect to the provider, back to your `/callback` |
30
- | **Kick-off** | `register()` / `login()` | `startSocialLogin(idp, callbackUri)` |
31
- | **Finish** | automatic on `SUCCESS` | `completeSocialLogin()` on the `/callback` page |
32
- | **Custom sign-up fields?** | Yes (`register`'s `profile`) | No — the provider owns the identity |
33
- | **Needs an allow-listed origin/URI?** | **Yes** — your app **origin** (postMessage target) | **Yes** — your `/callback` **URL** |
42
+ ## STEP 1 — The client is already in `src/`
43
+ The install step (base44.md STEP 1) deployed the whole members UI client + REST scaffolds into
44
+ `src/` (imports use the `@/` alias → `src/`). Here's every file and what it is — **this is your map,
45
+ so you don't need to open them:**
34
46
 
35
- Both converge on the **same end state**: member tokens written onto the shared client, so **every
36
- later `wixApiRequest` runs as the member** (login just swaps the token set on the client you already
37
- have). Don't blend their exchange calls — the helper handles each internally.
47
+ | file | what it is |
48
+ |---|---|
49
+ | `context/MemberContext.jsx` | `useMember()` provider: current member, `loggedIn`, `refresh()`, `logout()` |
50
+ | `hooks/useLoginForm.js` | credential state machine (login/register/verify, error mapping) — logic only |
51
+ | `components/LoginForm.jsx` | email+password form UI (sign-in/sign-up tabs, verify-code + pending phases) |
52
+ | `components/SocialButtons.jsx` | "Continue with Google/Facebook" buttons (kick off the redirect) |
53
+ | `components/MemberMenu.jsx` | header account control — "Log in" vs. member name + log-out (like a cart button) |
54
+ | `components/RequireAuth.jsx` | route gate: renders children for a member, else redirects to `/login` |
55
+ | `components/WixManageBanner.jsx` | preview-only manage banner — drop it into your Layout (STEP 4) |
56
+ | `pages/Login.jsx`, `pages/Account.jsx` | the shipped login + account routes (`/login`, `/account`) |
57
+ | `pages/Callback.jsx` | social/SSO return route — mount at **exactly** `/callback` |
58
+ | `rest/wix-config.js` | **you set the ids here** (STEP 2) |
59
+ | `rest/wix-client.js` + `rest/wix-members-auth.js` | REST transport + the auth helper (copy verbatim) |
38
60
 
39
- ## Prerequisites
40
- 1. A Wix site with the **Members Area app installed** if you need member *profile* data (name, photo,
41
- roles) or custom field definitions. Pure "logged-in vs. not" gating needs no app — see the
42
- identity-vs-profile split below.
43
- 2. The site's public headless **`WIX_CLIENT_ID`** (from the handoff prompt), pasted into
44
- `src/rest/wix-client.js`. Public, buyer-facing credential — safe to hardcode/commit.
45
- 3. **OAuth-app allow-listing — the #1 gotcha. Two *different* fields gate the two mechanisms:**
46
-
47
- | Mechanism | What must be allow-listed | OAuth-app field | On `localhost:4321`? |
48
- | :-- | :-- | :-- | :-- |
49
- | **(A) direct-credential** | your app **origin** (the hidden iframe `postMessage`s the code back to it) | `allowedRedirectDomains` | ✅ allowed by default |
50
- | **(B) social / SSO** | the **exact `/callback` URL** (full-page redirect target) | `allowedRedirectUris` | ❌ **must be added** |
51
-
52
- - `localhost:4321` is Wix's default-allowed dev **origin**, so **credential login works there with zero
53
- setup**. But social **still fails on `localhost:4321`** until you add `http://localhost:4321/callback`
54
- to `allowedRedirectUris` — the default covers the origin, not the callback URI. (These are genuinely
55
- two separate fields; matching Oz's SDK `wix-headless` `managed/DEPLOYMENT.md`.)
56
- - **Any non-default origin** — your deployed domain, a different localhost port —
57
- must be registered too: the origin (for A) and the `<origin>/callback` (for B).
58
- - **Symptoms:** (A) unregistered origin → login hangs, then `MemberAuthError('timeout')` + a console
59
- *"Failed to execute 'postMessage'… target origin … does not match"*. (B) unregistered callback →
60
- the Wix authorize page shows *"Invalid redirect URI. Please add an allowed URI to your OAuth App"*
61
- **before** returning — so the client can't catch it; you must register it up front.
62
- - Google & Facebook are enabled by default; **custom SSO** also needs an IDP connection created in
63
- the Business Manager, whose **connection id** you pass as `idp` (see "Custom SSO" below).
64
-
65
- > **⚠️ AGENT: this is a manual, owner-only step you cannot do from client-only code — surface it
66
- > proactively.** As soon as a run uses social/SSO (or deploys credential login to a non-`4321`
67
- > origin), **tell the user** the exact URIs to add and where, and note that **social login stays
68
- > dead until they do it** (a client-only front has no account token to register it via the API).
69
- > See "Point the user to their dashboard" below for the deep link and the exact values.
70
-
71
- ## The API (copy as-is; do not re-derive it)
72
- Copy `wix-client.js` + `wix-members-auth.js` into `src/rest/` and set `WIX_CLIENT_ID`. Exports of
73
- `wix-members-auth.js`:
74
- - **Direct-credential:** `register(email, password, profile?)`, `login(email, password)`,
75
- `verifyEmail(code, stateToken)`, `sendPasswordResetEmail(email, redirectUri)`
76
- - **Social / SSO:** `startSocialLogin(idp, callbackUri, returnTo?)`, `completeSocialLogin()`, `IDP`
77
- - **Session:** `isLoggedIn()`, `getCurrentMember()`, `logout(returnTo?)`
78
- - **Errors:** `MemberAuthError` (`.code` + `.message`)
79
-
80
- The full state-machine, `profile`, and error semantics are documented as JSDoc at the top of
81
- `wix-members-auth.js`. **Read it before wiring the UI.**
82
-
83
- > **⚠️ Copy `wix-members-auth.js` verbatim — do NOT rewrite its internals.** Wire the UI to the
84
- > exported functions, but leave the helper's bodies alone. The OAuth request shapes are **exact and
85
- > unforgiving** — the `createRedirectSession` body in particular needs the `auth.authRequest` wrapper,
86
- > flat PKCE fields, and `responseType`/`scope`; "simplifying" it into a spread of the input object
87
- > returns **400 Bad Request** and login dies. Extend by *calling* the exports, not by editing them.
88
-
89
- ## How to wire it (UI is the project's choice — the skill ships the REST layer only)
90
-
91
- ### (A) Credential form + the state machine — handle every branch (not just SUCCESS)
92
- `register()` / `login()` / `verifyEmail()` resolve to `{ state, member?, stateToken? }`:
93
- - **`"SUCCESS"`** → logged in; `member` is populated (or `null` if the Members Area app isn't
94
- installed). Render the account UI / navigate.
95
- - **`"REQUIRE_EMAIL_VERIFICATION"`** → a 6-digit code was emailed. Collect it and call
96
- `verifyEmail(code, stateToken)`. (Fires when a new registrant's email already exists as a contact,
97
- or when email verification is enabled in Member Settings.)
98
- - **`"REQUIRE_OWNER_APPROVAL"`** → show a "pending approval" notice; not an error.
99
-
100
- Hard failures **throw** a `MemberAuthError` — catch it and show `err.message` (`.code` is stable:
101
- `invalidCredentials`, `emailAlreadyExists`, …). `emailAlreadyExists` on register → route to log in.
61
+ They're already in place — go **straight to theming + wiring**, nothing to verify first. **Don't
62
+ `read_file` the shipped page/component/hook source to inspect it** — the table says what each is and
63
+ every shape you need is in the snippets below. Read a shipped file's source **only** on a real
64
+ fallback — a runtime error, or a field the snippets don't cover (see "Fallback only" at the end).
65
+ (Files missing? the install's `deploy` result lists what it wrote; re-run install, or copy
66
+ `references/members/app/` → `src/`.)
67
+
68
+ > **⚠️ Copy `wix-members-auth.js` verbatim — do NOT rewrite its internals.** The OAuth wire shapes are
69
+ > exact and unforgiving: the `createRedirectSession` body needs the `auth.authRequest` wrapper, flat
70
+ > PKCE fields, and `responseType`/`scope` — "simplifying" it returns **400** and login dies. Extend by
71
+ > *calling* the exports, never by editing them. Its full JSDoc (state machine, `profile`, errors) is at
72
+ > the top of the file — read that, not the whole body, if you need the contract.
73
+
74
+ ## STEP 2 — Credentials
75
+ Write `src/rest/wix-config.js` with your `WIX_CLIENT_ID` and `WIX_METASITE_ID` from the prompt — the
76
+ one place both ids live.
77
+
78
+ ## STEP 3 — Theme (nothing to style on the shipped components)
79
+ The shipped components carry **no palette of their own** — they render from base44's design tokens
80
+ in `src/index.css` (`:root`/`.dark`: `--background`, `--foreground`, `--card`, `--primary`, `--muted`,
81
+ `--border`, `--radius`, `--font-*`) via shadcn Tailwind classes (`bg-card`, `text-foreground`,
82
+ `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg`, `font-display`). Those tokens
83
+ are **already set to the brand by the design phase**, so the shipped auth surfaces are themed with
84
+ zero work here. To adjust the palette, edit `index.css` (`:root` **and** `.dark`) — the base44 way;
85
+ **never add a parallel theme file (e.g. a `theme.css`) or restyle the shipped JSX.** Build the
86
+ Home/Header you add (STEP 4) from the **same** base44 tokens/classes so it matches automatically. A
87
+ dark brand is just base44's dark palette in `index.css` — no per-component work.
88
+
89
+ ## STEP 4 — Wire routes + provider (surgical `find_replace` on `src/App.jsx`, never a rewrite)
90
+ **No file reads needed to wire this.** Every shipped page and `WixManageBanner` is a default export that takes **no props** — wire them exactly as the snippet shows; nothing in those files needs looking up.
91
+ `App.jsx` carries required platform auth scaffolding (`AuthProvider`/`useAuth`, the **Base44 builder
92
+ account**) — edit it in, don't replace it. The Wix member session is separate and ships under its own
93
+ name, **`MemberProvider`/`useMember`**, so the two never collide (do NOT rename it to `useAuth`).
94
+ - Wrap the routed tree in `<MemberProvider>` (from `@/context/MemberContext`).
95
+ - Put your **header + footer in a `Layout`** that renders `<Outlet/>` between them, and nest every
96
+ route under one pathless `<Route element={<Layout/>}>`. Your brand chrome then wraps **every** page
97
+ — including the shipped `Login`/`Account`/`Callback` — so you **never edit the shipped pages to add
98
+ a header/footer** (they render inside `<Outlet/>` as-is).
99
+ - **Pin the top chrome as one fixed block.** Put `<WixManageBanner/>` (shipped, preview-only) **above**
100
+ your `<Header/>` inside a single `position:fixed` top region — the header itself is plain in-flow
101
+ markup, the region owns the fixing — so banner + header ride together (no scroll drift/gap). Pad
102
+ the content by the region's measured height so it clears the chrome and self-corrects when the
103
+ banner is dismissed.
104
+ - Routes under the Layout: `/login` → `Login`, `/callback` → `Callback` (both shipped, as-is), and
105
+ `/account` → `Account` **wrapped in `<RequireAuth>`** so a visitor is bounced to `/login`. **You add
106
+ `/` → your own Home** page. Gate your own member-only routes ("my orders", "my plans") the same way.
107
+
108
+ ```jsx
109
+ import { useRef, useState, useEffect } from "react";
110
+ import { Routes, Route, Outlet } from "react-router-dom";
111
+ import { MemberProvider } from "@/context/MemberContext";
112
+ import WixManageBanner from "@/components/WixManageBanner"; // shipped, preview-only · default export, no props
113
+ import RequireAuth from "@/components/RequireAuth"; // shipped route gate
114
+ import Login from "@/pages/Login"; // shipped · default export, no props
115
+ import Account from "@/pages/Account"; // shipped · default export, no props
116
+ import Callback from "@/pages/Callback"; // shipped · default export, no props
117
+ import Home from "@/pages/Home"; // YOU build
118
+ import Header from "@/components/Header"; // YOU build — plain in-flow markup, NOT position:fixed
119
+ import Footer from "@/components/Footer"; // YOU build
120
+
121
+ function Layout() {
122
+ const topRef = useRef(null);
123
+ const [offset, setOffset] = useState(0);
124
+ useEffect(() => { // measure the fixed region → pad content below it
125
+ const ro = new ResizeObserver(() => setOffset(topRef.current?.offsetHeight ?? 0));
126
+ if (topRef.current) ro.observe(topRef.current);
127
+ return () => ro.disconnect();
128
+ }, []);
129
+ return (<>
130
+ <div ref={topRef} style={{ position: "fixed", top: 0, left: 0, right: 0, zIndex: 50 }}>
131
+ <WixManageBanner /> {/* null on the published site / when dismissed */}
132
+ <Header /> {/* your brand header, in-flow inside this fixed block */}
133
+ </div>
134
+ <div style={{ paddingTop: offset }}> {/* clears the chrome; shrinks when the banner is dismissed */}
135
+ <Outlet /> {/* shipped Login/Account/Callback render here, untouched */}
136
+ <Footer />
137
+ </div>
138
+ </>);
139
+ }
140
+
141
+ <MemberProvider>
142
+ <Routes>
143
+ <Route element={<Layout />}> {/* chrome wraps all */}
144
+ <Route path="/" element={<Home />} /> {/* yours */}
145
+ <Route path="/login" element={<Login />} /> {/* shipped, as-is */}
146
+ <Route path="/callback" element={<Callback />} /> {/* shipped — must be /callback */}
147
+ <Route path="/account" element={<RequireAuth><Account /></RequireAuth>} /> {/* gated, shipped */}
148
+ </Route>
149
+ </Routes>
150
+ </MemberProvider>
151
+ ```
152
+
153
+ ## What you build (not shipped)
154
+ The **home / landing page**, the **`Header`** (mount `<MemberMenu/>` in it) and a **`Footer`** — the
155
+ two you drop into the `Layout` (STEP 4) so they wrap every route — plus the overall brand story,
156
+ styled from the same base44 tokens/classes. The nav's account control is a `<MemberMenu/>` (shows
157
+ "Log in" for a visitor, the member's name + log-out once signed in — render it as-is, don't wrap it in
158
+ your own auth text button):
159
+
160
+ ```jsx
161
+ import { useState, useEffect } from "react";
162
+ import { Link } from "react-router-dom";
163
+ import MemberMenu from "@/components/MemberMenu";
164
+
165
+ // Responsive header: choose ONE branch with a state flag, so <MemberMenu/> mounts once.
166
+ // Do NOT render a desktop nav AND a mobile nav toggled by `hidden md:flex` / `md:hidden`:
167
+ // these navs are inline-styled, and an inline `display` beats a Tailwind class, so `hidden`
168
+ // never applies — BOTH branches render and you get two menus. One branch = one menu.
169
+ export function Header() {
170
+ const [mobile, setMobile] = useState(() => window.innerWidth < 768);
171
+ useEffect(() => {
172
+ const onResize = () => setMobile(window.innerWidth < 768);
173
+ window.addEventListener("resize", onResize); // keep it reactive to viewport changes
174
+ return () => window.removeEventListener("resize", onResize);
175
+ }, []);
176
+ return (
177
+ <nav style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
178
+ {/* brand/logo */}
179
+ {mobile
180
+ ? <YourMenu /> // your hamburger + <MemberMenu/> here
181
+ : <div style={{ display: "flex", gap: 24 }}><Link to="/">Home</Link><MemberMenu /></div>}
182
+ </nav>
183
+ );
184
+ }
185
+ ```
186
+ Everything visual reads base44's design tokens (`index.css`), so your home/nav match the shipped pages automatically.
187
+
188
+ **Editing a component and the change doesn't show? It's the preview, not your code.** The dev preview
189
+ can serve a stale module after a write. Before diagnosing a visual bug you just "fixed", do a fresh
190
+ full navigate/reload of the preview and re-check — don't keep rewriting correct code against a stale
191
+ render.
192
+
193
+ ## Using the client from your own UI (session, gating, "my …" reads)
194
+
195
+ ```jsx
196
+ import { useMember } from "@/context/MemberContext";
197
+
198
+ // useMember() gives:
199
+ // { member, loggedIn, loading, refresh(), logout(returnTo?) }
200
+ // - member is null for a visitor OR when the Members Area app isn't installed (loggedIn still true).
201
+ // - login/register happen in the shipped LoginForm; call refresh() after your own login call.
202
+
203
+ function Greeting() {
204
+ const { loggedIn, member, loading } = useMember();
205
+ if (loading) return null;
206
+ return loggedIn ? <span>Hi, {member?.profile?.nickname || "member"}</span> : <a href="/login">Log in</a>;
207
+ }
208
+
209
+ // A member-only read runs as the member on the SAME shared client — no extra auth, no `elevate`:
210
+ import { wixApiRequest } from "@/rest/wix-client";
211
+ const { orders } = await wixApiRequest("/ecom/v1/orders/query", { body: { query: {} } }); // member's own
212
+ ```
213
+
214
+ **"My items" in a CMS collection** (member-owned rows) → the **OWNED RECORDS** recipe in
215
+ `references/cms/INSTRUCTIONS.md`. Two facts from this vertical carry over: the member id lives at
216
+ **`member.id`**, and `member` is `null` for a logged-in member whenever the Members Area app is absent
217
+ (see *Identity vs. profile* below). Because of that second one, prefer a collection seeded
218
+ `read: SITE_MEMBER_AUTHOR` — the server scopes reads by the caller's own token, so it works in both states.
219
+
220
+ ## Extending the client — the auth helper's exports (copy as-is, do NOT re-derive)
221
+ Building auth UI beyond the shipped pages? Call these exports (from `@/rest/wix-members-auth`) — the
222
+ same ones the shipped hook/pages use:
102
223
 
103
224
  ```js
104
- import { login, register, verifyEmail, isLoggedIn, getCurrentMember, logout, MemberAuthError } from "./rest/wix-members-auth.js";
225
+ // (A) Credential — handle EVERY branch, not just SUCCESS. register/login/verifyEmail → { state, ... }:
226
+ import { login, register, verifyEmail, MemberAuthError } from "@/rest/wix-members-auth";
105
227
  try {
106
228
  const res = await login(email, password);
107
- if (res.state === "SUCCESS") showAccount(res.member);
108
- else if (res.state === "REQUIRE_EMAIL_VERIFICATION") promptForCode(res.stateToken);
109
- else if (res.state === "REQUIRE_OWNER_APPROVAL") showPending();
229
+ if (res.state === "SUCCESS") { /* logged in; res.member (or null w/o Members Area app) */ }
230
+ else if (res.state === "REQUIRE_EMAIL_VERIFICATION") { /* 6-digit code emailed; verifyEmail(code, res.stateToken) */ }
231
+ else if (res.state === "REQUIRE_OWNER_APPROVAL") { /* show a pending notice — not an error */ }
110
232
  } catch (e) {
111
- if (e instanceof MemberAuthError) showError(e.message); else throw e;
233
+ if (e instanceof MemberAuthError) show(e.message); else throw e; // .code: invalidCredentials, emailAlreadyExists, …
112
234
  }
113
- ```
114
-
115
- Custom sign-up fields go in `register`'s `profile` (`{ firstName, lastName, nickname, addresses, … }`).
116
- Standard fields work as-is; arbitrary `customFields` keys must first be defined in the Members Area
117
- app or they're silently dropped.
235
+ // Custom sign-up fields → register's 3rd arg `profile` ({ firstName, lastName, nickname, addresses, … }).
236
+ // Arbitrary customFields keys must be defined in the Members Area app first, or they're silently dropped.
118
237
 
119
- ### (B) Social / SSO — your button + a `/callback` route
120
- ```js
121
- // on your login page:
122
- import { startSocialLogin, IDP } from "./rest/wix-members-auth.js";
123
- const callbackUri = new URL("/callback", window.location.origin).href; // must be allow-listed
124
- onGoogleClick = () => startSocialLogin(IDP.GOOGLE, callbackUri, window.location.pathname);
125
- onFacebookClick = () => startSocialLogin(IDP.FACEBOOK, callbackUri, window.location.pathname);
126
-
127
- // on the /callback page (a route/page at exactly that path):
128
- import { completeSocialLogin } from "./rest/wix-members-auth.js";
129
- const { member, returnTo } = await completeSocialLogin();
130
- window.location.replace(returnTo || "/");
238
+ // (B) Social / SSO — button + the shipped /callback page:
239
+ import { startSocialLogin, IDP } from "@/rest/wix-members-auth";
240
+ const callbackUri = new URL("/callback", window.location.origin).href; // must be allow-listed
241
+ startSocialLogin(IDP.GOOGLE, callbackUri, window.location.pathname); // custom SSO: pass a connectionId as idp
131
242
  ```
132
- **Custom SSO:** identical call — pass your connection id as `idp` instead of `IDP.GOOGLE`:
133
- `startSocialLogin("<connectionId>", callbackUri)`. The connection id comes from an IDP connection you
134
- create in the Business Manager (dashboard link below).
135
-
136
- ### Session, account area, logout
137
- - **Gate UI** on `isLoggedIn()`. Read the member with `await getCurrentMember()` (name / photo / roles
138
- / custom fields) — returns `null` for a visitor or when the Members Area app isn't installed.
139
- - **Logout:** `await logout()` — clears local tokens and redirects through the Wix logout URL; the
140
- client is a clean anonymous visitor afterward.
141
- - **Persistence is automatic.** Member tokens live in the same `localStorage` the visitor token used,
142
- so a reload stays logged in and tokens auto-refresh via `wix-client.js` — do **not** add your own.
243
+
244
+ Every export in `wix-members-auth.js` links its own reference page inline. The two areas they sit in
245
+ map onto the identity / profile split below — auth is the headless OAuth app, the profile is the
246
+ Members Area app:
247
+ - Headless authentication (login, register, verify, tokens): https://dev.wix.com/docs/api-reference/business-management/headless/authentication.md
248
+ - Headless redirects (social/SSO + logout): https://dev.wix.com/docs/api-reference/business-management/headless/redirects.md
249
+ - Members (the member profile, needs the Members Area app): https://dev.wix.com/docs/api-reference/crm/members-contacts/members.md
143
250
 
144
251
  ## Identity vs. profile — don't conflate them
145
252
  - **Identity / auth** — sign up, log in, log out, "is this caller a member?". Native to the headless
146
253
  OAuth app. **No app install needed** — every login mechanism here runs on this layer alone.
147
- - **Member profile / Members Area** — name / photo / roles, an account page, and custom-field
148
- definitions. Served by the **Members Area app**, which must be installed. If `getCurrentMember()`
149
- returns `null` while `isLoggedIn()` is `true`, suspect the app isn't installed — not a code bug.
150
-
151
- ## Hard rules (do not violate)
152
- - ✅ **Custom login only.** The member logs in on **your** UI; never redirect them to a Wix-hosted
153
- login page, and never use a Wix login-page redirect for member auth.
154
- - ✅ **One shared client.** Member login swaps the token set on `wix-client.js` — reuse the same
155
- transport for everything so the member identity (and their cart) carries across the app. Never mint
156
- a second client or re-mint anonymously after login (it drops the member).
157
- - ✅ **For a Wix-backed feature, use the Wix member as the identity — keep it consistent.** When the
158
- feature is about **Wix members** (the user gave you a `WIX_CLIENT_ID`), log in and gate on the
159
- **Wix member** (`getCurrentMember()` / the Wix member token), and key member-owned Wix rows on
160
- `_owner` (see the `cms` vertical). Don't identify one feature's user from two different sessions —
161
- the ids won't match.
162
- - ❌ **Don't blend the two exchanges.** Credential login finishes via the hidden iframe; social
163
- finishes via `/callback`. The helper keeps them separate — don't cross-wire.
164
- - ❌ **Never fake a member.** No mock "logged-in" state, no invented profile, roles, or member counts.
165
- Render the real member or the logged-out state.
166
- - ✅ **Fail loudly.** The helper throws `MemberAuthError` on bad credentials, state mismatch, timeout,
167
- and token-exchange failure — surface them; don't swallow.
168
- - ⛔ **No `elevate` / admin scope.** A member reading their **own** data (profile, own orders /
169
- bookings / plans) is authorized by the member token alone. There is no admin elevation on a
170
- client-only front, and own-data reads don't need it.
171
- - ⛔ **MFA / TOTP is not available headless.** The security layers are password + email verification +
172
- reCAPTCHA, all **dashboard-governed** — document them as host-configurable, don't set them from code.
173
-
174
- ## Beyond the snippets
175
- The helper covers sign-up / login / social / SSO / logout / current-member. For a genuine gap, extend
176
- with `wixApiRequest` — but confirm the endpoint, method, and body in the API reference first (or via
177
- the co-installed **`wix-docs`** skill). Never guess.
178
- - Custom login (JS SDK, concepts mirror the REST calls): https://dev.wix.com/docs/go-headless/self-managed-headless/authentication/members/custom-login-page/custom-login/custom-login-using-the-js-sdk.md
179
- - External / social login (REST): https://dev.wix.com/docs/rest/business-management/headless-authentication/redirects/create-redirect-session
180
- - Retrieve Tokens (REST): https://dev.wix.com/docs/rest/business-management/headless-authentication/authentication/retrieve-tokens
181
- - Members API (read/update profile, query members): https://dev.wix.com/docs/api-reference/members/members/members-v1/introduction
254
+ - **Member profile / Members Area** — name / photo / roles, an account page, custom-field definitions.
255
+ Served by the **Members Area app**, which must be installed. If `getCurrentMember()`/`useMember().member`
256
+ is `null` while `loggedIn` is `true`, suspect the app isn't installed — **not a code bug**.
257
+
258
+ Fallback only — when you hit an error or need something not shown here (password reset, custom SSO
259
+ connection ids, a profile field these snippets don't have): read the relevant shipped file under
260
+ `src/rest/`, or look it up via the **`wix-docs`** skill.
261
+
262
+ ## Hard rules
263
+ - Set `WIX_CLIENT_ID` (STEP 2) — not the placeholder.
264
+ - Style via base44 design tokens (`index.css` / shadcn Tailwind classes), never by rewriting the shipped components or adding a parallel theme file.
265
+ - **Custom login only** — the member logs in on **your** UI; never redirect them to a Wix-hosted login page.
266
+ - **One shared client** — login swaps the token set on `wix-client.js`; reuse it for everything so the
267
+ member identity carries across the app. Never mint a second client or re-mint anonymously after login.
268
+ - Copy `wix-members-auth.js` verbatim; extend by *calling* its exports, never by editing them.
269
+ - Header/footer live in a `Layout` around `<Outlet/>` (STEP 4) — never edit the shipped `Login`/`Account`/`Callback` to add chrome; the fixed top region owns positioning (`<WixManageBanner/>` above a plain in-flow `<Header/>`).
270
+ - **Never fake a member** — no mock logged-in state, invented profile, or roles. Render the real member or the real logged-out state.
271
+ - **Fail loudly** — the helper throws `MemberAuthError`; surface `.message`, don't swallow it.
272
+ - No `elevate` / admin scope, and no headless MFA/TOTP — those security layers are dashboard-governed.
182
273
 
183
274
  ## Point the user to their dashboard
184
- Some setup only happens in the Wix dashboard — always give the user the deep links:
185
- - **Members Area app** (for profile data + custom fields) — `https://manage.wix.com/dashboard/{metaSiteId}/member-permissions`
186
- - **Signup security** (email verification, owner approval, reCAPTCHA) — `Dashboard → Settings → Login & Security` / member signup settings
187
- - **Allowed authorization redirect URIs** — the OAuth-app / **Headless Settings** for the project:
188
- `https://manage.wix.com/dashboard/{metaSiteId}/oauth-apps-settings`. Add:
189
- - the **app origin** (e.g. `https://myapp.example.com`) — needed for direct-credential login from a
190
- non-default origin (`localhost:4321` is pre-allowed);
191
- - the **exact `/callback` URL** (e.g. `https://myapp.example.com/callback`) — required for social/SSO;
192
- - also add password-reset / logout return URLs if you use them.
193
- Tell the user these exact values; the callback URL must match your `startSocialLogin` `callbackUri`
194
- character-for-character.
195
- - **Custom SSO connection** (to obtain a `connectionId`) — created under the project's IAM / SSO
196
- settings in the Business Manager.
197
-
198
- Substitute the site's `metaSiteId` (from the handoff / `ListWixSites`).
199
-
200
- ## Verification checklist (before declaring done)
201
- - [ ] `WIX_CLIENT_ID` set to the prompt's value (not the `<YOUR-CLIENT-ID>` placeholder)
202
- - [ ] Sign-up: `register()` returns `SUCCESS` (or `REQUIRE_EMAIL_VERIFICATION` handled via `verifyEmail`)
203
- - [ ] Log-in: `login()` reaches `SUCCESS`; wrong password shows `invalidCredentials`, not a crash
204
- - [ ] After login `isLoggedIn()` is `true` and `getCurrentMember()` returns the member (or `null` with
205
- the Members Area app not installed — documented, not a bug)
206
- - [ ] A member-scoped read (e.g. pricing-plans "my plans") now returns the member's data via the same client
207
- - [ ] Social: the button redirects to the provider and `/callback` logs the member in (callback URL
208
- allow-listed); custom SSO works with its `connectionId` (or is flagged as pending host setup)
209
- - [ ] Logout clears the session and the next load is a clean anonymous visitor
210
- - [ ] No mocked member state, profile, or roles anywhere
211
- - [ ] Told the user about any required dashboard setup (Members Area app, allowed redirect URIs) with deep links
275
+ Some setup only happens in the Wix dashboard — always give the user the deep links (substitute the
276
+ site's `metaSiteId` from the handoff / `ListWixSites`):
277
+ - **Allowed authorization redirect URIs** (the #1 gotcha) — `https://manage.wix.com/dashboard/{metaSiteId}/oauth-apps-settings`.
278
+ Add the **app origin** (for credential login off `localhost:4321`) and the **exact `/callback` URL**
279
+ (for social/SSO) — character-for-character matching your `startSocialLogin` `callbackUri`.
280
+ - **Members Area app** (profile data + custom fields) — `https://manage.wix.com/dashboard/{metaSiteId}/member-permissions`
281
+ - **Signup security** (email verification, owner approval, reCAPTCHA) — `Dashboard → Settings → Login & Security`
282
+ - **Custom SSO connection** (to obtain a `connectionId`) — the project's IAM / SSO settings in the Business Manager.
283
+
284
+ ## Seeding
285
+ **Nothing to seed** — members self-register; there is no build-time member to create. See
286
+ `seed/SEED.md` (separate from this client build; the members work is entirely frontend wiring).
287
+
288
+ ## Verify (before declaring done)
289
+ - [ ] Client files copied into `src/`; `WIX_CLIENT_ID` set (not the placeholder).
290
+ - [ ] Brand palette lives in `index.css` (`:root`/`.dark`); no parallel theme file; shipped components/pages not restyled or rewritten.
291
+ - [ ] Opened the vertical's data route(s) (not just the home page) — `/login` and `/account` — and confirmed the shipped components render themed (surface, text, brand) with images.
292
+ - [ ] `Layout` (fixed `<WixManageBanner/>` + `<Header/>` region, then `<Outlet/>` + Footer) wraps all routes; shipped `Login`/`Account`/`Callback` untouched; content clears the fixed chrome; `<MemberProvider>` wraps the tree; `<MemberMenu/>` in the header.
293
+ - [ ] Sign-up: `register()` reaches `SUCCESS` (or `REQUIRE_EMAIL_VERIFICATION` handled via the code entry).
294
+ - [ ] Log-in: `login()` reaches `SUCCESS`; wrong password shows `invalidCredentials`, not a crash.
295
+ - [ ] After login `useMember().loggedIn` is `true`; `/account` renders the member (or the identity-only fallback with the Members Area app not installed — documented, not a bug). `/account` bounces a visitor to `/login`.
296
+ - [ ] Session survives reload (same client); logout clears it and the next load is a clean anonymous visitor.
297
+ - [ ] Social: the button redirects to the provider and `/callback` logs the member in (callback URL allow-listed), or is flagged as pending host setup.
298
+ - [ ] No mocked member state, profile, or roles anywhere.
299
+ - [ ] Told the user about any required dashboard setup (allowed redirect URIs, Members Area app) with deep links.