@wix/agent-skills 1.21.0 → 1.22.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 (258) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +60 -4
  3. package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
  4. package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
  5. package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
  6. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
  7. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
  9. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
  10. package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
  11. package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
  12. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
  13. package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
  14. package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
  15. package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
  16. package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
  17. package/skills/wix-headless-fast/SKILL.md +61 -223
  18. package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
  19. package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +11 -12
  20. package/skills/wix-headless-fast/guides/existing-site.md +76 -0
  21. package/skills/wix-headless-fast/guides/reference-mode.md +97 -0
  22. package/skills/wix-headless-fast/install/AGENTS.md +6 -3
  23. package/skills/wix-headless-fast/install/attach.mjs +15 -47
  24. package/skills/wix-headless-fast/install/deploy.mjs +21 -60
  25. package/skills/wix-headless-fast/install/lock.mjs +55 -0
  26. package/skills/wix-headless-fast/install/setup.mjs +32 -12
  27. package/skills/wix-headless-fast/install/templates.mjs +168 -0
  28. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
  29. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
  30. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -303
  31. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
  32. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
  33. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
  34. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
  35. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
  36. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
  37. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
  38. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
  39. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
  40. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
  41. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
  42. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
  43. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
  44. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
  45. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
  46. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
  47. package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
  48. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
  49. package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
  50. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +0 -22
  51. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
  52. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -277
  53. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
  54. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
  55. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
  56. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
  57. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
  58. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
  59. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
  60. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
  61. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
  62. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
  63. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
  64. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
  65. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
  66. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
  67. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
  68. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
  69. package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
  70. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
  71. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +0 -28
  72. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
  73. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -355
  74. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
  75. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
  76. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
  77. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
  78. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
  79. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
  80. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
  81. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
  82. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
  83. package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
  84. package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
  85. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +0 -20
  86. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
  87. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -307
  88. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
  89. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
  90. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
  91. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
  92. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
  93. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
  94. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
  95. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
  96. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
  97. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
  98. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
  99. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
  100. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
  101. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
  102. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
  103. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
  104. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
  105. package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
  106. package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
  107. package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
  108. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +0 -26
  109. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
  110. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -340
  111. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
  112. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
  113. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
  114. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
  115. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
  116. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
  117. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
  118. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
  119. package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
  120. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
  121. package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
  122. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +0 -20
  123. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
  124. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -316
  125. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
  126. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
  127. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
  128. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
  129. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
  130. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
  131. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
  132. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
  133. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
  134. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
  135. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
  136. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
  137. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
  138. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
  139. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
  140. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
  141. package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
  142. package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
  143. package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
  144. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +0 -15
  145. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
  146. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -315
  147. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
  148. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
  149. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
  150. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
  151. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
  152. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
  153. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
  154. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
  155. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
  156. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
  157. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
  158. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
  159. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
  160. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
  161. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
  162. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
  163. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
  164. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
  165. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
  166. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
  167. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +0 -20
  168. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -256
  169. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -296
  170. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
  171. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
  172. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
  173. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
  174. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
  175. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
  176. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
  177. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
  178. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
  179. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
  180. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
  181. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
  182. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
  183. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
  184. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
  185. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
  186. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
  187. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
  188. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
  189. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +0 -21
  190. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
  191. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -360
  192. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
  193. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
  194. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
  195. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
  196. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
  197. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
  198. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
  199. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
  200. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
  201. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
  202. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
  203. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
  204. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
  205. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
  206. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
  207. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
  208. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
  209. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
  210. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
  211. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
  212. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
  213. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
  214. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
  215. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
  216. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
  217. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +0 -25
  218. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -499
  219. package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
  220. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
  221. package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
  222. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
  223. package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
  224. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
  225. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
  226. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
  227. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
  228. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
  229. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
  230. package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
  231. package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
  232. package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
  233. package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
  234. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +0 -99
  235. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -612
  236. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
  237. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
  238. package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
  239. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
  240. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
  241. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
  242. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
  243. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
  244. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
  245. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
  246. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
  247. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -314
  248. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
  249. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
  250. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
  251. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -169
  252. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
  253. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
  254. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
  255. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
  256. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -130
  257. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +0 -38
  258. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -561
