@wix/agent-skills 1.21.0 → 1.23.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 (269) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +71 -7
  3. package/skills/wix-app/references/APP_VALIDATION.md +16 -10
  4. package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
  5. package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
  6. package/skills/wix-app/references/SDK_MODULE_MAP.md +2 -0
  7. package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
  9. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
  10. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
  11. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
  12. package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
  13. package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
  14. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
  15. package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
  16. package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
  17. package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
  18. package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
  19. package/skills/wix-headless-fast/SKILL.md +95 -230
  20. package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
  21. package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +17 -14
  22. package/skills/wix-headless-fast/guides/existing-site.md +78 -0
  23. package/skills/wix-headless-fast/guides/migration.md +43 -0
  24. package/skills/wix-headless-fast/guides/reference-mode.md +100 -0
  25. package/skills/wix-headless-fast/install/AGENTS.md +9 -4
  26. package/skills/wix-headless-fast/install/agents-md.mjs +5 -1
  27. package/skills/wix-headless-fast/install/attach.mjs +25 -47
  28. package/skills/wix-headless-fast/install/check.mjs +87 -0
  29. package/skills/wix-headless-fast/install/context.mjs +126 -0
  30. package/skills/wix-headless-fast/install/deploy.mjs +106 -80
  31. package/skills/wix-headless-fast/install/lock.mjs +55 -0
  32. package/skills/wix-headless-fast/install/setup.mjs +83 -23
  33. package/skills/wix-headless-fast/install/templates.mjs +168 -0
  34. package/skills/wix-manage/SKILL.md +3 -3
  35. package/skills/wix-manage/references/app-installation/install-wix-apps.md +68 -2
  36. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +37 -4
  37. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +29 -3
  38. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
  39. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
  40. package/skills/wix-manage/references/sites/site-import.md +101 -37
  41. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -303
  42. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
  43. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
  44. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
  45. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
  46. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
  47. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
  48. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
  49. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
  50. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
  51. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
  52. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
  53. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
  54. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
  55. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
  56. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
  57. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
  58. package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
  59. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
  60. package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
  61. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +0 -22
  62. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
  63. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -277
  64. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
  65. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
  66. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
  67. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
  68. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
  69. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
  70. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
  71. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
  72. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
  73. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
  74. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
  75. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
  76. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
  77. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
  78. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
  79. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
  80. package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
  81. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
  82. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +0 -28
  83. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
  84. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -355
  85. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
  86. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
  87. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
  88. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
  89. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
  90. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
  91. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
  92. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
  93. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
  94. package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
  95. package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
  96. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +0 -20
  97. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
  98. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -307
  99. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
  100. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
  101. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
  102. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
  103. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
  104. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
  105. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
  106. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
  107. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
  108. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
  109. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
  110. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
  111. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
  112. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
  113. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
  114. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
  115. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
  116. package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
  117. package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
  118. package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
  119. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +0 -26
  120. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
  121. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -340
  122. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
  123. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
  124. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
  125. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
  126. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
  127. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
  128. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
  129. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
  130. package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
  131. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
  132. package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
  133. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +0 -20
  134. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
  135. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -316
  136. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
  137. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
  138. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
  139. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
  140. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
  141. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
  142. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
  143. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
  144. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
  145. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
  146. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
  147. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
  148. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
  149. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
  150. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
  151. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
  152. package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
  153. package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
  154. package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
  155. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +0 -15
  156. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
  157. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -315
  158. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
  159. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
  160. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
  161. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
  162. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
  163. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
  164. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
  165. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
  166. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
  167. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
  168. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
  169. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
  170. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
  171. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
  172. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
  173. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
  174. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
  175. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
  176. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
  177. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
  178. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +0 -20
  179. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -256
  180. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -296
  181. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
  182. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
  183. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
  184. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
  185. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
  186. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
  187. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
  188. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
  189. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
  190. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
  191. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
  192. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
  193. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
  194. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
  195. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
  196. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
  197. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
  198. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
  199. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
  200. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +0 -21
  201. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
  202. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -360
  203. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
  204. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
  205. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
  206. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
  207. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
  208. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
  209. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
  210. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
  211. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
  212. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
  213. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
  214. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
  215. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
  216. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
  217. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
  218. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
  219. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
  220. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
  221. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
  222. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
  223. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
  224. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
  225. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
  226. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
  227. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
  228. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +0 -25
  229. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -499
  230. package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
  231. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
  232. package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
  233. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
  234. package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
  235. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
  236. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
  237. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
  238. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
  239. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
  240. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
  241. package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
  242. package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
  243. package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
  244. package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
  245. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +0 -99
  246. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -612
  247. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
  248. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
  249. package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
  250. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
  251. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
  252. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
  253. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
  254. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
  255. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
  256. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
  257. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
  258. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -314
  259. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
  260. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
  261. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
  262. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -169
  263. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
  264. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
  265. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
  266. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
  267. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -130
  268. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +0 -38
  269. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -561
