@wix/agent-skills 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/README.md +5 -1
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +4 -1
  4. package/skills/wix-app/references/APP_TOOLS.md +134 -0
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +1 -1
  6. package/skills/wix-app/references/DASHBOARD_PAGE.md +0 -10
  7. package/skills/wix-app/references/DATA_COLLECTION.md +6 -4
  8. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -7
  9. package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
  10. package/skills/wix-app/references/STORES_VERSIONING.md +9 -211
  11. package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
  12. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +5 -0
  13. package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +2 -2
  14. package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +172 -0
  15. package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +138 -0
  16. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +172 -0
  17. package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +29 -0
  18. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
  19. package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +57 -0
  20. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +33 -2
  21. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +5 -3
  22. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +18 -1
  23. package/skills/wix-app/references/editor-react-component/PARTS.md +15 -2
  24. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +4 -3
  25. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +13 -9
  26. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +4 -0
  27. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
  28. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +3 -1
  29. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +4 -0
  30. package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +54 -0
  31. package/skills/wix-app/references/stores/CATEGORIES.md +22 -0
  32. package/skills/wix-app/references/stores/GET_PRODUCT.md +99 -0
  33. package/skills/wix-app/references/stores/INVENTORY.md +37 -0
  34. package/skills/wix-app/references/stores/QUERY.md +119 -0
  35. package/skills/wix-app/references/stores/WRITE.md +55 -0
  36. package/skills/wix-docs/SKILL.md +35 -3
  37. package/skills/wix-headless/SKILL.md +9 -2
  38. package/skills/wix-headless/entry/bootstrap.mjs +2 -2
  39. package/skills/wix-headless/entry/skill.md +0 -2
  40. package/skills/wix-headless/references/CAPABILITIES.md +6 -4
  41. package/skills/wix-headless/references/CONTENT.md +36 -0
  42. package/skills/wix-headless/references/DESIGN.md +54 -0
  43. package/skills/wix-headless/references/DISCOVERY.md +25 -1
  44. package/skills/wix-headless/references/FEEDBACK.md +16 -5
  45. package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
  46. package/skills/wix-headless/references/SDK_HANDOFF.md +2 -0
  47. package/skills/wix-headless/references/SEED.md +3 -1
  48. package/skills/wix-headless/references/SETUP.md +1 -1
  49. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
  50. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +42 -2
  51. package/skills/wix-headless/references/inline-recipes/setup-bookings.md +5 -1
  52. package/skills/wix-headless/references/inline-recipes/setup-forms.md +1 -1
  53. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +33 -8
  54. package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +3 -1
  55. package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +73 -0
  56. package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +38 -2
  57. package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +20 -1
  58. package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +1 -1
  59. package/skills/wix-headless/references/managed/CONNECT.md +2 -2
  60. package/skills/wix-headless/references/managed/CREATE.md +15 -1
  61. package/skills/wix-headless/references/managed/DEPLOYMENT.md +47 -0
  62. package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +8 -0
  63. package/skills/wix-headless/references/stripe/DEPLOYMENT.md +8 -0
  64. package/skills/wix-manage/SKILL.md +131 -12
  65. package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
  66. package/skills/wix-manage/references/analytics/query-site-analytics.md +66 -9
  67. package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
  68. package/skills/wix-manage/references/app-installation/install-wix-apps.md +3 -0
  69. package/skills/wix-manage/references/blog/blog-dashboard-navigation.md +56 -0
  70. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +31 -6
  71. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -1
  72. package/skills/wix-manage/references/bookings/bookings-dashboard-navigation.md +63 -0
  73. package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +6 -5
  74. package/skills/wix-manage/references/bookings/create-course-service.md +30 -5
  75. package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +85 -42
  76. package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +44 -0
  77. package/skills/wix-manage/references/cms/cms-data-items-crud.md +31 -3
  78. package/skills/wix-manage/references/cms/cms-publishing-flow.md +287 -0
  79. package/skills/wix-manage/references/cms/cms-schema-management.md +33 -1
  80. package/skills/wix-manage/references/contacts/contacts-dashboard-navigation.md +46 -0
  81. package/skills/wix-manage/references/contacts/create-a-contact.md +82 -0
  82. package/skills/wix-manage/references/contacts/update-a-contact.md +119 -0
  83. package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +82 -0
  84. package/skills/wix-manage/references/dashboard-navigation/routes.json +1733 -0
  85. package/skills/wix-manage/references/domains/domains-dashboard-navigation.md +32 -0
  86. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +4 -4
  87. package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
  88. package/skills/wix-manage/references/ecommerce/gift-cards/ecom-gift-cards-goal-sell-gift-cards.md +338 -0
  89. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-discount-rule.md +42 -78
  90. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-bundle-and-save.md +1 -1
  91. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-stock-mover.md +1 -1
  92. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-upsell-boost.md +1 -1
  93. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +90 -92
  94. package/skills/wix-manage/references/events/create-wix-event.md +176 -0
  95. package/skills/wix-manage/references/events/manage-wix-events.md +174 -0
  96. package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +44 -0
  97. package/skills/wix-manage/references/get-paid/get-paid-dashboard-navigation.md +52 -0
  98. package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +30 -7
  99. package/skills/wix-manage/references/google-ads/billing-and-payment.md +80 -0
  100. package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +212 -0
  101. package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +110 -0
  102. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +25 -0
  103. package/skills/wix-manage/references/google-ads/install-and-create-account.md +155 -0
  104. package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +63 -0
  105. package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +155 -0
  106. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +225 -144
  107. package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +19 -10
  108. package/skills/wix-manage/references/marketing/marketing-dashboard-navigation.md +52 -0
  109. package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +99 -1
  110. package/skills/wix-manage/references/pricing-plans/pricing-plans-dashboard-navigation.md +45 -0
  111. package/skills/wix-manage/references/restaurants/restaurants-dashboard-navigation.md +68 -0
  112. package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +94 -125
  113. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +48 -9
  114. package/skills/wix-manage/references/site-properties/site-properties-dashboard-navigation.md +31 -0
  115. package/skills/wix-manage/references/sites/create-headless-site.md +52 -0
  116. package/skills/wix-manage/references/sites/create-site-from-template.md +2 -25
  117. package/skills/wix-manage/references/sites/site-import.md +243 -0
  118. package/skills/wix-manage/references/sites/sites-dashboard-navigation.md +29 -0
  119. package/skills/wix-manage/references/stores/add-store-pages-to-site.md +17 -1
  120. package/skills/wix-manage/references/stores/create-product-from-image.md +8 -6
  121. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +16 -10
  122. package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +26 -8
  123. package/skills/wix-manage/references/stores/stores-dashboard-navigation.md +65 -0
  124. package/skills/wix-manage/references/stores/update-product-with-options.md +39 -7
  125. package/skills/wix-replatform/.publish-manifest.json +8 -0
  126. package/skills/wix-replatform/SKILL.md +693 -0
  127. package/skills/wix-replatform/lib/artifact-freshness.js +215 -0
  128. package/skills/wix-replatform/lib/completion-report.js +200 -0
  129. package/skills/wix-replatform/lib/config-env.js +59 -0
  130. package/skills/wix-replatform/lib/execution-manifest.js +185 -0
  131. package/skills/wix-replatform/lib/execution-state.js +173 -0
  132. package/skills/wix-replatform/lib/import-recovery.js +313 -0
  133. package/skills/wix-replatform/lib/local-state.js +642 -0
  134. package/skills/wix-replatform/lib/orchestration-preflight.js +143 -0
  135. package/skills/wix-replatform/lib/orchestration-router.js +122 -0
  136. package/skills/wix-replatform/lib/orchestration-state.js +455 -0
  137. package/skills/wix-replatform/lib/progress-log.js +224 -0
  138. package/skills/wix-replatform/lib/progress-log.sh +140 -0
  139. package/skills/wix-replatform/lib/url-preservation-state.js +391 -0
  140. package/skills/wix-replatform/resources/rp-discovery/SKILL.md +184 -0
  141. package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +529 -0
  142. package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +316 -0
  143. package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +64 -0
  144. package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +1114 -0
  145. package/skills/wix-replatform/resources/rp-mapper/SKILL.md +430 -0
  146. package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +217 -0
  147. package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +148 -0
  148. package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +378 -0
  149. package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +183 -0
  150. package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +478 -0
  151. package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +136 -0
  152. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
  153. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +310 -0
  154. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +1081 -0
  155. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +618 -0
  156. package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +949 -0
  157. package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +196 -0
  158. package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +66 -0
  159. package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +60 -0
  160. package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +95 -0
  161. package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +82 -0
  162. package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +256 -0
  163. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +249 -0
  164. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +444 -0
  165. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +774 -0
  166. package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +71 -0
  167. package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +632 -0
  168. package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +330 -0
  169. package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +21 -0
  170. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -0
  171. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +37 -0
  172. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +37 -0
  173. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +39 -0
  174. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +35 -0
  175. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +14 -0
  176. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +35 -0
  177. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +36 -0
  178. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +35 -0
  179. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +14 -0
  180. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +131 -0
  181. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +37 -0
  182. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +37 -0
  183. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +21 -0
  184. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +37 -0
  185. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +37 -0
  186. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +97 -0
  187. package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +528 -0
  188. package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -0
  189. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +38 -0
  190. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +37 -0
  191. package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -0
  192. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +37 -0
  193. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +53 -0
  194. package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +84 -0
  195. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +25 -0
  196. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +37 -0
  197. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +37 -0
  198. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +38 -0
  199. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +37 -0
  200. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +90 -0
  201. package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +64 -0
  202. package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +141 -0
  203. package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +384 -0
  204. package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +260 -0
  205. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +238 -0
  206. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +237 -0
  207. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +238 -0
  208. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +2219 -0
  209. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +31 -0
  210. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +100 -0
  211. package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +107 -0
  212. package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +344 -0
  213. package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +250 -0
  214. package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1927 -0
  215. package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +83 -0
  216. package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +141 -0
  217. package/skills/wix-replatform/scripts/artifact-freshness.js +76 -0
  218. package/skills/wix-replatform/scripts/execution-manifest-validate.js +43 -0
  219. package/skills/wix-replatform/scripts/execution-state-prepare.js +128 -0
  220. package/skills/wix-replatform/scripts/orchestration-preflight.js +48 -0
  221. package/skills/wix-replatform/scripts/orchestration-route.js +46 -0
  222. package/skills/wix-replatform/scripts/orchestration-state.js +245 -0
  223. package/skills/wix-vibe-headless/SKILL.md +54 -25
  224. package/skills/wix-vibe-headless/install/deploy.cjs +95 -0
  225. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +34 -0
  226. package/skills/wix-vibe-headless/platforms/README.md +26 -0
  227. package/skills/wix-vibe-headless/platforms/base44.md +177 -0
  228. package/skills/wix-vibe-headless/platforms/generic.md +122 -0
  229. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +230 -119
  230. package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +43 -0
  231. package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +25 -0
  232. package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +15 -0
  233. package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +35 -0
  234. package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +38 -0
  235. package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +40 -0
  236. package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +54 -0
  237. package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +65 -0
  238. package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +50 -0
  239. package/skills/wix-vibe-headless/references/blog/seed/SEED.md +103 -0
  240. package/skills/wix-vibe-headless/references/blog/seed/seed-blog.js +270 -0
  241. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +260 -145
  242. package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +65 -0
  243. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +47 -0
  244. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +13 -0
  245. package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +126 -0
  246. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +108 -0
  247. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +58 -0
  248. package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +95 -0
  249. package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +94 -0
  250. package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +89 -0
  251. package/skills/wix-vibe-headless/references/bookings/{wix-bookings-checkout.js → app/rest/wix-bookings-checkout.js} +1 -1
  252. package/skills/wix-vibe-headless/references/bookings/{wix-bookings-services.js → app/rest/wix-bookings-services.js} +90 -12
  253. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +117 -0
  254. package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.js +333 -0
  255. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +169 -147
  256. package/skills/wix-vibe-headless/references/cms/app/collection.config.js +31 -0
  257. package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +18 -0
  258. package/skills/wix-vibe-headless/references/cms/{wix-cms.js → app/rest/wix-cms.js} +47 -2
  259. package/skills/wix-vibe-headless/references/cms/seed/SEED.md +145 -0
  260. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +228 -131
  261. package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +23 -0
  262. package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +43 -0
  263. package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +13 -0
  264. package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +29 -0
  265. package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +57 -0
  266. package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +78 -0
  267. package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +27 -0
  268. package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +54 -0
  269. package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +40 -0
  270. package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +81 -0
  271. package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +48 -0
  272. package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +36 -0
  273. package/skills/wix-vibe-headless/references/events/{wix-events-browse.js → app/rest/wix-events-browse.js} +3 -2
  274. package/skills/wix-vibe-headless/references/events/seed/SEED.md +107 -0
  275. package/skills/wix-vibe-headless/references/events/seed/seed-events.js +251 -0
  276. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +276 -188
  277. package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +101 -0
  278. package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +33 -0
  279. package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +21 -0
  280. package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +29 -0
  281. package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +54 -0
  282. package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +77 -0
  283. package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +36 -0
  284. package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +32 -0
  285. package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +35 -0
  286. package/skills/wix-vibe-headless/references/members/{wix-members-auth.js → app/rest/wix-members-auth.js} +6 -3
  287. package/skills/wix-vibe-headless/references/members/install/Register.jsx +22 -0
  288. package/skills/wix-vibe-headless/references/members/seed/SEED.md +22 -0
  289. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +233 -104
  290. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +31 -0
  291. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +15 -0
  292. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +39 -0
  293. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +15 -0
  294. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +29 -0
  295. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +35 -0
  296. package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +27 -0
  297. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +25 -0
  298. package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +39 -0
  299. package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +27 -0
  300. package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +60 -0
  301. package/skills/wix-vibe-headless/references/portfolio/{wix-portfolio.js → app/rest/wix-portfolio.js} +84 -55
  302. package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +94 -0
  303. package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.js +236 -0
  304. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +240 -117
  305. package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +35 -0
  306. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +48 -0
  307. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +16 -0
  308. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +35 -0
  309. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +25 -0
  310. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +28 -0
  311. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +30 -0
  312. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +30 -0
  313. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +53 -0
  314. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +28 -0
  315. package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +86 -0
  316. package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.js +251 -0
  317. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +248 -124
  318. package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +81 -0
  319. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +71 -0
  320. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +43 -0
  321. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +21 -0
  322. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +60 -0
  323. package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +63 -0
  324. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +32 -0
  325. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +73 -0
  326. package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +28 -0
  327. package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +102 -0
  328. package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +180 -0
  329. package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.js +452 -0
  330. package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +56 -0
  331. package/skills/wix-vibe-headless/references/shared/{wix-client.js → app/rest/wix-client.js} +6 -8
  332. package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +6 -0
  333. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +263 -148
  334. package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +20 -0
  335. package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +150 -0
  336. package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +167 -0
  337. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +51 -0
  338. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +54 -0
  339. package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +119 -0
  340. package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +71 -0
  341. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +109 -0
  342. package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +98 -0
  343. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +27 -0
  344. package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +139 -0
  345. package/skills/wix-vibe-headless/references/storefront/app/pages/Shop.jsx +75 -0
  346. package/skills/wix-vibe-headless/references/storefront/{wix-store-cart.js → app/rest/wix-store-cart.js} +1 -1
  347. package/skills/wix-vibe-headless/references/storefront/{wix-store-catalog.js → app/rest/wix-store-catalog.js} +25 -2
  348. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +111 -0
  349. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +299 -0
  350. /package/skills/wix-vibe-headless/references/blog/{wix-blog.js → app/rest/wix-blog.js} +0 -0
  351. /package/skills/wix-vibe-headless/references/events/{wix-events-registration.js → app/rest/wix-events-registration.js} +0 -0
  352. /package/skills/wix-vibe-headless/references/pricing-plans/{wix-pricing-plans.js → app/rest/wix-pricing-plans.js} +0 -0
  353. /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-menu.js → app/rest/wix-restaurants-menu.js} +0 -0
  354. /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-ordering.js → app/rest/wix-restaurants-ordering.js} +0 -0
  355. /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-reservations.js → app/rest/wix-restaurants-reservations.js} +0 -0