@@ -1,216 +0,0 @@
1
- // Submission rules — transport-agnostic, imported by BOTH transports: ./submissions.ts (the SDK)
2
- // and the REST twin in references/forms/rest/submissions.ts. What a visitor's values become on
3
- // the wire, which statuses mean "created", how a rejection maps back onto controls, and how an
4
- // attachment is uploaded — all HERE, once. A created submission may arrive wrapped (`{ submission }`,
5
- // REST) or bare (SDK), with `_id` (SDK) or `id` (REST); the mapper accepts both.
6
- // docs: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/about-submission-values.md
7
- import type { Raw } from "./forms-core";
8
- import type { FormFieldDto, FormValues, SubmissionDto } from "./types";
9
-
10
- /**
11
- * Statuses that mean the submission EXISTS — show the thank-you for all three. `CONFIRMED` is
12
- * recorded, `PENDING` is created but not recorded yet, `PAYMENT_WAITING` is created on a form
13
- * that also collects payment. Treating one as a failure invites the visitor to submit again,
14
- * which costs the owner duplicate entries for a submission that already exists.
15
- *
16
- * An allowlist rather than a catch-all, so a status added to the enum later cannot silently
17
- * render a thank-you for something that is not a submission.
18
- */
19
- export const SUBMITTED_OK = new Set(["CONFIRMED", "PENDING", "PAYMENT_WAITING"]);
20
-
21
- /** Strip visitor-added formatting from a phone number — submit this, not the raw control text. */
22
- export const normalizePhone = (v: unknown): string => String(v ?? "").replace(/[\s()\-.]/g, "");
23
-
24
- /** Uploads a File to a pre-signed URL and resolves to the value to submit for its field. */
25
- export type UploadOne = (formId: string, file: File) => Promise<string>;
26
-
27
- /**
28
- * A browser leaves `type` empty for extensions it does not recognize; the generic type keeps
29
- * the upload-URL call valid (Media Manager rejects a mime type that contradicts the extension).
30
- */
31
- export const uploadMimeType = (file: File): string => file.type || "application/octet-stream";
32
-
33
- /**
34
- * PUT the bytes to the generated upload URL and return the value to submit for the field.
35
- *
36
- * The submission value IS the generated upload URL — not the CDN URL the upload responds with,
37
- * and not a file id. The PUT goes to a pre-signed host with plain `fetch`, never through the SDK
38
- * or the REST client: adding the visitor's Authorization header to a pre-signed URL turns a
39
- * working upload into a 400.
40
- */
41
- export async function putUpload(uploadUrl: string, file: File, mimeType: string = uploadMimeType(file)): Promise<string> {
42
- const put = await fetch(`${uploadUrl}?filename=${encodeURIComponent(file.name)}`, {
43
- method: "PUT",
44
- headers: { "Content-Type": mimeType },
45
- body: file,
46
- });
47
- if (!put.ok) {
48
- // Media Manager's own codes land here: FILE_SIZE_OVER_LIMIT, UNSUPPORTED_FILE_FORMAT,
49
- // MISMATCH_MIME_TYPE, ZERO_FILE_SIZE, SITE_QUOTA_EXCEEDED.
50
- throw new Error(`forms: could not upload "${file.name}" (${put.status}). Check its size and type.`);
51
- }
52
- return uploadUrl;
53
- }
54
-
55
- /**
56
- * Upload every File sitting in the form's values and return a copy with each file field
57
- * replaced by its uploaded URL(s). Values already holding URLs (a retry after the server
58
- * rejected some OTHER field) are kept as they are, so a retry never re-uploads. `uploadOne` is
59
- * the transport's getMediaUploadUrl + putUpload.
60
- */
61
- export async function uploadFilesWith(
62
- uploadOne: UploadOne,
63
- formId: string,
64
- fields: FormFieldDto[],
65
- values: FormValues,
66
- ): Promise<FormValues> {
67
- const next: FormValues = { ...values };
68
- for (const field of fields) {
69
- if (field.control !== "file" && field.control !== "signature") continue;
70
- const picked = ([] as unknown[]).concat(values[field.target] ?? []);
71
- const done: string[] = [];
72
- // Sequential on purpose: a visitor's uplink is the bottleneck, and a failed file should
73
- // stop the submit rather than race more uploads it will throw away.
74
- for (const item of picked) {
75
- if (typeof item === "string" && item) done.push(item);
76
- else if (typeof File !== "undefined" && item instanceof File) done.push(await uploadOne(formId, item));
77
- }
78
- next[field.target] = done;
79
- }
80
- return next;
81
- }
82
-
83
- /**
84
- * Turn the visitor's values into the map `createSubmission` expects, keyed by each field's
85
- * `target` — the same key the controls are bound to, so the keys come out right by
86
- * construction with no hand-maintained list to drift.
87
- *
88
- * Walks the FIELDS, not the values object: a stray key can never reach the API, and a field
89
- * the owner just added shows up the moment the schema does.
90
- *
91
- * Three value shapes: a flat value (text/choice/date), an ARRAY (multi-choice, several files),
92
- * an OBJECT (an address, keyed by subfield — the shape behind `address/city` error paths). An
93
- * empty optional field is OMITTED rather than sent as "": the server validates what it is given.
94
- */
95
- export function toSubmissionValues(fields: FormFieldDto[], values: FormValues): Record<string, unknown> {
96
- const filled = (v: unknown) => v !== undefined && v !== null && String(v).trim() !== "";
97
- const out: Record<string, unknown> = {};
98
-
99
- for (const field of fields) {
100
- const raw = values?.[field.target];
101
-
102
- if (field.control === "address") {
103
- const parts: Record<string, string> = {};
104
- const held = (raw ?? {}) as Record<string, unknown>;
105
- for (const { sub } of field.addressParts) {
106
- if (filled(held[sub])) parts[sub] = String(held[sub]).trim();
107
- }
108
- if (Object.keys(parts).length) out[field.target] = parts;
109
- continue;
110
- }
111
-
112
- if (field.control === "file" || field.control === "signature") {
113
- // Whatever the upload produced. A stray File that never went through the upload is
114
- // dropped rather than sent, since it would 400 the whole form.
115
- const urls = ([] as unknown[]).concat(raw ?? []).filter((v): v is string => typeof v === "string" && !!v);
116
- if (urls.length) out[field.target] = urls.length === 1 ? urls[0] : urls;
117
- continue;
118
- }
119
-
120
- if (field.inputType === "ARRAY") {
121
- const picked = (Array.isArray(raw) ? raw : []).filter(filled);
122
- if (picked.length) out[field.target] = picked;
123
- continue;
124
- }
125
-
126
- if (field.control === "checkbox") {
127
- // A consent checkbox submits a boolean. Unchecked AND optional is omitted; unchecked and
128
- // required fails validation before it gets here.
129
- if (raw === true) out[field.target] = true;
130
- continue;
131
- }
132
-
133
- if (!filled(raw)) continue;
134
- const value = typeof raw === "string" ? raw.trim() : raw;
135
- out[field.target] =
136
- field.control === "number" || field.control === "rating" ? Number(value) :
137
- field.control === "phone" ? normalizePhone(value) :
138
- value;
139
- }
140
- return out;
141
- }
142
-
143
- /**
144
- * The created submission as a DTO. Accepts the REST envelope (`{ submission }`) and the SDK's bare
145
- * entity; throws when nothing came back or the status is not one that means "created", so a
146
- * caller never shows a thank-you for something that is not a submission.
147
- */
148
- export function toSubmission(created: Raw | null | undefined): SubmissionDto {
149
- const submission: Raw | undefined = created?.submission ?? created;
150
- const id: string | undefined = submission?._id ?? submission?.id;
151
- if (!id) throw new Error("forms: submission failed (nothing returned).");
152
- const status: string = submission?.status ?? "";
153
- if (!SUBMITTED_OK.has(status)) {
154
- throw new Error(
155
- `forms: submission status is "${status}" — not one of the statuses that mean the submission ` +
156
- `was created (${[...SUBMITTED_OK].join(", ")}), so do not show a success state.`,
157
- );
158
- }
159
- return { id, status };
160
- }
161
-
162
- /**
163
- * Pull per-field violations out of a failed create, keyed by input NAME so each message lands
164
- * on its own control. `errorPath` is the field's `target`, or a nested path like
165
- * `address/subdivision` — exactly how the controls are named, so it maps straight across.
166
- *
167
- * The documented entries arrive under `details.validationError.fieldViolations[]`, each with
168
- * its own nested `data.errors[]` — two levels deeper than the docs' shape. This flattens that.
169
- * The SDK error and the REST client's WixApiError both carry that block as `details`.
170
- *
171
- * Two rejections here are SEED bugs, not frontend bugs — fix them in `seed/SEED.md`, never
172
- * by mangling the key or the value:
173
- * - UNKNOWN_VALUE_ERROR on a key that IS in the schema → the field was seeded with no
174
- * `validation` block, and that block is what registers the target as an accepted value.
175
- * - NOT_ALLOWED_VALUE_ERROR on a choice field → the seed's `options[].value` and its
176
- * validation enum disagree; the two declarations must match.
177
- */
178
- export function submissionErrors(err: unknown, fields: FormFieldDto[]): Record<string, string> {
179
- const body = (err as Raw)?.details ?? (err as Raw)?.body?.details ?? {};
180
- const violations: Raw[] = body?.validationError?.fieldViolations ?? [];
181
- const byTarget = new Map(fields.map((f) => [f.target, f]));
182
- const out: Record<string, string> = {};
183
-
184
- for (const entry of violations.flatMap((v) => v.data?.errors ?? [v])) {
185
- const path: string | undefined = entry?.errorPath;
186
- if (!path) continue;
187
- const field = byTarget.get(path.split("/")[0]);
188
- if (!field) continue;
189
- // Wix's own errorMessage is the validator's internal wording — debug only.
190
- console.debug("forms: server violation", path, entry.errorType, entry.errorMessage);
191
- out[path] = messageFor(entry.errorType, field);
192
- }
193
- return out;
194
- }
195
-
196
- /** errorType → visitor-facing copy, written from the field's own schema. */
197
- export function messageFor(errorType: string, f: FormFieldDto): string {
198
- const v = f.validation;
199
- switch (errorType) {
200
- case "REQUIRED_VALUE_ERROR": return `${f.label} is required.`;
201
- case "MIN_LENGTH_ERROR": return `${f.label} must be at least ${v.minLength} characters.`;
202
- case "MAX_LENGTH_ERROR": return `${f.label} must be at most ${v.maxLength} characters.`;
203
- case "MIN_VALUE_ERROR": return `${f.label} must be ${v.minimum ?? "higher"} or more.`;
204
- case "MAX_VALUE_ERROR": return `${f.label} must be ${v.maximum ?? "lower"} or less.`;
205
- case "PATTERN_ERROR": return `${f.label} is not in the expected format.`;
206
- case "NOT_ALLOWED_VALUE_ERROR": return `Choose one of the listed options for ${f.label}.`;
207
- case "FORMAT_ERROR":
208
- return v.format === "EMAIL" ? "Enter a valid email address."
209
- : v.format === "PHONE" ? "Use international format, starting with +."
210
- : v.format === "URL" ? "Enter a full URL starting with https://"
211
- : `Please check ${f.label}.`;
212
- // The enum grows: MIN/MAX_ITEMS_ERROR and DISABLED_FORM_ERROR are reachable without being
213
- // listed, so an unmapped type degrades to safe copy rather than showing nothing.
214
- default: return `Please check ${f.label}.`;
215
- }
216
- }
@@ -1,59 +0,0 @@
1
- // Wix Forms submissions (@wix/forms `submissions`) over the SDK — get an upload URL, create the
2
- // submission. The rules (value shapes, accepted statuses, violation mapping, the upload PUT) live
3
- // in ./submissions-core (shared with the REST twin in references/forms/rest/); this file is the
4
- // transport only. Copy as-is; extend by adding functions.
5
- //
6
- // The visitor token creates the submission, despite the spec. `CreateSubmission` is listed under
7
- // the owner scope `SCOPE.DC-FORMS.MANAGE-SUBMISSIONS` and returns 200 on an anonymous visitor: Wix
8
- // grants implicit visitor access so a published site can submit its own forms. Reaching for a
9
- // backend here is the most common wrong turn on this vertical.
10
- //
11
- // SUBMISSIONS ARE WRITE-ONLY FROM A VISITOR. Reading them back genuinely requires the owner
12
- // scope and 403s. The resolved create IS the confirmation — show a thank-you; the entry appears
13
- // in the owner's dashboard. A site that must LIST what visitors submitted needs `cms` instead.
14
- //
15
- // docs: https://dev.wix.com/docs/sdk/business-solutions/forms/submissions/create-submission.md
16
- // docs: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/about-submission-values.md
17
- import { submissions as submissionsModule } from "@wix/forms";
18
- import { wixModule } from "../sdk";
19
- import type { Raw } from "./forms-core";
20
- import {
21
- SUBMITTED_OK,
22
- normalizePhone,
23
- putUpload,
24
- submissionErrors,
25
- toSubmission,
26
- toSubmissionValues,
27
- uploadFilesWith,
28
- uploadMimeType,
29
- } from "./submissions-core";
30
- import type { FormFieldDto, FormValues, SubmissionDto } from "./types";
31
-
32
- export { SUBMITTED_OK, normalizePhone, submissionErrors, toSubmissionValues };
33
-
34
- const submissions = wixModule(submissionsModule);
35
-
36
- /** Upload one File and return the value to submit for its field (the upload URL itself). */
37
- export async function uploadFile(formId: string, file: File): Promise<string> {
38
- const mimeType = uploadMimeType(file);
39
- const res = (await submissions.getMediaUploadUrl(formId, file.name, mimeType)) as Raw;
40
- const uploadUrl: string | undefined = res?.uploadUrl ?? res?.url;
41
- if (!uploadUrl) throw new Error(`forms: no upload URL for "${file.name}".`);
42
- return putUpload(uploadUrl, file, mimeType);
43
- }
44
-
45
- /** Upload every File in the form's values; returns a copy with each file field holding its URL(s). */
46
- export async function uploadFiles(formId: string, fields: FormFieldDto[], values: FormValues): Promise<FormValues> {
47
- return uploadFilesWith(uploadFile, formId, fields, values);
48
- }
49
-
50
- /**
51
- * Create the submission. This is the write — and the only confirmation there is.
52
- *
53
- * Let a rejection throw. `submissionErrors` turns it into per-control messages; a `.catch`
54
- * that swallows it costs the visitor the reason their form would not send.
55
- */
56
- export async function createSubmission(formId: string, values: Record<string, unknown>): Promise<SubmissionDto> {
57
- const created = (await submissions.createSubmission({ formId, submissions: values })) as Raw;
58
- return toSubmission(created);
59
- }
@@ -1,135 +0,0 @@
1
- // Forms DTOs — the serializable shapes every hook and page consumes. A form is schema-driven
2
- // (the owner picks the fields in their dashboard), so a FormDto is a LIST of fields rather
3
- // than a fixed interface: render by mapping `form.fields`, never by naming fields in code.
4
- //
5
- // Why a DTO at all, when the schema IS the model: the raw `Form` nests a field's settings two
6
- // levels deep under blocks named after its own enums
7
- // (`inputOptions.stringOptions.dropdownOptions.label`), carries Date objects and Ricos
8
- // rich-content labels that are not island-serializable, and spreads display ORDER across
9
- // `steps[].layout` rather than `formFields[]`. FormFieldDto is that resolved once, in the data
10
- // layer, into flat keys — the same rule every other vertical here follows.
11
- //
12
- // It is a FLATTENING, not a subset: every setting a renderer needs is carried through. When a
13
- // field kind needs something not listed here, add the key — never reach past the DTO into the
14
- // raw form.
15
-
16
- /** What the visitor types into. Drives which control your component renders. */
17
- export type FormControl =
18
- | "text"
19
- | "textarea"
20
- | "number"
21
- | "rating"
22
- | "email"
23
- | "phone"
24
- | "url"
25
- | "date"
26
- | "time"
27
- | "datetime"
28
- | "select"
29
- | "radio"
30
- | "checkbox"
31
- | "checkboxGroup"
32
- | "tags"
33
- | "address"
34
- | "file"
35
- | "signature"
36
- | "payment"
37
- /** A bookings slot picker embedded in a form — needs the `bookings` vertical, not an <input>. */
38
- | "appointment"
39
- | "unknown";
40
-
41
- /** One choice in a select / radio / checkbox group. */
42
- export interface FormChoice {
43
- value: string;
44
- /** The owner's wording, falling back to `value` so a choice is never blank. */
45
- label: string;
46
- }
47
-
48
- /** One subfield of an ADDRESS field — its own control, its own error key (`target/sub`). */
49
- export interface FormAddressPart {
50
- /** `addressLine`, `city`, `postalCode`, `country`, … — also the key inside the submitted object. */
51
- sub: string;
52
- /** "Postal code" — humanized from `sub`; the schema carries no label for a subfield. */
53
- label: string;
54
- required: boolean;
55
- }
56
-
57
- /** The schema's own rules, resolved onto the field. Undefined means the owner set no rule. */
58
- export interface FormValidation {
59
- /** EMAIL | PHONE | URL | DATE — drives both the control type and the format check. */
60
- format?: string;
61
- minLength?: number;
62
- maxLength?: number;
63
- /** A regex SOURCE string, not a RegExp — compile it at the call site. */
64
- pattern?: string;
65
- /** NUMBER / rating bounds. */
66
- minimum?: number;
67
- maximum?: number;
68
- /** WIX_FILE: how many files this field accepts. */
69
- fileLimit?: number;
70
- /** Multi-choice bounds, when the owner set them. */
71
- minItems?: number;
72
- maxItems?: number;
73
- }
74
-
75
- /**
76
- * One visible input, flattened. `target` is the field's immutable storage key — the input's
77
- * `name`, the key in `values`, the key in the submission, and the root of the server's error
78
- * paths. Everything is keyed by it, so nothing has to be matched by label or index.
79
- */
80
- export interface FormFieldDto {
81
- target: string;
82
- /** The owner's label. Never empty — falls back to `target`. Always a string (a consent
83
- * checkbox labels itself with rich content upstream; that is flattened to its plain text). */
84
- label: string;
85
- control: FormControl;
86
- required: boolean;
87
- placeholder?: string;
88
- /** Help text shown under the control, when the owner wrote one. */
89
- description?: string;
90
- /** The owner's prefill: "" / [] / {} when unset, so the control is controlled from render one. */
91
- defaultValue: string | number | boolean | string[] | Record<string, string>;
92
- /** select / radio / checkboxGroup / tags — empty for every other control. */
93
- choices: FormChoice[];
94
- /** address only — empty for every other control. */
95
- addressParts: FormAddressPart[];
96
- validation: FormValidation;
97
- /** phone only: the country whose example to show ("US", "GB", …). */
98
- phoneCountry?: string;
99
- /**
100
- * The field's kind as the owner picked it — TEXT_AREA, IMAGE_CHOICE, CONTACTS_EMAIL, … Several
101
- * kinds share one component (short and long answer are both TEXT_INPUT; image choice and multi
102
- * choice are both CHECKBOX_GROUP), so this is what separates them when `control` cannot.
103
- */
104
- identifier: string;
105
- /** The raw `inputType` / `componentType`, for the rare branch the flattening does not cover. */
106
- inputType: string;
107
- componentType: string;
108
- }
109
-
110
- /** One form, ready to render. */
111
- export interface FormDto {
112
- id: string;
113
- /** The owner's form name — an internal label, not necessarily page copy. */
114
- name: string;
115
- /** Every visible input, in the order the owner laid out (across steps, in step order). */
116
- fields: FormFieldDto[];
117
- /** The owner's submit-button wording, or "" when they left the default. */
118
- submitText: string;
119
- }
120
-
121
- /** `target` → the visitor's current value. Arrays for multi-choice, objects for an address. */
122
- export type FormValues = Record<string, unknown>;
123
-
124
- /**
125
- * `target` (or `target/sub`) → a visitor-facing message. The key is the control's `name`, so a
126
- * message lands on its own control with no mapping table.
127
- */
128
- export type FormErrors = Record<string, string>;
129
-
130
- /** A created submission. There is nothing to read back — this IS the confirmation. */
131
- export interface SubmissionDto {
132
- id: string;
133
- /** CONFIRMED | PENDING | PAYMENT_WAITING — all three mean the submission exists. */
134
- status: string;
135
- }