@@ -0,0 +1,182 @@
1
+ # Finding the real SDK shape behind a dashboard page
2
+
3
+ > **Scope.** [DRAFT_TEMPLATE.md](DRAFT_TEMPLATE.md) gives you the page. This file is the other half:
4
+ > locating the method and the *field names* for the data it lists. Read it before Step 3's MCP
5
+ > discovery — the installed package answers most of it faster and more accurately than a doc search,
6
+ > because it is the version your code will compile against.
7
+
8
+ ## Where the types actually live
9
+
10
+ A Wix vertical package such as `@wix/ecom` is a thin re-export barrel. `build/es/index.d.mts` is a
11
+ list of namespaces (`orders`, `orderTransactions`, `currentCart`, …), each re-exported from its own
12
+ generated package:
13
+
14
+ ```
15
+ node_modules/@wix/ecom/build/es/index.d.mts # namespace list only, ~90 lines
16
+ node_modules/@wix/auto_sdk_ecom_orders/build/es/
17
+ index.d.mts # the callable functions
18
+ index.typings.d.mts # request/response types
19
+ ecom-v1-order-orders.universal-<hash>.d.mts # the domain entities
20
+ ```
21
+
22
+ Three consequences worth knowing before you start grepping:
23
+
24
+ 1. **The directory name is not the namespace name.** Namespaces are camelCase, package directories
25
+ are kebab-case — `extendedBookings` lives in `auto_sdk_bookings_extended-bookings`, not
26
+ `auto_sdk_bookings_extendedBookings`. Don't derive one from the other; list them:
27
+ `ls node_modules/@wix | grep <vertical>`.
28
+ 2. **The entity is not always in `index.typings.d.mts`.** `Order`, `Refund`, `Service` live in the
29
+ hashed `*.universal-*.d.mts` when the package has one. The hash changes between versions, so glob
30
+ for it, never hard-code it, and fall back to `index.typings.d.mts` when no universal file exists.
31
+ 3. **Never `cat` *or plain-`grep`* the barrel's export block.** These files end with a single
32
+ several-hundred-KB `export { … as a, … as b }` line, so `grep -n "queryServices" index.d.mts`
33
+ prints that whole line. Anchor to the declarations instead —
34
+ `grep -oE "^declare (const|function) [a-zA-Z]+"` — or pipe any barrel grep through `cut -c1-200`.
35
+
36
+ ## Confirming a method
37
+
38
+ ```bash
39
+ E=node_modules/@wix/auto_sdk_ecom_order-transactions/build/es
40
+ grep -oE "^declare function [a-zA-Z]+" $E/index.d.mts
41
+ ```
42
+
43
+ Prefer this to recall: `listTransactionsForMultipleOrders(orderIds: string[])` and
44
+ `listTransactionsForSingleOrder` differ by exactly the shape a collection page needs, and only one
45
+ of them avoids an N+1 across the visible page.
46
+
47
+ ## Confirming a field — the part that ships bugs
48
+
49
+ Once you have the entity, read the declaration for **every field you map into a column**, not just
50
+ the uncertain ones. Two failure modes recur:
51
+
52
+ **Deprecated fields still compile.** On `RegularPaymentDetails`, `paymentMethod` carries
53
+ `@deprecated Use paymentMethodName.buyerLanguageName instead` — the deprecated one is a bare code,
54
+ the replacement is the localised name a person expects to read. Grep before you map:
55
+
56
+ ```bash
57
+ grep -B4 "paymentMethod?:" $E/index.typings.d.mts # shows the @deprecated banner above it
58
+ ```
59
+
60
+ A column bound to a deprecated field renders something plausible and wrong, which is the hardest
61
+ kind of defect to catch in review.
62
+
63
+ **Aggregates hide one level down.** Money on a refund is not on the refund — it is
64
+ `refund.summary.refunded.amount` (`AggregatedRefundSummary`, with `pendingRefund`, `failedRefundAmount`
65
+ and `requestedRefund` beside it), while per-transaction status is
66
+ `refund.transactions[].refundStatus`. Summing the wrong one silently under-reports.
67
+
68
+ **A generic-sounding field is not the related entity.** Treat `.title`, `.name` and `.summary` as
69
+ unverified until you read the declaration: an `Extended*` / `*WithDetails` shape exists precisely to
70
+ attach the real related entity, and a summary field on the base item is not a substitute. A column
71
+ must show what its header promises.
72
+
73
+ **A mapper must cover every shape the response returns.** Responses often carry a oneof — Bookings'
74
+ `bookedEntity` is `slot` for an appointment, `schedule` for a class — and a mapper reading one
75
+ variant renders blank cells for the other while passing `tsc`.
76
+
77
+ ## Joining two sources for one row
78
+
79
+ A collection page usually needs one query plus one batch lookup, never a lookup per row:
80
+
81
+ ```ts
82
+ const { orders: found } = await orders.searchOrders({ filter, sort, cursorPaging: { limit, cursor } });
83
+ const ids = found.map((o) => o._id).filter((id): id is string => Boolean(id));
84
+ const { orderTransactions: txns } = await orderTransactions.listTransactionsForMultipleOrders(ids);
85
+ const byId = new Map(txns.map((t) => [t.orderId, t]));
86
+ ```
87
+
88
+ Build the `Map` once and index it in the row mapper. Guard the empty case before the second call —
89
+ a batch endpoint given `[]` is a wasted round trip at best.
90
+
91
+ ## Filter syntax
92
+
93
+ `searchOrders` takes a `CursorSearch`: `{ cursorPaging, filter, sort }`, where `filter` is a
94
+ Mongo-shaped `Record<string, any>` — `{ paymentStatus: { $in: [...] } }`,
95
+ `{ _createdDate: { $gte, $lte } }`, `{ number: { $startsWith } }`. Enum values come from the
96
+ declaration, not from memory: order payment status is `FULLY_REFUNDED` / `PARTIALLY_REFUNDED` /
97
+ `PAID` / `NOT_PAID` / `PENDING` / `PARTIALLY_PAID` / `PENDING_MERCHANT` / `CANCELED` / `DECLINED` /
98
+ `UNSPECIFIED`.
99
+
100
+ ## The SDK is not the REST API
101
+
102
+ Docs search returns REST pages, and a dashboard page calls the **SDK**. Append `?apiView=SDK` to the
103
+ URL of whatever page you landed on and read that view — it answers two of the four differences
104
+ before you write a line.
105
+
106
+ **1 and 2 — namespace and id naming. The SDK view states both.** It prints the package and namespace
107
+ outright (`SDK Package: @wix/members`, `SDK Namespace: customFields`), and uses `_id` in its own
108
+ parameter list. Infer either from the REST page and you get them wrong: REST paths say `services/v2`,
109
+ so `servicesV2` looks right, and the SDK exports `services`; REST responses show `"id"`, and the SDK
110
+ type declares `_id` — same for `_createdDate` / `_updatedDate`. Offline, the barrel is the fallback
111
+ for the namespace list:
112
+
113
+ ```bash
114
+ grep -oE "as [a-zA-Z_]+" node_modules/@wix/<pkg>/build/es/index.d.mts | sed 's/as //' | sort -u
115
+ ```
116
+
117
+ The next two are codegen artifacts that no docs page mentions — read them off the declaration.
118
+
119
+ **3. Don't derive types from `ReturnType`.** Most SDK functions are overloaded — a direct call
120
+ and an `httpClient` form — so `Awaited<ReturnType<typeof ns.method>>['items'][number]` resolves
121
+ against the wrong overload and fails. Import the entity type the package exports instead:
122
+
123
+ ```ts
124
+ type Row = <namespace>.<Entity>; // e.g. extendedBookings.ExtendedBooking — not ReturnType<typeof …>
125
+ ```
126
+
127
+ **4. Paging metadata carries no `hasNext`.** `PagingMetadataV2` is `count`, `offset`, `total`,
128
+ `tooManyToCount`, `cursors` — nothing else, in every generated package. Whether another page exists
129
+ is knowable only from `pagingMetadata.cursors.next`. What the collection wants you to *return* is a
130
+ separate question — see [TABLE_STATE.md](TABLE_STATE.md#query-and-result-shapes).
131
+
132
+ ## Two things to settle before you write the page
133
+
134
+ **Is the package even installed?** A vertical's SDK is not a default dependency. `@wix/bookings`,
135
+ `@wix/ecom` and the rest have to be present before the import resolves:
136
+
137
+ ```bash
138
+ node -e "const p=require('./package.json');console.log(!!({...p.dependencies,...p.devDependencies})['@wix/<pkg>'])"
139
+ npm install @wix/<pkg> # if false
140
+ ```
141
+
142
+ **Does the app hold the scope?** This is the one that produces a page which builds, mounts, renders
143
+ its shell, and shows nothing — the hardest failure to read, because an empty table looks like empty
144
+ data. Reads of a vertical's data need that vertical's permission scope, granted in **Dev Center →
145
+ Permissions**; it cannot be declared in the repo, and the app's install consent screen names what it
146
+ actually has.
147
+
148
+ **Don't guess the scope name — the method's own docs page prints it.** In SDK view every method
149
+ carries `Method Permissions` and `Method Permissions Scopes IDs`, for example
150
+ `Manage Members: SCOPE.DC-MEMBERS.MANAGE-MEMBERS`. Look it up for the exact method you are calling,
151
+ assume it is missing on a fresh app, and report it under
152
+ [Manual Steps Required](../../SKILL.md#-manual-steps-required) by name. Wiring `errorState` on the
153
+ table (the draft template does) is what turns this from silent skeletons into a message you can read.
154
+
155
+ ## A second vertical is a second scope
156
+
157
+ The two checks above are easy to run once, at Step 3, for the vertical the page is obviously about —
158
+ and then to skip for the *next* one, because by then you are deep in Step 4b adding a detail column
159
+ or resolving a search term. That second package needs the same two things, and it fails differently:
160
+ the page already worked, so the regression looks like something you broke in the UI.
161
+
162
+ A measured run added `@wix/crm` mid-implementation to resolve a client-name search. The app held
163
+ Bookings scopes and not `SCOPE.DC-CONTACTS.READ-CONTACTS`, the contacts call answered 403, and
164
+ because the search awaited it unconditionally, a page that had been loading fine stopped loading at
165
+ all.
166
+
167
+ **Run the package-and-scope check for every `@wix/*` import you add, whenever you add it** — and
168
+ then decide what its failure should cost:
169
+
170
+ - **Primary source** — the rows themselves. Its failure is the page's failure; `errorState` reports it.
171
+ - **Secondary source** — an enrichment lookup, a filter's option list, a term resolved to ids. Its
172
+ failure must cost only that feature. Wrap the call, fall back to the empty result, and say so in
173
+ the UI (`TableTopNotification` is the patterns component for it) rather than degrading silently.
174
+
175
+ Ask which one you are adding before you write the `await`. An unwrapped secondary call is a page
176
+ whose availability is the *intersection* of every scope it touches.
177
+
178
+ ## Querying and paging
179
+
180
+ Filter field paths, WQL's one-operator-per-field rule, and the two cursor-paging traps are in
181
+ [QUERY_AND_PAGING.md](QUERY_AND_PAGING.md). Read it before writing `fetchData` — every rule there
182
+ was a shipped bug first.
@@ -0,0 +1,97 @@
1
+ # Draft Template — the starting point for every dashboard page
2
+
3
+ **Start here for any Dashboard Page request, before writing a shell, provider, or router from scratch.** Pick the case below, copy its files, rename, and adapt fields/API calls/data source. Only leave this file when the request needs something no case shows, and then go to [WIX_PATTERNS_DOCS.md](../WIX_PATTERNS_DOCS.md) first — before any lookup inside `node_modules/@wix/patterns`, `index.json` included. It routes you to the package's own `Collection Toolkit.md` guide, a component doc or an example; [TABLE_STATE.md](TABLE_STATE.md) and MCP lookups come after it.
4
+
5
+ Every snippet below was copied from the installed `dist/docs/*.md` and `dist/dts-bundle/*.d.ts`, not from memory — confirm props against your own installed version before deviating.
6
+
7
+ ## Which case matches the request?
8
+
9
+ | The request needs… | Case | Router? |
10
+ | --- | --- | --- |
11
+ | A list/report whose rows are read-only — no create/edit form | **A — Collection + read-only detail** | Yes |
12
+ | A list **and** create/edit for each record (no separate app-settings area) | **B — Collection + Entity** | Yes |
13
+ | Only app-wide settings/config — no list at all | **C — Settings only** | No |
14
+ | A list, create/edit, **and** an app-settings area, all in one extension | **D — Collection + Entity + Settings** | Yes |
15
+
16
+ Don't default to D because it's the most complete — [Step 4c's checklist](../../SKILL.md#step-4c-ux-completeness-self-audit) doesn't ask for a settings or entity page unless the request needs one. If unsure between B and D, re-read the prompt for "settings," "configure," "preferences" — their absence means B.
17
+
18
+ ## Then: what `fetchData` calls
19
+
20
+ Case tells you how many pages. This tells you only what `fetchData` calls — the page itself is
21
+ [DRAFT_TEMPLATE_COLLECTION.md](DRAFT_TEMPLATE_COLLECTION.md) either way:
22
+
23
+ | The rows come from | `fetchData` calls |
24
+ | --- | --- |
25
+ | A vertical SDK (`@wix/bookings`, `@wix/ecom`, …) or any API you call yourself | that SDK's own query method — [DATA_SOURCES.md](DATA_SOURCES.md) |
26
+ | A **CMS collection** — one your Data Collection extension ships, or an existing site collection | `@wix/data` `items.query()` — [WIX_DATA.md](../data-collection/WIX_DATA.md) |
27
+
28
+ A CMS collection is not a different template, just a different call inside the same one: you write
29
+ `fetchData`, the filters and the columns for both.
30
+
31
+ **Cases B and D both need a router** — their entry file, app shell, and entity page are in [DRAFT_TEMPLATE_ROUTER.md](DRAFT_TEMPLATE_ROUTER.md). The collection and settings files are shared by every case that uses them, B and D included; the router file links back rather than repeating them.
32
+
33
+ ## File layout
34
+
35
+ ```
36
+ src/extensions/dashboard/pages/{feature}/
37
+ {feature}.extension.ts # single wix generate scaffold — always exactly one route registered here
38
+ {feature}.tsx # entry — Case C: Section 1 below. Cases A/B/D: DRAFT_TEMPLATE_ROUTER.md
39
+ {Feature}App.tsx # Case A/B/D only — see DRAFT_TEMPLATE_ROUTER.md
40
+ {Feature}CollectionPage.tsx # Case A, B, D — see DRAFT_TEMPLATE_COLLECTION.md
41
+ {Feature}DetailPage.tsx # Case A only — read-only detail route, DRAFT_TEMPLATE_ROUTER.md §4
42
+ {Feature}EntityPage.tsx # Case B, D only — see DRAFT_TEMPLATE_ROUTER.md
43
+ {Feature}SettingsPage.tsx # Case C, D only — see DRAFT_TEMPLATE_SETTINGS.md
44
+ {feature}-api.ts # fetch/save calls — keep these out of the components
45
+ ```
46
+
47
+ Scaffold with a single call regardless of case — this is always one extension:
48
+
49
+ ```bash
50
+ wix generate --params '{"extensionType":"DASHBOARD_PAGE","title":"<title>","route":"<route>"}'
51
+ ```
52
+
53
+ ## 1. Entry — Case C only (router-free, no location plumbing)
54
+
55
+ Case C has one page and no rows to open, so it needs no router and no manual `location` wiring. **Cases A, B and D all route** — a row opens a page of its own in every one of them — so their entry file is [DRAFT_TEMPLATE_ROUTER.md](DRAFT_TEMPLATE_ROUTER.md) §1:
56
+
57
+ ```tsx
58
+ // {feature}.tsx — Case C
59
+ import type { FC } from 'react';
60
+ import { withDashboard } from '@wix/patterns';
61
+ import { WixPatternsProvider } from '@wix/patterns/provider';
62
+ import { WixDesignSystemProvider } from '@wix/design-system';
63
+ import '@wix/design-system/styles.global.css';
64
+ import { {Feature}SettingsPage } from './{Feature}SettingsPage'; // DRAFT_TEMPLATE_SETTINGS.md
65
+
66
+ const Page: FC = () => (
67
+ <WixDesignSystemProvider>
68
+ <WixPatternsProvider>
69
+ <{Feature}SettingsPage />
70
+ </WixPatternsProvider>
71
+ </WixDesignSystemProvider>
72
+ );
73
+
74
+ export default withDashboard(Page);
75
+ ```
76
+
77
+ Cases A, B and D differ — they need `location` supplied manually for `PatternsReactRouter`. See [DRAFT_TEMPLATE_ROUTER.md](DRAFT_TEMPLATE_ROUTER.md) rather than adding that plumbing here; it's dead code without a router underneath it.
78
+
79
+ ## 2. Collection page — Case A, B, D
80
+
81
+ In [DRAFT_TEMPLATE_COLLECTION.md](DRAFT_TEMPLATE_COLLECTION.md) — `useTableCollection`, a working
82
+ filter, the four placeholder states, and a row that opens. Shared by Cases A, B and D. No
83
+ `SummaryBar` unless the request asked for one, and the drill-in is always a route — never a side
84
+ panel.
85
+
86
+ ## 3. Settings page — Case C, D
87
+
88
+ In [DRAFT_TEMPLATE_SETTINGS.md](DRAFT_TEMPLATE_SETTINGS.md) — `useSettingsPage` + `useForm`,
89
+ with the same field-controller patterns as the entity page.
90
+
91
+ ## What to change vs. keep, per case
92
+
93
+ | Change per request | Keep as shown |
94
+ | --- | --- |
95
+ | Feature/entity names, fields, columns, API calls in `{feature}-api.ts` | Which case (A/B/C/D) — don't over-build D for a request that only named a list |
96
+ | Detail fields, form field types, columns | The drill-in being a route, and the absence of a `SummaryBar` the request never asked for |
97
+ | Real data source (SDK-first per [SDK-First Rule](../../SKILL.md#sdk-first-rule-existing-wix-app-data-is-never-cms)) vs CMS | B/D wiring (provider/router nesting, `parentPath`, `location`): [DRAFT_TEMPLATE_ROUTER.md](DRAFT_TEMPLATE_ROUTER.md) |
@@ -0,0 +1,184 @@
1
+ # Draft Template — Collection page (Cases A, B and D)
2
+
3
+ > Pick your case in [DRAFT_TEMPLATE.md](DRAFT_TEMPLATE.md) first. This page is shared by A, B
4
+ > and D.
5
+
6
+ > **You write `fetchData`, the filters and the columns.** This holds whatever the rows are: for a
7
+ > CMS collection `fetchData` calls `@wix/data` `items.query()`
8
+ > ([WIX_DATA.md](../data-collection/WIX_DATA.md)) and nothing else on this page changes.
9
+
10
+ ## Two rules this skeleton encodes, so read them before editing it
11
+
12
+ **Every row opens a page of its own, never a panel.** `onRowClick` navigates —
13
+ `navigateToEntityPage` to an `EntityPage` route when the record is editable, or to a read-only
14
+ detail route when the page is display-only ([DRAFT_TEMPLATE_ROUTER.md § 4](DRAFT_TEMPLATE_ROUTER.md#4-read-only-detail-route--case-a)).
15
+ A WDS `SidePanel` is not the drill-in: in Cairo it is the host for a page's own side panels — the
16
+ fields card's "Manage fields", a table's column panel — and `example-bm` uses it as a row drill-in
17
+ in exactly nothing. Every collection example there navigates.
18
+
19
+ **No `SummaryBar` unless the request asked for one.** Not "unless the page seems to want one" —
20
+ unless the prompt named a total, a count, or a "how many / how much" figure. It is absent from this
21
+ skeleton on purpose; adding one uninvited pushes the rows down the page and puts a number on screen
22
+ nobody has to be right about. When you do add one, wire it from
23
+ [SKILL.md § Step 2](../../SKILL.md) — no `SummaryBar` unless the request asked for one.
24
+
25
+ ## The collection page
26
+
27
+ This is the file [Step 4c's UX Completeness Self-Audit](../../SKILL.md#step-4c-ux-completeness-self-audit)
28
+ is about: a working filter, named filters, and a row that opens.
29
+
30
+ ```tsx
31
+ // {Feature}CollectionPage.tsx — Case A, B, D
32
+ import type { FC } from 'react';
33
+ import {
34
+ CollectionEmptyState, CollectionErrorState, CollectionNoResultsState, CollectionSearch, CollectionToolbarFilters,
35
+ MultiSelectCheckboxFilter, Table, stringsArrayFilter,
36
+ useStaticListFilterCollection, useTableCollection,
37
+ } from '@wix/patterns';
38
+ import { CollectionPage } from '@wix/patterns/page';
39
+ import { usePatternsNavigate } from '@wix/patterns/router';
40
+ import { fetch{Feature}Page, type {Entity}Row } from './{feature}-api';
41
+
42
+ const STATUS_LABELS: Record<string, string> = { ACTIVE: 'Active', ARCHIVED: 'Archived' };
43
+ // Filter factories are module-level: one instance per page, not per render.
44
+ const statusFilter = stringsArrayFilter<'ACTIVE' | 'ARCHIVED'>({
45
+ // `name` is NOT the visible title — it feeds a11y legends, BI grouping and dataHooks.
46
+ // The title comes from the label props in the JSX below; the package's own
47
+ // `Collection Toolkit.md` guide has the prop model.
48
+ name: 'Status',
49
+ itemKey: (item) => item,
50
+ itemName: (item) => STATUS_LABELS[item] ?? item,
51
+ });
52
+
53
+ export const {Feature}CollectionPage: FC = () => {
54
+ const { navigateToEntityPage } = usePatternsNavigate<{Entity}Row>();
55
+
56
+ const state = useTableCollection<{Entity}Row, { status: typeof statusFilter }>({
57
+ queryName: '{feature}',
58
+ paginationMode: 'cursor', // 'offset' if your API pages by offset
59
+ itemKey: (item) => item.id,
60
+ itemName: (item) => item.name,
61
+ filters: { status: statusFilter },
62
+ // Every declared filter AND the search box are read here — one that never
63
+ // reaches the query renders fine and narrows nothing.
64
+ fetchData: async (query) =>
65
+ fetch{Feature}Page({
66
+ limit: query.limit,
67
+ cursor: query.cursor ?? undefined, // return `cursor: next || undefined` — key always
68
+ // present, '' walks pages forever
69
+ search: query.search,
70
+ filters: { status: query.filters.status },
71
+ }),
72
+ // fetchTotal is for a requested aggregate, so it is commented out here. Uncommented, it
73
+ // must RESOLVE A NUMBER from an endpoint that counts, and it OVERRIDES the fallback to the
74
+ // loaded-rows count — so a wrong one reports 0 beside a full table while tsc stays green.
75
+ // Read QUERY_AND_PAGING.md, "What fetchTotal is allowed to call", before uncommenting.
76
+ // fetchTotal: async (query) => count{Feature}({ search: query.search, filters: query.filters }),
77
+ fetchErrorMessage: ({ err }) => (err instanceof Error ? err.message : 'Failed to load {feature}'),
78
+ });
79
+
80
+ const statusOptions = useStaticListFilterCollection(statusFilter, ['ACTIVE', 'ARCHIVED']);
81
+
82
+ // Nothing here reads `state` directly: the Table observes it internally. The moment you
83
+ // DO derive a number from it in this component — a header figure, a badge, a requested
84
+ // SummaryBar — it is MobX, and a plain read is computed once while the collection is still
85
+ // empty and never recomputed. Wrap it in `useSelector` and select a primitive: TABLE_STATE.md.
86
+
87
+ return (
88
+ <CollectionPage>
89
+ <CollectionPage.Header title={{ text: '{Page Title}' }} />
90
+ <CollectionPage.Content>
91
+ <Table
92
+ state={state}
93
+ // `search` defaults to ON, so omitting it ships a box that reaches no
94
+ // query. Wire it AND read query.search above. If the API has no
95
+ // free-text filter, resolve the term to one it does support.
96
+ search={<CollectionSearch placeholder="Search {feature}" />}
97
+ filters={
98
+ <CollectionToolbarFilters>
99
+ {/* BOTH label props, same string, and never accordionItemProps.title.
100
+ The resolution model is the package's own `Collection Toolkit.md` guide. */}
101
+ <MultiSelectCheckboxFilter
102
+ filter={statusFilter} collection={statusOptions}
103
+ toolbarItemProps={{ label: 'Status' }}
104
+ accordionItemProps={{ label: 'Status' }}
105
+ />
106
+ </CollectionToolbarFilters>
107
+ }
108
+ // Three distinct messages. Without errorState a failed query looks
109
+ // exactly like a slow one: skeletons, forever.
110
+ emptyState={<CollectionEmptyState title="No {feature} yet" />}
111
+ // Name what excluded the rows — a seeded default or a missing scope
112
+ // looks exactly like "nothing matched", and only one is actionable.
113
+ noResultsState={<CollectionNoResultsState title="No {feature} match" subtitle="…" />}
114
+ // errorState is a RENDER FUNCTION: (err, { retry }) => ReactElement.
115
+ errorState={(err, { retry }) => (
116
+ <CollectionErrorState
117
+ title="Couldn't load {feature}"
118
+ subtitle={String(err)}
119
+ action={{ text: 'Retry', onClick: retry }}
120
+ />
121
+ )}
122
+ // The drill-in. Editable record → the EntityPage route (`/${item.id}`).
123
+ // Display-only → the read-only route, DRAFT_TEMPLATE_ROUTER.md §4. Either way a
124
+ // route, and passing `entity` lets the target title itself before its fetch lands.
125
+ onRowClick={(item) => navigateToEntityPage({ path: `/${item.id}`, entity: item })}
126
+ columns={[
127
+ // One column per field the prompt names; verify each source field —
128
+ // DATA_SOURCES.md, "A column must show what its header promises."
129
+ { id: 'name', title: 'Name', render: (item) => item.name },
130
+ ]}
131
+ />
132
+ </CollectionPage.Content>
133
+ </CollectionPage>
134
+ );
135
+ };
136
+ ```
137
+
138
+ ## Turning `query.search` into a query
139
+
140
+ `{feature}-api.ts` turns one term into a filter over *several* fields — an OR. **This is where
141
+ search ships broken**: it renders, it reaches the query, and still returns every row, so nothing
142
+ looks wrong until someone counts results.
143
+
144
+ ### A CMS collection — `@wix/data`
145
+
146
+ `or()` combines two filters; it is **not** a condition. Called on a query or filter holding no
147
+ condition yet it contributes an empty `{}` branch, and `{} OR x` matches the whole collection. Seed
148
+ the filter with the first field, `or()` the rest onto it, then `and()` it onto the query — which is
149
+ also what keeps the facet filters applying to *every* branch:
150
+
151
+ ```ts
152
+ // SHORT_TEXT / LONG_TEXT fields only: `contains` on a number, date or
153
+ // reference field is not a narrower match, it is no match.
154
+ const searchFilter = (term: string, fields: string[]) =>
155
+ fields.map((f) => items.filter().contains(f, term)).reduce((acc, f) => acc.or(f));
156
+
157
+ let query = items.query(COLLECTION_ID).eq('status', status).limit(limit);
158
+ const term = search?.trim();
159
+ if (term) query = query.and(searchFilter(term, ['companyName', 'contactEmail']));
160
+
161
+ // ❌ or() onto a query holding no condition — empty $or branch, every row matches
162
+ items.query(ID).or(items.filter().contains('a', t)).or(items.filter().contains('b', t));
163
+ // ❌ or() onto the query itself — `status` survives only on the first branch
164
+ items.query(ID).eq('status', s).contains('a', t).or(items.filter().contains('b', t));
165
+ ```
166
+
167
+ ### A vertical SDK — `@wix/bookings`, `@wix/ecom`, …
168
+
169
+ No shared free-text operator; the shape differs per endpoint. Read its *Supported Filters* page
170
+ ([QUERY_AND_PAGING.md](QUERY_AND_PAGING.md#the-filterable-fields-are-a-closed-list-published-per-endpoint)),
171
+ then `$or` one clause per identity field it lists. Never route the term to a single field by its
172
+ shape — a measured run shipped this, and one branch is always dead:
173
+
174
+ ```ts
175
+ query = term.includes('@')
176
+ ? query.startsWith('loginEmail', term)
177
+ : query.startsWith('contact.firstName', term); // a surname matches nothing, ever
178
+ ```
179
+
180
+ `startsWith` is prefix-only too — "Smith" never finds "John Smith" — so prefer the containment
181
+ operator when the endpoint declares one, and say which you used in `noResultsState`.
182
+
183
+ **Whatever the shape, prove it narrows.** Run one term you expect to hit a known row and one you
184
+ expect to hit nothing, and check the row count changes for both.