@@ -1,154 +1,176 @@
1
+ # Wix CMS — client utils (you build the UI)
1
2
 
2
- # Wix CMS Skill
3
+ Unlike the other verticals, CMS ships **no UI**. A CMS is schema-driven — every collection is
4
+ different — so there are no meaningful "list/detail" components to hand you. You **build the UI
5
+ yourself** (list, detail, home, forms) in your own framework and design tokens, calling the shipped
6
+ **utils**. Everything talks to Wix directly over the public `WIX_CLIENT_ID` (anonymous visitor token)
7
+ using the official Wix Data endpoints — never hand-build a Wix Data URL, never mock items.
3
8
 
4
- > **Source files (in this skill):** the shared transport `references/shared/wix-client.js` and this vertical's `references/cms/wix-cms.js`. Copy **both** into your app's `src/rest/` side by side — the helper does `import { wixApiRequest } from "./wix-client.js"`, so they must land in the same folder.
9
+ ## What ships (utils only)
5
10
 
6
- Builds a real, client-only Wix CMS-backed app. The browser talks to Wix Data directly
7
- over a public `WIX_CLIENT_ID` to read and write items in the site's data collections.
8
- Never mock data; never hand-build API URLs — always go through the helpers, which call
9
- the official Wix Data endpoints.
10
-
11
- ## When to use
12
- - User wants to display Wix CMS / Content Manager content (a collection of posts,
13
- tutorials, recipes, team members, listings, FAQs, etc.) on a site.
14
- - Replacing placeholder/mock content with live Wix Data items.
15
- - Adding list pages, detail pages, category/tag filtering, or free-text search over an
16
- existing Wix data collection.
17
- - Wiring a public form (contact, RSVP, review, signup) that writes a row into a collection.
11
+ | file | what it is |
12
+ |---|---|
13
+ | `rest/wix-cms.js` | Wix Data helpers over the official endpoints: `queryDataItems`, `getDataItem`, `getDataItemBy`, `countDataItems`, `insertDataItem`, `updateDataItem`, `removeDataItem`. |
14
+ | `lib/wixImage.js` | `wixImage(uri)` — converts a `wix:image://…` media field into a renderable URL (passes `https://` / `//` through). |
15
+ | `collection.config.js` | Optional one-file mapping: `COLLECTION_ID` (your collection's **name**, not a GUID) + `FIELDS` (map `title`/`image`/`summary`/`body`/`date`/`slug` to your field keys). Keeps field mapping in one place; skip it and pass field keys inline if you prefer. |
16
+ | `wix-config.js` *(shared)* | Set `WIX_CLIENT_ID` + `WIX_METASITE_ID` here (the one place both ids live). |
17
+ | `WixManageBanner` *(shared)* | Dev-only manage banner — mount it in your Layout (see the platform doc's "Done" step). |
18
18
 
19
19
  ## Prerequisites
20
- 1. A Wix site with **a data collection already created and populated** (this skill does
21
- NOT provision collections — it reads/writes existing ones). The merchant creates
22
- collections, fields, and items in the Wix dashboard (CMS / Content Manager).
23
- 2. The site's public headless **`WIX_CLIENT_ID`**, provided in the handoff prompt (the
24
- Wix Business Manager surfaces a copyable prompt with the id filled in — see
25
- the router `SKILL.md`). Paste it into `src/rest/wix-client.js` in place of the placeholder. It is
26
- a buyer-facing credential (it only mints anonymous visitor tokens), **not** a secret,
27
- so hardcoding/committing it is fine.
28
- 3. **Collection permissions** must match what you're doing. This skill runs as an
29
- anonymous visitor, so a call only works if the collection grants that action to
30
- "Anyone": Read for listing content, Insert for a public form. Update/Delete are
31
- almost always admin- or author-only and will fail for a visitor. The site owner sets
32
- these in the Wix dashboard (CMS → collection → Permissions). This is a **separate Wix
33
- setup step the user completes** — out of this skill's scope. If a read/insert fails
34
- with a permission error (HTTP 403) before that's set, that's expected; flag it and
35
- continue.
36
- 4. You need each collection's **collection ID** (its name, e.g. `Tutorials`) and its
37
- **field keys** (e.g. `title`, `publishDate`). Read field keys off a fetched item, or
38
- from the collection schema (see "Beyond the snippets").
39
-
40
- ## The API (copy as-is; do not re-derive it)
41
- This skill ships only the REST layer — no UI components. Build the UI however the project
42
- wants; wire it to these two snippets. Copy them into the app (e.g. `src/api/`) and only
43
- adjust import paths:
44
- - `src/rest/wix-client.js` — visitor-token mint/refresh + transport. Set `WIX_CLIENT_ID`
45
- to the id from the prompt (replace the `<YOUR-CLIENT-ID>` placeholder). The visitor
46
- refresh token is persisted to localStorage; do not re-mint anonymously per load.
47
- - `src/rest/wix-cms.js` — exports:
48
- - **Read:** `queryDataItems`, `getDataItem`, `getDataItemBy`, `countDataItems`
49
- - **Write:** `insertDataItem`, `updateDataItem`, `removeDataItem`
50
-
51
- The Data Item shape, the per-collection **permissions model**, and the **filter/sort
52
- syntax** are documented as JSDoc comments at the top of `wix-cms.js`. Read them before
53
- building the UI — read helpers return the item's flat `data` payload (which always
54
- includes `_id`), and writes are bound by collection permissions.
55
-
56
- ## How to wire it (UI is the project's choice)
57
- - **Content list** — `queryDataItems(collectionId, { filter?, sort?, limit?, cursor? })`
58
- for the listing; render fields directly off each returned item (`item.title`, etc.).
59
- Pass the returned `nextCursor` back as `cursor` to load the next page. Define
60
- `filter`/`sort` on the first request only — cursor follow-ups reuse the original query.
61
- - **Detail page** — route by the item's `_id` and call `getDataItem(collectionId, itemId)`;
62
- returns null on miss → show a not-found state, never invent an item. For human-readable
63
- URLs, add a slug-like field to the collection and route via
64
- `getDataItemBy(collectionId, "slug", slugFromUrl)`.
65
- - **Filter & search** — pass a `filter` to `queryDataItems` using the operators documented
66
- in `wix-cms.js` (`$eq`, `$in`, `$gte`, `$startsWith`, `$hasSome`, `$and`/`$or`, …). For a
67
- simple text search, `{ title: { $startsWith: term } }`; for richer free-text/fuzzy search
68
- across fields, see "Beyond the snippets" (Search Data Items).
69
- - **Public form** — on submit, `insertDataItem(collectionId, { name, email, message })`
70
- (field keys must match the collection). Requires the collection's Insert permission to be
71
- "Anyone". Show success/failure from the resolved/thrown result; never fake a success.
72
- - **Edit / delete (admin/author flows)** — `updateDataItem(collectionId, itemId, data)`
73
- (⚠ full replace — fetch + merge first to preserve other fields) and
74
- `removeDataItem(collectionId, itemId)`. These need Update/Delete granted to the caller,
75
- which visitors normally don't have — expect them to fail unless the collection is opened up.
76
- - **Empty state** — if `countDataItems(collectionId)` is 0, show an empty state telling
77
- the user to add items in their Wix dashboard. Never invent items.
78
-
79
- ## Hard rules (do not violate)
80
- - ✅ Read/write ONLY through the helpers in `wix-cms.js` (which call the official Wix Data
81
- `/wix-data/v2/items` endpoints).
82
- - ❌ Never hand-build Wix Data URLs or invent endpoint paths.
83
- - ❌ Never mock data — render live Wix Data items or the empty state.
84
- - ❌ Never invent fields, reviews, ratings, or content not present in the collection.
85
- - ✅ Set `WIX_CLIENT_ID` from the prompt's value (public client id — safe to hardcode).
86
- - ✅ Use the item's `_id` as the route key and as `itemId` for get/update/remove.
87
- - ✅ `updateDataItem` REPLACES the whole item — fetch with `getDataItem`, merge your
88
- changes, then pass the full object, or use Patch Data Item (see below) for partial edits.
89
- - ✅ Treat permission errors (HTTP 403) as a configuration step, not a code bug: tell the
90
- user which permission to grant in the dashboard. Writes throw on failure — don't swallow
91
- the error and show a fake success.
92
-
93
- ## Beyond the snippets
94
- The snippets cover the common CMS paths (list, detail, filter, count, insert, update,
95
- remove). If you hit a use case they don't cover, make the call yourself with
96
- `wixApiRequest` — but look up the exact endpoint, HTTP method, and request body in the
97
- **official Wix API reference** first; never guess:
98
- - CMS / Data Items API reference: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items.md
99
- - Data Items sample flows: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/sample-flows.md
100
- - **Partial update** (change some fields, keep the rest): Patch Data Item —
101
- https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/patch-data-item.md
102
- - **Upsert** (insert or update by id): Save Data Item —
103
- https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/save-data-item.md
104
- - **Bulk** insert/update/save/remove (many items in one call):
105
- https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items.md
106
- - **Free-text / fuzzy search** across fields: Search Data Items —
107
- https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/search-data-items.md
108
- - **Aggregations** (counts/averages grouped by a field): Aggregate Data Items —
109
- https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/aggregate-data-items.md
110
- - **Distinct values** (e.g. all categories for a filter menu): Query Distinct Values —
111
- https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-distinct-values.md
112
- - **Referenced items** (expand a reference field beyond the inline limit): Query Referenced
113
- Data Items — https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-referenced-data-items.md
114
- - **Collection schema / field keys & types**: Get Data Collection —
115
- https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/get-data-collection.md
116
- - **Member-gated & user-generated content** → the **members** vertical
117
- (`references/members/INSTRUCTIONS.md`). A collection whose permissions are `read: Anyone`,
118
- `insert: Site Member`, `update/remove: Site Member Author` gives you the classic pattern: anyone
119
- reads, only logged-in members write, and each member edits only their own. Sign the member in with
120
- custom login (on your own UI), then `insertDataItem` runs as the member and Wix stamps the item's
121
- `_owner` automatically — so a **"my items"** view is just
122
- `queryDataItems(collectionId, { filter: { _owner: <memberId> } })`, and author-only
123
- `updateDataItem`/`removeDataItem` are enforced server-side. (This skill never provisions the
124
- collection — the owner creates it with those permissions in the dashboard.)
125
- **Prefer Wix for member-generated content, and keep one feature's data and identity together.**
126
- Content that belongs to the Wix site (likes, reviews, submissions) is best kept in a Wix collection
127
- via these helpers, keyed on the Wix member's server-stamped `_owner`. What breaks is a *split*
128
- feature — the row stored in one place while the member is identified from the Wix session elsewhere
129
- (or filtered by some other `created_by`/user id): the two ids won't match, so ownership filters
130
- miss. Keep them on one side; for Wix-backed rows that's `_owner`.
131
-
132
- Keep the snippets as the default for everything they already do; reach for the API
133
- reference only for the gap.
20
+ - A Wix **data collection** as the read target, created + seeded separately (see **Seeding**) — it may
21
+ be empty at build time, so render an honest empty state until items land. This skill does **not**
22
+ provision collections.
23
+ - **Collection permissions** must grant the action you perform to the visitor: **read** (Show content
24
+ → *Everyone*) for listing/detail; **insert** only if you add a public form or member submissions;
25
+ update/delete are author/admin-only and **403 for a visitor**. The owner sets these in the dashboard
26
+ (CMS → collection → Permissions) — a separate Wix step, out of scope. A 403 before it's set is
27
+ expected: flag it and continue.
28
+
29
+ ## Build the UI from the utils
30
+ Generate whatever the app needs — a list/grid, a detail page, a home page, a submit form — with your
31
+ framework, your router, and your design tokens. Wire the data with the helpers below (the shapes are
32
+ the bug-prone part). Mount the shared `WixManageBanner` (preview-only) in your Layout. Route conventions
33
+ are yours (e.g. a list path + `/item/:slugOrId` detail).
34
+
35
+ ## Data shapes (load-bearing — keep this wiring)
36
+
37
+ ```jsx
38
+ import { queryDataItems, getDataItem, getDataItemBy, countDataItems, insertDataItem } from "@/rest/wix-cms";
39
+ import { wixImage } from "@/lib/wixImage";
40
+
41
+ // LIST — queryDataItems resolves to { items, nextCursor } (NOT a bare array). Each item is the flat
42
+ // `data` payload and always carries `_id`. Pass nextCursor back as `cursor` for the next page;
43
+ // set filter/sort on the FIRST request only (cursor follow-ups reuse them — pass only the cursor).
44
+ const { items, nextCursor } = await queryDataItems("Recipes", {
45
+ sort: [{ fieldName: "publishDate", order: "DESC" }], // array of { fieldName, order } — NOT { field: -1 }
46
+ filter: { publishDate: { $lte: { "$date": new Date().toISOString() } } }, // dates wrap as { "$date": ISO }
47
+ limit: 24,
48
+ });
49
+
50
+ // DETAIL — by `_id` (getDataItem) or a slug field (getDataItemBy); returns null on miss →
51
+ // show a not-found state, never invent an item.
52
+ const one = await getDataItemBy("Recipes", "slug", slugFromUrl);
53
+
54
+ // FILTER/SEARCH — operators: $eq $ne $gt $gte $lt $lte $in $nin $startsWith $exists $hasSome $hasAll,
55
+ // combined with $and/$or/$not. Simple text search: { title: { $startsWith: term } }.
56
+
57
+ // MULTI_REFERENCE fields are NOT inline — pass includeReferences: [{ field: "ingredients", limit: 10 }]
58
+ // to queryDataItems, then read item.<field>.
59
+
60
+ // IMAGES — a media field comes back as a `wix:image://…` URI the browser can't render. Convert every
61
+ // image with wixImage() before <img src>: <img src={wixImage(item.cover)} />. Never render one raw.
62
+
63
+ // DATES — date/datetime fields (and _createdDate/_updatedDate) come back WRAPPED: { "$date": ISO }.
64
+ // Read through the wrapper — handing the object to `new Date()` yields an Invalid Date, which reaches
65
+ // the page as the text "Invalid Date":
66
+ const when = new Date(item.publishDate?.$date ?? item.publishDate);
67
+ // Write one back in the same shape, { "$date": iso }. A FILTER accepts either that or a plain ISO string.
68
+
69
+ // PUBLIC FORM — insertDataItem("Reviews", { name, email, message }); needs Insert = "Anyone" (or members).
70
+ // Resolves to the flat inserted `data` payload (with _id); throws on failure — never fake success.
71
+
72
+ // OWNED RECORDS ("my items") — insert from the CLIENT while the member is logged in, so Wix stamps
73
+ // `_owner` with THEIR id. (An insert carrying a connector/backend token stamps the app instead, and
74
+ // "my items" then reads back empty.)
75
+ const { member } = useMember(); // from the members vertical (@/context/MemberContext)
76
+ await insertDataItem("Drawings", { title }); // member token in play → _owner = that member
77
+ const { items: mine } = await queryDataItems("Drawings", { filter: { _owner: member.id } });
78
+ // The member id lives at `member.id`: row fields carry a leading underscore (_id, _owner, _createdDate)
79
+ // while the member object uses plain `id`. Give the filter a real value — `member._id` evaluates to
80
+ // undefined, JSON.stringify drops it, and the query would match every row (or none), so the helpers
81
+ // throw first. For rows that must stay private, seed `read: SITE_MEMBER_AUTHOR` and skip the filter:
82
+ // the server scopes each read to its caller, and that keeps working when `member` is null (see below).
83
+ ```
84
+
85
+ ## Owned records (CMS × Wix members)
86
+ Runnable recipe: see **OWNED RECORDS** in the code block above. Requires the **members** vertical (it
87
+ supplies `useMember()`); the collection needs **Insert** for members. Always insert **client-side while
88
+ the member is logged in** — a backend/connector-token insert stamps `_owner` with the *app*, so "my
89
+ items" comes back empty forever.
90
+
91
+ **Decide which of these you're building — the choice is a collection permission, set at seed time:**
92
+
93
+ | goal | seed the collection with | how you read "mine" |
94
+ |---|---|---|
95
+ | public list + a personal *view* of it (e.g. a public gallery plus "my submissions") | `read: ANYONE` | `filter: { _owner: member.id }` — a **view** filter: it selects what to show, while every row stays readable by anyone |
96
+ | rows only their owner may ever see | `read: SITE_MEMBER_AUTHOR` (the **member-private** preset in `seed/SEED.md`) | query with **no filter** — the server scopes every read to the caller |
97
+
98
+ Reach for `SITE_MEMBER_AUTHOR` whenever the data is genuinely per-member: the server enforces it, and it
99
+ holds up when `useMember().member` is `null` — which is the state a logged-in member is in whenever the
100
+ Members Area app is absent (see the members vertical's "Identity vs. profile"), where a client-side id is
101
+ unavailable. For a public list **and** private rows, use **two collections** — permissions are per-collection.
102
+
103
+ ## Images in a collection
104
+ Reading one goes through `wixImage()` (see the code block). Writing one has two shapes, because
105
+ **uploading to Wix Media takes a Manage-scope credential**: `generate-file-upload-url` and
106
+ `import-file` each require `SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER`, which a member or visitor token
107
+ never carries — a client-side upload answers **403 with an HTML body**. Pick by how the image is used:
108
+
109
+ | shape | field type | reach for it when |
110
+ |---|---|---|
111
+ | **data URL in the item** — `canvas.toDataURL()`, or any base64 string, written straight into the row | `TEXT` | small images: canvases, signatures, thumbnails, prototypes. An item caps at **500 KB** and base64 adds about a third, so keep the source under ~350 KB. Wix's own visitor-upload tutorial takes this route. |
112
+ | **real Wix Media asset** — a backend route uploads with an elevated credential and returns the CDN URL for the client to store | `IMAGE` | production images: CDN delivery, `wixImage()` transforms, reuse across the site, anything past that size cap |
113
+
114
+ **On base44 the elevated route is a backend function** — it holds the credential the client lacks:
115
+ ```js
116
+ const { accessToken } = await base44.asServiceRole.connectors.getConnection("wix"); // admin-level
117
+ // → POST /site-media/v1/files/generate-upload-url, PUT the bytes to it, return the file URL
118
+ ```
119
+ That's the same Wix connector the seed step uses, and it's the supported way to reach a Manage-scope
120
+ API at runtime — a different thing from the Base44 solution kits the build rules exclude. Keep the
121
+ asset on Wix: `base44.integrations.Core.UploadFile` parks the file on Base44 instead, which splits the
122
+ source of truth away from the site.
123
+
124
+ **Authorize that function against the Wix member**, using the member token the client sends.
125
+ `base44.auth.me()` resolves the *Base44* account — you, the builder — so a function gated on it turns
126
+ real visitors away, while a `test_backend_function` run passes on your own token and reads as working.
127
+ Validate the mime type and the size there as well.
128
+
129
+ - Tutorial, data URL + elevated route: https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/feature-guides/upload-images-to-cms.md
130
+ - Generate File Upload Url: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/generate-file-upload-url.md
131
+ - Import File: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/import-file.md
132
+
133
+ ## Hard rules
134
+ - Set `WIX_CLIENT_ID` (in `wix-config`) — not the placeholder.
135
+ - Read/write **only** through the `wix-cms.js` helpers (official Wix Data endpoints) — never hand-build a URL.
136
+ - `queryDataItems` → `{ items, nextCursor }` (destructure, iterate `.items`); `sort` is `[{ fieldName, order }]`; date comparands wrap as `{ "$date": ISO }`.
137
+ - Read date fields through the wrapper — `new Date(v?.$date ?? v)`. Dates arrive as `{ "$date": ISO }` (including `_createdDate` / `_updatedDate`), and `new Date(object)` puts the text "Invalid Date" on the page. See RETRIEVAL SHAPES in `rest/wix-cms.js` for the field types that need a converter.
138
+ - Convert `wix:image://` URIs via `wixImage()` before `<img src>`.
139
+ - Upload images from a backend route holding an elevated credential, and keep a member-submitted image under the 500 KB item cap when storing it as a data URL — a client-side Wix Media upload answers 403 (see **Images in a collection**).
140
+ - Owner field is `_owner` (Wix Data v2), not `_ownerId`; the member id lives at `member.id`, so "my items" → `{ filter: { _owner: member.id } }` (see above).
141
+ - **Give every filter key a defined value** — add the key only once you hold one: `...(memberId ? { _owner: memberId } : {})`. `JSON.stringify` drops `undefined`, so an undefined comparand would match every row (`{ _owner: undefined }`) or none (`{ _owner: { $eq: undefined } }`) with no error from the server; the helpers throw so it surfaces at the call site.
142
+ - **Let the query do the scoping** (a `filter`, or `read: SITE_MEMBER_AUTHOR` for privacy) so the server returns exactly the rows to show. A wrong result means the filter or the permission needs fixing — a client-side `.filter()` over rows the browser already holds only hides the symptom.
143
+ - `updateDataItem` **replaces** the whole item — fetch + merge first (or use Patch Data Item).
144
+ - Render live Wix data or an honest empty state — never mock items or invent fields not in the collection.
145
+ - Treat a 403 as a permissions setup step (tell the user which permission to grant), not a code bug.
146
+
147
+ ## Fallback — beyond the helpers
148
+ Need something the helpers don't cover? Call it yourself with `wixApiRequest`, but look up the exact
149
+ endpoint/method/body in the official Wix reference first (or use the `wix-docs` skill) — never guess.
150
+ - Data Items API: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items.md
151
+ - Partial update (Patch): https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/patch-data-item.md
152
+ - Upsert by id (Save): https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/save-data-item.md
153
+ - Free-text search: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/search-data-items.md
154
+ - Aggregations: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/aggregate-data-items.md
155
+ - Distinct values (filter menus): https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-distinct-values.md
156
+ - Referenced items: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-referenced-data-items.md
157
+ - Collection schema / field keys: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/get-data-collection.md
158
+ - Member-gated / user-generated content → the **members** vertical (`references/members/INSTRUCTIONS.md`).
159
+
160
+ ## Seeding
161
+ Seed the collection per `seed/SEED.md` — the Wix Data v2 REST API with curl examples (create collection
162
+ + permissions, bulk-insert, verify, references, images). Needs an elevated credential; separate from
163
+ this build, run in parallel.
134
164
 
135
165
  ## Point the user to their dashboard
136
- In some cases, users need to access the Wix dashboard in order to edit the CMS content for their site. To facilitate this, provide the user with deep links directly to the relevant dashboard pages. For CMS data those pages are:
137
- - **Collections & items** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-cms` (`Dashboard → CMS`) → **Create Collection**, then open a collection to add items.
138
- - **Permissions** — no separate deep link; in the same CMS area, open the collection → **More Actions → Permissions & Privacy**. For the headless app to work anonymously, set **Show content** to *Everyone* (visitor reads) and, for a public form, **Collect content** to *Everyone* (visitor inserts). Update/Delete stay admin-only.
139
-
140
- Substitute the site's `metaSiteId` to complete the links (you have it from the handoff / `ListWixSites`). Include the in-dashboard navigation as a fallback.
141
-
142
- ## Verification checklist (before declaring done)
143
- - [ ] `WIX_CLIENT_ID` set to the prompt's value (not the `<YOUR-CLIENT-ID>` placeholder)
144
- - [ ] Visitor token persists across reload (same anonymous visitor, no re-mint per load)
145
- - [ ] `queryDataItems` returns live items; pagination via `nextCursor` loads more
146
- - [ ] Detail page uses the item's `_id` (or a slug field via `getDataItemBy`) and shows a
147
- not-found state on miss — no invented item
148
- - [ ] Filter/sort produce the expected subset (operators match the field types)
149
- - [ ] Public form `insertDataItem` succeeds only when Insert is "Anyone"; on a 403 the user
150
- is told to grant the permission — no fake success
151
- - [ ] Update is treated as a full replace (fetch + merge), so no fields are silently dropped
152
- - [ ] Empty state shown when `countDataItems` is 0
153
- - [ ] No mock data anywhere; no hand-built Wix Data URLs
154
- - [ ] Told the user at least once that they can continue setting up their content in the dashboard and provided deep links.
166
+ Substitute the site's `metaSiteId`:
167
+ - **Collections & items** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-cms` → Create Collection, then add items.
168
+ - **Permissions** — same CMS area → open the collection → More Actions → Permissions & Privacy. Read anonymously → **Show content: Everyone**; public/member form → **Collect content: Everyone/Members**. Update/Delete stay admin-only.
169
+
170
+ ## Verify
171
+ - [ ] `WIX_CLIENT_ID` set (not the placeholder); collection name + field keys correct (from the seed plan).
172
+ - [ ] List renders live items (`{ items, nextCursor }` destructured); pagination works; empty collection → honest empty state (no mock items).
173
+ - [ ] Detail resolves by slug or `_id`, with a not-found state on miss.
174
+ - [ ] Image fields render via `wixImage()` (no raw `wix:image://`).
175
+ - [ ] Any 403 surfaced to the user as a permissions step, with the dashboard deep links.
176
+ - [ ] Built "my items"? Signed in as **two different members** and confirmed each one sees their own rows and only those. Use two accounts: an owner filter can fail silently in either direction — every row, or zero rows — and both look plausible from a single account.
@@ -0,0 +1,31 @@
1
+ // collection.config.js — THE data surface. This is where you point the shipped list + detail at
2
+ // YOUR Wix CMS collection and map its field keys to the roles the UI renders. Edit this file; do
3
+ // NOT edit the components. It is the data-side equivalent of the design tokens in `index.css`: one
4
+ // place, and the whole client follows.
5
+ //
6
+ // The item shape is USER-DEFINED — the field keys below are the ones from your own seed / design
7
+ // plan for this collection. Carry that plan forward as the canonical list; don't guess keys or
8
+ // reverse-engineer them from a single fetched row.
9
+
10
+ // The collection NAME from your Wix dashboard (CMS → Content Manager), e.g. "Recipes", "Posts".
11
+ // NOT a GUID — the name is the id in Wix Data.
12
+ export const COLLECTION_ID = "<YOUR-COLLECTION>";
13
+
14
+ // Map your collection's field keys → the roles the shipped UI renders. Any role you set to null is
15
+ // skipped (the UI just omits it). `title` is the only required role.
16
+ export const FIELDS = {
17
+ title: "title", // required — card heading + detail heading
18
+ image: "image", // media field (wix:image:// or https URL) — null if the collection has none
19
+ summary: "description", // short text shown on the card
20
+ body: "content", // long HTML body shown on the detail page (rendered as HTML)
21
+ date: "publishDate", // ISO date field shown as meta + used for the default sort
22
+ slug: "slug", // human-readable field for detail URLs; null → routes fall back to _id
23
+ };
24
+
25
+ // Default list sort — an array of { fieldName, order: "ASC"|"DESC" } (Wix syntax, NOT Mongo
26
+ // { field: -1 }). null → collection/insertion order. Uses FIELDS.date when set.
27
+ export const SORT = FIELDS.date ? [{ fieldName: FIELDS.date, order: "DESC" }] : null;
28
+
29
+ // Route key for an item: the slug value when a slug field is mapped, else the item's `_id`.
30
+ // Both the card link and the detail route read this — one definition, so they can't drift.
31
+ export const itemKey = (item) => (FIELDS.slug && item?.[FIELDS.slug]) || item?._id;
@@ -0,0 +1,18 @@
1
+ // wixImage — turn a Wix CMS image field value into a URL a browser can render.
2
+ // CMS media fields come back in two shapes and only ONE renders directly in <img src>:
3
+ // • a plain `https://static.wixstatic.com/...` (or protocol-relative `//...`) URL → usable as-is
4
+ // • a Wix media URI `wix:image://v1/<mediaId>/<filename>#originWidth=…&originHeight=…` → NOT
5
+ // renderable by the browser; the `<mediaId>` segment maps to a static.wixstatic.com/media/ URL.
6
+ // Merchant-uploaded images (via the dashboard) are the `wix:image://` form; images your seed step
7
+ // wrote are usually already `https://`. This converts both so the shipped UI never shows a broken
8
+ // image. Returns null for an empty/unknown value (the UI shows a token surface instead).
9
+ export function wixImage(value) {
10
+ if (!value || typeof value !== "string") return null;
11
+ if (value.startsWith("//")) return `https:${value}`;
12
+ if (value.startsWith("http")) return value;
13
+ if (value.startsWith("wix:image://")) {
14
+ const mediaId = value.slice("wix:image://v1/".length).split("/")[0];
15
+ return mediaId ? `https://static.wixstatic.com/media/${mediaId}` : null;
16
+ }
17
+ return null;
18
+ }
@@ -12,10 +12,21 @@ import { wixApiRequest } from "./wix-client.js";
12
12
  *
13
13
  * Data Item — every read helper returns the item's `data` payload:
14
14
  * _id {string} — GUID (route key, itemId for get/update/remove),
15
- * _createdDate, _updatedDate {string} — ISO 8601 (use { "$date": "..." } in filters),
16
- * _ownerId {string}, ...fields — collection field values keyed by field key
15
+ * _createdDate, _updatedDate — dates, wrapped (see RETRIEVAL SHAPES below),
16
+ * _owner {string} — id of the member who created the row,
17
+ * ...fields — collection field values keyed by field key
17
18
  * Full reference: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/data-item-object.md
18
19
  *
20
+ * RETRIEVAL SHAPES — three field types arrive in a form the UI reads through a converter. Convert on
21
+ * read; the rest (text, number, boolean, url) come back as plain values:
22
+ * date / datetime → { "$date": "2026-05-05T00:00:00.000Z" }. Read it as
23
+ * `new Date(v?.$date ?? v)` — handing the object itself to `new Date()` produces
24
+ * an Invalid Date, which reaches the page as the text "Invalid Date". Applies to
25
+ * your own date fields AND to _createdDate / _updatedDate. Send it back the same
26
+ * way, `{ "$date": iso }`; a query FILTER accepts either that or a plain ISO string.
27
+ * image (media) → `wix:image://v1/...`. Convert with `wixImage()` from `@/lib/wixImage`.
28
+ * MULTI_REFERENCE → present once you pass `includeReferences` to queryDataItems; read `item.<field>`.
29
+ *
19
30
  * FILTERS & SORT (Wix API Query Language):
20
31
  * filter: { field: value } for equality; { field: { $op: value } } for operators:
21
32
  * $eq $ne $gt $gte $lt $lte $in $nin $startsWith $exists $isEmpty $hasSome $hasAll
@@ -24,6 +35,38 @@ import { wixApiRequest } from "./wix-client.js";
24
35
  * Full reference: https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md
25
36
  */
26
37
 
38
+ /**
39
+ * Guard: reject `undefined` values inside a filter.
40
+ *
41
+ * `JSON.stringify` DELETES undefined values, so a missing or mistyped variable doesn't error —
42
+ * it silently changes what the query matches, and the server can't flag it either because the
43
+ * key never arrives:
44
+ * { _owner: undefined } → {} → matches EVERY item
45
+ * { _owner: { $eq: undefined } } → { "_owner": {} } → matches NO item
46
+ * The bad value is still visible here, before serialization, so fail loudly instead.
47
+ *
48
+ * The classic slip: every CMS data-item field is underscore-prefixed (`_id`, `_owner`,
49
+ * `_createdDate`), but a Wix MEMBER (a different API) exposes `member.id` — so `member._id`
50
+ * reads naturally, is `undefined`, and turns "my items" into "everyone's items".
51
+ */
52
+ function assertDefinedFilterValues(filter, path = "filter") {
53
+ if (!filter || typeof filter !== "object") return;
54
+ for (const [key, value] of Object.entries(filter)) {
55
+ const at = Array.isArray(filter) ? `${path}[${key}]` : `${path}.${key}`;
56
+ if (value === undefined) {
57
+ throw new Error(
58
+ `wix-cms: ${at} is undefined. JSON.stringify drops undefined, so this query would ` +
59
+ `silently match every item (or none) instead of filtering. Pass a real value, or omit ` +
60
+ `the key entirely — e.g. \`...(memberId ? { _owner: memberId } : {})\`. ` +
61
+ `Note: Wix members expose \`member.id\`, not \`member._id\`.`,
62
+ );
63
+ }
64
+ if (value && typeof value === "object" && !(value instanceof Date)) {
65
+ assertDefinedFilterValues(value, at);
66
+ }
67
+ }
68
+ }
69
+
27
70
  /**
28
71
  * Query one page of items from a collection.
29
72
  * Reference: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-data-items.md
@@ -44,6 +87,7 @@ import { wixApiRequest } from "./wix-client.js";
44
87
  * @returns {Promise<{ items: object[], nextCursor: string|null }>} items are `data` payloads (each includes `_id`).
45
88
  */
46
89
  export async function queryDataItems(dataCollectionId, { filter, sort, limit = 100, cursor, fields, includeReferences } = {}) {
90
+ assertDefinedFilterValues(filter);
47
91
  const query = {
48
92
  ...(cursor
49
93
  ? {}
@@ -115,6 +159,7 @@ export async function getDataItemBy(dataCollectionId, fieldKey, value) {
115
159
  * @returns {Promise<number>}
116
160
  */
117
161
  export async function countDataItems(dataCollectionId, filter) {
162
+ assertDefinedFilterValues(filter);
118
163
  const res = await wixApiRequest("/wix-data/v2/items/count", {
119
164
  method: "POST",
120
165
  body: { dataCollectionId, ...(filter ? { filter } : {}) },