@wix/agent-skills 1.25.0 → 1.27.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 (812) hide show
  1. package/README.md +1 -0
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +18 -17
  4. package/skills/wix-app/references/BUSINESS_MANAGER_THEME.md +1 -2
  5. package/skills/wix-app/references/BUSINESS_MANAGER_TOKENS.md +1 -1
  6. package/skills/wix-app/references/DASHBOARD_PAGE.md +12 -12
  7. package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +3 -2
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +75 -66
  9. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
  10. package/skills/wix-app/references/data-collection/LIFECYCLE.md +6 -4
  11. package/skills/wix-headless-kit/SKILL.md +31 -14
  12. package/skills/wix-headless-kit/guides/existing-site.md +12 -5
  13. package/skills/wix-headless-kit/install/attach.mjs +55 -10
  14. package/skills/wix-headless-kit/install/check.mjs +5 -5
  15. package/skills/wix-headless-kit/install/deploy.mjs +7 -3
  16. package/skills/wix-headless-kit/install/templates.mjs +21 -17
  17. package/skills/wix-headless-templates/SKILL.md +43 -0
  18. package/skills/wix-headless-templates/blank/project/README.md +15 -0
  19. package/skills/wix-headless-templates/blank/project/astro.config.mjs +20 -0
  20. package/skills/wix-headless-templates/blank/project/package.json +34 -0
  21. package/skills/wix-headless-templates/blank/project/public/favicon.svg +9 -0
  22. package/skills/wix-headless-templates/blank/project/src/assets/astro.svg +1 -0
  23. package/skills/wix-headless-templates/blank/project/src/assets/background.svg +1 -0
  24. package/skills/wix-headless-templates/blank/project/src/assets/wix.svg +18 -0
  25. package/skills/wix-headless-templates/blank/project/src/components/Hero.astro +77 -0
  26. package/skills/wix-headless-templates/blank/project/src/components/Welcome.astro +95 -0
  27. package/skills/wix-headless-templates/blank/project/src/layouts/Layout.astro +22 -0
  28. package/skills/wix-headless-templates/blank/project/src/pages/index.astro +8 -0
  29. package/skills/wix-headless-templates/blank/project/tsconfig.json +5 -0
  30. package/skills/wix-headless-templates/blog/INSTRUCTIONS.md +418 -0
  31. package/skills/wix-headless-templates/blog/app/components/blog/BlogFeedView.tsx +191 -0
  32. package/skills/wix-headless-templates/blog/app/components/blog/CommentsView.tsx +206 -0
  33. package/skills/wix-headless-templates/blog/app/components/blog/PostLikeButton.tsx +62 -0
  34. package/skills/wix-headless-templates/blog/app/components/blog/PostView.tsx +139 -0
  35. package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +42 -0
  36. package/skills/wix-headless-templates/blog/app/hooks/blog/useBlogFeed.ts +31 -0
  37. package/skills/wix-headless-templates/blog/app/hooks/blog/useComments.ts +26 -0
  38. package/skills/wix-headless-templates/blog/app/hooks/blog/usePost.ts +25 -0
  39. package/skills/wix-headless-templates/blog/app/wix/blog/authors-core.ts +51 -0
  40. package/skills/wix-headless-templates/blog/app/wix/blog/authors.ts +50 -0
  41. package/skills/wix-headless-templates/blog/app/wix/blog/blog-feed-store.ts +156 -0
  42. package/skills/wix-headless-templates/blog/app/wix/blog/comments-core.ts +189 -0
  43. package/skills/wix-headless-templates/blog/app/wix/blog/comments-store.ts +214 -0
  44. package/skills/wix-headless-templates/blog/app/wix/blog/comments.ts +84 -0
  45. package/skills/wix-headless-templates/blog/app/wix/blog/post-likes.ts +42 -0
  46. package/skills/wix-headless-templates/blog/app/wix/blog/post-store.ts +158 -0
  47. package/skills/wix-headless-templates/blog/app/wix/blog/posts-core.ts +347 -0
  48. package/skills/wix-headless-templates/blog/app/wix/blog/posts.ts +132 -0
  49. package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy-core.ts +80 -0
  50. package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy.ts +78 -0
  51. package/skills/wix-headless-templates/blog/app/wix/blog/types.ts +161 -0
  52. package/skills/wix-headless-templates/blog/app-astro/layouts/SiteLayout.astro +44 -0
  53. package/skills/wix-headless-templates/blog/app-astro/pages/blog/[...slug].astro +148 -0
  54. package/skills/wix-headless-templates/blog/app-astro/pages/blog/category/[slug].astro +97 -0
  55. package/skills/wix-headless-templates/blog/app-astro/pages/blog/tag/[slug].astro +51 -0
  56. package/skills/wix-headless-templates/blog/app-astro/pages/blog.astro +34 -0
  57. package/skills/wix-headless-templates/blog/project/README.md +15 -0
  58. package/skills/wix-headless-templates/blog/project/astro.config.mjs +22 -0
  59. package/skills/wix-headless-templates/blog/project/package-lock.json +14699 -0
  60. package/skills/wix-headless-templates/blog/project/package.json +39 -0
  61. package/skills/wix-headless-templates/blog/project/public/favicon.svg +9 -0
  62. package/skills/wix-headless-templates/blog/project/src/assets/astro.svg +1 -0
  63. package/skills/wix-headless-templates/blog/project/src/assets/background.svg +1 -0
  64. package/skills/wix-headless-templates/blog/project/src/assets/wix.svg +18 -0
  65. package/skills/wix-headless-templates/blog/project/src/components/Hero.astro +77 -0
  66. package/skills/wix-headless-templates/blog/project/src/components/Welcome.astro +95 -0
  67. package/skills/wix-headless-templates/blog/project/src/components/blog/BlogFeedView.tsx +191 -0
  68. package/skills/wix-headless-templates/blog/project/src/components/blog/CommentsView.tsx +206 -0
  69. package/skills/wix-headless-templates/blog/project/src/components/blog/PostLikeButton.tsx +62 -0
  70. package/skills/wix-headless-templates/blog/project/src/components/blog/PostView.tsx +139 -0
  71. package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +42 -0
  72. package/skills/wix-headless-templates/blog/project/src/hooks/blog/useBlogFeed.ts +31 -0
  73. package/skills/wix-headless-templates/blog/project/src/hooks/blog/useComments.ts +26 -0
  74. package/skills/wix-headless-templates/blog/project/src/hooks/blog/usePost.ts +25 -0
  75. package/skills/wix-headless-templates/blog/project/src/layouts/Layout.astro +22 -0
  76. package/skills/wix-headless-templates/blog/project/src/layouts/SiteLayout.astro +44 -0
  77. package/skills/wix-headless-templates/blog/project/src/pages/blog/[...slug].astro +148 -0
  78. package/skills/wix-headless-templates/blog/project/src/pages/blog/category/[slug].astro +97 -0
  79. package/skills/wix-headless-templates/blog/project/src/pages/blog/tag/[slug].astro +51 -0
  80. package/skills/wix-headless-templates/blog/project/src/pages/blog.astro +34 -0
  81. package/skills/wix-headless-templates/blog/project/src/pages/index.astro +8 -0
  82. package/skills/wix-headless-templates/blog/project/src/styles/global.css +57 -0
  83. package/skills/wix-headless-templates/blog/project/src/wix/blog/authors-core.ts +51 -0
  84. package/skills/wix-headless-templates/blog/project/src/wix/blog/authors.ts +50 -0
  85. package/skills/wix-headless-templates/blog/project/src/wix/blog/blog-feed-store.ts +156 -0
  86. package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-core.ts +189 -0
  87. package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-store.ts +214 -0
  88. package/skills/wix-headless-templates/blog/project/src/wix/blog/comments.ts +84 -0
  89. package/skills/wix-headless-templates/blog/project/src/wix/blog/post-likes.ts +42 -0
  90. package/skills/wix-headless-templates/blog/project/src/wix/blog/post-store.ts +158 -0
  91. package/skills/wix-headless-templates/blog/project/src/wix/blog/posts-core.ts +347 -0
  92. package/skills/wix-headless-templates/blog/project/src/wix/blog/posts.ts +132 -0
  93. package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy-core.ts +80 -0
  94. package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy.ts +78 -0
  95. package/skills/wix-headless-templates/blog/project/src/wix/blog/types.ts +161 -0
  96. package/skills/wix-headless-templates/blog/project/src/wix/config.ts +16 -0
  97. package/skills/wix-headless-templates/blog/project/src/wix/media.ts +106 -0
  98. package/skills/wix-headless-templates/blog/project/src/wix/money.ts +24 -0
  99. package/skills/wix-headless-templates/blog/project/src/wix/sdk.ts +89 -0
  100. package/skills/wix-headless-templates/blog/project/tsconfig.json +5 -0
  101. package/skills/wix-headless-templates/blog/rest/authors.ts +39 -0
  102. package/skills/wix-headless-templates/blog/rest/comments.ts +64 -0
  103. package/skills/wix-headless-templates/blog/rest/post-likes.ts +37 -0
  104. package/skills/wix-headless-templates/blog/rest/posts.ts +123 -0
  105. package/skills/wix-headless-templates/blog/rest/taxonomy.ts +79 -0
  106. package/skills/wix-headless-templates/blog/seed/SEED.md +81 -0
  107. package/skills/wix-headless-templates/blog/seed/read-site.mjs +33 -0
  108. package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +337 -0
  109. package/skills/wix-headless-templates/bookings/INSTRUCTIONS.md +356 -0
  110. package/skills/wix-headless-templates/bookings/app/components/bookings/ServiceBookingView.tsx +369 -0
  111. package/skills/wix-headless-templates/bookings/app/components/bookings/ServicesView.tsx +193 -0
  112. package/skills/wix-headless-templates/bookings/app/hooks/bookings/useBookingFlow.ts +56 -0
  113. package/skills/wix-headless-templates/bookings/app/hooks/bookings/useServices.ts +23 -0
  114. package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-core.ts +614 -0
  115. package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-flow-store.ts +410 -0
  116. package/skills/wix-headless-templates/bookings/app/wix/bookings/booking.ts +227 -0
  117. package/skills/wix-headless-templates/bookings/app/wix/bookings/services-core.ts +366 -0
  118. package/skills/wix-headless-templates/bookings/app/wix/bookings/services-store.ts +213 -0
  119. package/skills/wix-headless-templates/bookings/app/wix/bookings/services.ts +100 -0
  120. package/skills/wix-headless-templates/bookings/app/wix/bookings/types.ts +236 -0
  121. package/skills/wix-headless-templates/bookings/app-astro/layouts/SiteLayout.astro +40 -0
  122. package/skills/wix-headless-templates/bookings/app-astro/pages/services/[slug].astro +81 -0
  123. package/skills/wix-headless-templates/bookings/app-astro/pages/services.astro +40 -0
  124. package/skills/wix-headless-templates/bookings/project/README.md +15 -0
  125. package/skills/wix-headless-templates/bookings/project/astro.config.mjs +22 -0
  126. package/skills/wix-headless-templates/bookings/project/package-lock.json +10546 -0
  127. package/skills/wix-headless-templates/bookings/project/package.json +41 -0
  128. package/skills/wix-headless-templates/bookings/project/public/favicon.svg +9 -0
  129. package/skills/wix-headless-templates/bookings/project/src/assets/astro.svg +1 -0
  130. package/skills/wix-headless-templates/bookings/project/src/assets/background.svg +1 -0
  131. package/skills/wix-headless-templates/bookings/project/src/assets/wix.svg +18 -0
  132. package/skills/wix-headless-templates/bookings/project/src/components/Hero.astro +77 -0
  133. package/skills/wix-headless-templates/bookings/project/src/components/Welcome.astro +95 -0
  134. package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServiceBookingView.tsx +369 -0
  135. package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServicesView.tsx +193 -0
  136. package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useBookingFlow.ts +56 -0
  137. package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useServices.ts +23 -0
  138. package/skills/wix-headless-templates/bookings/project/src/layouts/Layout.astro +22 -0
  139. package/skills/wix-headless-templates/bookings/project/src/layouts/SiteLayout.astro +40 -0
  140. package/skills/wix-headless-templates/bookings/project/src/pages/index.astro +8 -0
  141. package/skills/wix-headless-templates/bookings/project/src/pages/services/[slug].astro +81 -0
  142. package/skills/wix-headless-templates/bookings/project/src/pages/services.astro +40 -0
  143. package/skills/wix-headless-templates/bookings/project/src/styles/global.css +57 -0
  144. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-core.ts +614 -0
  145. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-flow-store.ts +410 -0
  146. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking.ts +227 -0
  147. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-core.ts +366 -0
  148. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-store.ts +213 -0
  149. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services.ts +100 -0
  150. package/skills/wix-headless-templates/bookings/project/src/wix/bookings/types.ts +236 -0
  151. package/skills/wix-headless-templates/bookings/project/src/wix/config.ts +16 -0
  152. package/skills/wix-headless-templates/bookings/project/src/wix/media.ts +106 -0
  153. package/skills/wix-headless-templates/bookings/project/src/wix/money.ts +24 -0
  154. package/skills/wix-headless-templates/bookings/project/src/wix/sdk.ts +89 -0
  155. package/skills/wix-headless-templates/bookings/project/tsconfig.json +5 -0
  156. package/skills/wix-headless-templates/bookings/rest/booking.ts +227 -0
  157. package/skills/wix-headless-templates/bookings/rest/services.ts +94 -0
  158. package/skills/wix-headless-templates/bookings/seed/SEED.md +109 -0
  159. package/skills/wix-headless-templates/bookings/seed/read-site.mjs +28 -0
  160. package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +407 -0
  161. package/skills/wix-headless-templates/cms/INSTRUCTIONS.md +399 -0
  162. package/skills/wix-headless-templates/cms/app/hooks/cms/useCollection.ts +82 -0
  163. package/skills/wix-headless-templates/cms/app/hooks/cms/useItem.ts +37 -0
  164. package/skills/wix-headless-templates/cms/app/wix/cms/collection-store.ts +220 -0
  165. package/skills/wix-headless-templates/cms/app/wix/cms/collections-core.ts +41 -0
  166. package/skills/wix-headless-templates/cms/app/wix/cms/collections.ts +28 -0
  167. package/skills/wix-headless-templates/cms/app/wix/cms/item-store.ts +93 -0
  168. package/skills/wix-headless-templates/cms/app/wix/cms/items-core.ts +259 -0
  169. package/skills/wix-headless-templates/cms/app/wix/cms/items.ts +182 -0
  170. package/skills/wix-headless-templates/cms/app/wix/cms/types.ts +138 -0
  171. package/skills/wix-headless-templates/cms/app-astro/layouts/SiteLayout.astro +41 -0
  172. package/skills/wix-headless-templates/cms/project/README.md +15 -0
  173. package/skills/wix-headless-templates/cms/project/astro.config.mjs +22 -0
  174. package/skills/wix-headless-templates/cms/project/package-lock.json +9798 -0
  175. package/skills/wix-headless-templates/cms/project/package.json +37 -0
  176. package/skills/wix-headless-templates/cms/project/public/favicon.svg +9 -0
  177. package/skills/wix-headless-templates/cms/project/src/assets/astro.svg +1 -0
  178. package/skills/wix-headless-templates/cms/project/src/assets/background.svg +1 -0
  179. package/skills/wix-headless-templates/cms/project/src/assets/wix.svg +18 -0
  180. package/skills/wix-headless-templates/cms/project/src/components/Hero.astro +77 -0
  181. package/skills/wix-headless-templates/cms/project/src/components/Welcome.astro +95 -0
  182. package/skills/wix-headless-templates/cms/project/src/hooks/cms/useCollection.ts +82 -0
  183. package/skills/wix-headless-templates/cms/project/src/hooks/cms/useItem.ts +37 -0
  184. package/skills/wix-headless-templates/cms/project/src/layouts/Layout.astro +22 -0
  185. package/skills/wix-headless-templates/cms/project/src/layouts/SiteLayout.astro +41 -0
  186. package/skills/wix-headless-templates/cms/project/src/pages/index.astro +8 -0
  187. package/skills/wix-headless-templates/cms/project/src/styles/global.css +57 -0
  188. package/skills/wix-headless-templates/cms/project/src/wix/cms/collection-store.ts +220 -0
  189. package/skills/wix-headless-templates/cms/project/src/wix/cms/collections-core.ts +41 -0
  190. package/skills/wix-headless-templates/cms/project/src/wix/cms/collections.ts +28 -0
  191. package/skills/wix-headless-templates/cms/project/src/wix/cms/item-store.ts +93 -0
  192. package/skills/wix-headless-templates/cms/project/src/wix/cms/items-core.ts +259 -0
  193. package/skills/wix-headless-templates/cms/project/src/wix/cms/items.ts +182 -0
  194. package/skills/wix-headless-templates/cms/project/src/wix/cms/types.ts +138 -0
  195. package/skills/wix-headless-templates/cms/project/src/wix/config.ts +16 -0
  196. package/skills/wix-headless-templates/cms/project/src/wix/media.ts +106 -0
  197. package/skills/wix-headless-templates/cms/project/src/wix/money.ts +24 -0
  198. package/skills/wix-headless-templates/cms/project/src/wix/sdk.ts +89 -0
  199. package/skills/wix-headless-templates/cms/project/tsconfig.json +5 -0
  200. package/skills/wix-headless-templates/cms/rest/collections.ts +25 -0
  201. package/skills/wix-headless-templates/cms/rest/items.ts +189 -0
  202. package/skills/wix-headless-templates/cms/seed/SEED.md +116 -0
  203. package/skills/wix-headless-templates/cms/seed/read-site.mjs +20 -0
  204. package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +321 -0
  205. package/skills/wix-headless-templates/compose.mjs +83 -0
  206. package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +349 -0
  207. package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +155 -0
  208. package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +46 -0
  209. package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +49 -0
  210. package/skills/wix-headless-templates/donations/app/hooks/donations/useCampaigns.ts +21 -0
  211. package/skills/wix-headless-templates/donations/app/hooks/donations/useDonation.ts +27 -0
  212. package/skills/wix-headless-templates/donations/app/hooks/donations/useDonationReceipt.ts +19 -0
  213. package/skills/wix-headless-templates/donations/app/wix/donations/campaigns-store.ts +59 -0
  214. package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +83 -0
  215. package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +95 -0
  216. package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +163 -0
  217. package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +466 -0
  218. package/skills/wix-headless-templates/donations/app/wix/donations/receipt-store.ts +55 -0
  219. package/skills/wix-headless-templates/donations/app/wix/donations/types.ts +121 -0
  220. package/skills/wix-headless-templates/donations/app-astro/components/donations/CampaignPage.astro +43 -0
  221. package/skills/wix-headless-templates/donations/app-astro/layouts/SiteLayout.astro +45 -0
  222. package/skills/wix-headless-templates/donations/app-astro/pages/donate/[id].astro +28 -0
  223. package/skills/wix-headless-templates/donations/app-astro/pages/donate/index.astro +51 -0
  224. package/skills/wix-headless-templates/donations/app-astro/pages/donate/thank-you.astro +13 -0
  225. package/skills/wix-headless-templates/donations/project/README.md +15 -0
  226. package/skills/wix-headless-templates/donations/project/astro.config.mjs +22 -0
  227. package/skills/wix-headless-templates/donations/project/package-lock.json +10266 -0
  228. package/skills/wix-headless-templates/donations/project/package.json +39 -0
  229. package/skills/wix-headless-templates/donations/project/public/favicon.svg +9 -0
  230. package/skills/wix-headless-templates/donations/project/src/assets/astro.svg +1 -0
  231. package/skills/wix-headless-templates/donations/project/src/assets/background.svg +1 -0
  232. package/skills/wix-headless-templates/donations/project/src/assets/wix.svg +18 -0
  233. package/skills/wix-headless-templates/donations/project/src/components/Hero.astro +77 -0
  234. package/skills/wix-headless-templates/donations/project/src/components/Welcome.astro +95 -0
  235. package/skills/wix-headless-templates/donations/project/src/components/donations/CampaignPage.astro +43 -0
  236. package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +155 -0
  237. package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +46 -0
  238. package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +49 -0
  239. package/skills/wix-headless-templates/donations/project/src/hooks/donations/useCampaigns.ts +21 -0
  240. package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonation.ts +27 -0
  241. package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonationReceipt.ts +19 -0
  242. package/skills/wix-headless-templates/donations/project/src/layouts/Layout.astro +22 -0
  243. package/skills/wix-headless-templates/donations/project/src/layouts/SiteLayout.astro +45 -0
  244. package/skills/wix-headless-templates/donations/project/src/pages/donate/[id].astro +28 -0
  245. package/skills/wix-headless-templates/donations/project/src/pages/donate/index.astro +51 -0
  246. package/skills/wix-headless-templates/donations/project/src/pages/donate/thank-you.astro +13 -0
  247. package/skills/wix-headless-templates/donations/project/src/pages/index.astro +8 -0
  248. package/skills/wix-headless-templates/donations/project/src/styles/global.css +57 -0
  249. package/skills/wix-headless-templates/donations/project/src/wix/config.ts +16 -0
  250. package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns-store.ts +59 -0
  251. package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +83 -0
  252. package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +95 -0
  253. package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +163 -0
  254. package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +466 -0
  255. package/skills/wix-headless-templates/donations/project/src/wix/donations/receipt-store.ts +55 -0
  256. package/skills/wix-headless-templates/donations/project/src/wix/donations/types.ts +121 -0
  257. package/skills/wix-headless-templates/donations/project/src/wix/media.ts +106 -0
  258. package/skills/wix-headless-templates/donations/project/src/wix/money.ts +24 -0
  259. package/skills/wix-headless-templates/donations/project/src/wix/sdk.ts +89 -0
  260. package/skills/wix-headless-templates/donations/project/tsconfig.json +5 -0
  261. package/skills/wix-headless-templates/donations/rest/campaigns.ts +76 -0
  262. package/skills/wix-headless-templates/donations/rest/donate.ts +90 -0
  263. package/skills/wix-headless-templates/donations/seed/SEED.md +90 -0
  264. package/skills/wix-headless-templates/donations/seed/read-site.mjs +33 -0
  265. package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +250 -0
  266. package/skills/wix-headless-templates/events/INSTRUCTIONS.md +387 -0
  267. package/skills/wix-headless-templates/events/app/components/events/EventConfirmationView.tsx +139 -0
  268. package/skills/wix-headless-templates/events/app/components/events/EventRegistrationView.tsx +375 -0
  269. package/skills/wix-headless-templates/events/app/components/events/EventsView.tsx +134 -0
  270. package/skills/wix-headless-templates/events/app/hooks/events/useEventConfirmation.ts +21 -0
  271. package/skills/wix-headless-templates/events/app/hooks/events/useEventRegistration.ts +40 -0
  272. package/skills/wix-headless-templates/events/app/hooks/events/useEvents.ts +24 -0
  273. package/skills/wix-headless-templates/events/app/wix/events/events-core.ts +379 -0
  274. package/skills/wix-headless-templates/events/app/wix/events/events-store.ts +175 -0
  275. package/skills/wix-headless-templates/events/app/wix/events/events.ts +124 -0
  276. package/skills/wix-headless-templates/events/app/wix/events/order-store.ts +143 -0
  277. package/skills/wix-headless-templates/events/app/wix/events/orders-core.ts +86 -0
  278. package/skills/wix-headless-templates/events/app/wix/events/orders.ts +30 -0
  279. package/skills/wix-headless-templates/events/app/wix/events/registration-core.ts +415 -0
  280. package/skills/wix-headless-templates/events/app/wix/events/registration-store.ts +237 -0
  281. package/skills/wix-headless-templates/events/app/wix/events/registration.ts +109 -0
  282. package/skills/wix-headless-templates/events/app/wix/events/types.ts +249 -0
  283. package/skills/wix-headless-templates/events/app-astro/layouts/SiteLayout.astro +40 -0
  284. package/skills/wix-headless-templates/events/app-astro/pages/event-confirmation.astro +12 -0
  285. package/skills/wix-headless-templates/events/app-astro/pages/events/[slug].astro +104 -0
  286. package/skills/wix-headless-templates/events/app-astro/pages/events.astro +23 -0
  287. package/skills/wix-headless-templates/events/project/README.md +15 -0
  288. package/skills/wix-headless-templates/events/project/astro.config.mjs +22 -0
  289. package/skills/wix-headless-templates/events/project/package-lock.json +10497 -0
  290. package/skills/wix-headless-templates/events/project/package.json +39 -0
  291. package/skills/wix-headless-templates/events/project/public/favicon.svg +9 -0
  292. package/skills/wix-headless-templates/events/project/src/assets/astro.svg +1 -0
  293. package/skills/wix-headless-templates/events/project/src/assets/background.svg +1 -0
  294. package/skills/wix-headless-templates/events/project/src/assets/wix.svg +18 -0
  295. package/skills/wix-headless-templates/events/project/src/components/Hero.astro +77 -0
  296. package/skills/wix-headless-templates/events/project/src/components/Welcome.astro +95 -0
  297. package/skills/wix-headless-templates/events/project/src/components/events/EventConfirmationView.tsx +139 -0
  298. package/skills/wix-headless-templates/events/project/src/components/events/EventRegistrationView.tsx +375 -0
  299. package/skills/wix-headless-templates/events/project/src/components/events/EventsView.tsx +134 -0
  300. package/skills/wix-headless-templates/events/project/src/hooks/events/useEventConfirmation.ts +21 -0
  301. package/skills/wix-headless-templates/events/project/src/hooks/events/useEventRegistration.ts +40 -0
  302. package/skills/wix-headless-templates/events/project/src/hooks/events/useEvents.ts +24 -0
  303. package/skills/wix-headless-templates/events/project/src/layouts/Layout.astro +22 -0
  304. package/skills/wix-headless-templates/events/project/src/layouts/SiteLayout.astro +40 -0
  305. package/skills/wix-headless-templates/events/project/src/pages/event-confirmation.astro +12 -0
  306. package/skills/wix-headless-templates/events/project/src/pages/events/[slug].astro +104 -0
  307. package/skills/wix-headless-templates/events/project/src/pages/events.astro +23 -0
  308. package/skills/wix-headless-templates/events/project/src/pages/index.astro +8 -0
  309. package/skills/wix-headless-templates/events/project/src/styles/global.css +57 -0
  310. package/skills/wix-headless-templates/events/project/src/wix/config.ts +16 -0
  311. package/skills/wix-headless-templates/events/project/src/wix/events/events-core.ts +379 -0
  312. package/skills/wix-headless-templates/events/project/src/wix/events/events-store.ts +175 -0
  313. package/skills/wix-headless-templates/events/project/src/wix/events/events.ts +124 -0
  314. package/skills/wix-headless-templates/events/project/src/wix/events/order-store.ts +143 -0
  315. package/skills/wix-headless-templates/events/project/src/wix/events/orders-core.ts +86 -0
  316. package/skills/wix-headless-templates/events/project/src/wix/events/orders.ts +30 -0
  317. package/skills/wix-headless-templates/events/project/src/wix/events/registration-core.ts +415 -0
  318. package/skills/wix-headless-templates/events/project/src/wix/events/registration-store.ts +237 -0
  319. package/skills/wix-headless-templates/events/project/src/wix/events/registration.ts +109 -0
  320. package/skills/wix-headless-templates/events/project/src/wix/events/types.ts +249 -0
  321. package/skills/wix-headless-templates/events/project/src/wix/media.ts +106 -0
  322. package/skills/wix-headless-templates/events/project/src/wix/money.ts +24 -0
  323. package/skills/wix-headless-templates/events/project/src/wix/sdk.ts +89 -0
  324. package/skills/wix-headless-templates/events/project/tsconfig.json +5 -0
  325. package/skills/wix-headless-templates/events/rest/events.ts +112 -0
  326. package/skills/wix-headless-templates/events/rest/orders.ts +28 -0
  327. package/skills/wix-headless-templates/events/rest/registration.ts +96 -0
  328. package/skills/wix-headless-templates/events/seed/SEED.md +115 -0
  329. package/skills/wix-headless-templates/events/seed/read-site.mjs +26 -0
  330. package/skills/wix-headless-templates/events/seed/seed-events.mjs +322 -0
  331. package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +317 -0
  332. package/skills/wix-headless-templates/faq/app/components/faq/FaqAccordion.tsx +159 -0
  333. package/skills/wix-headless-templates/faq/app/components/faq/FaqCategoryNav.tsx +46 -0
  334. package/skills/wix-headless-templates/faq/app/components/faq/FaqSearch.tsx +56 -0
  335. package/skills/wix-headless-templates/faq/app/hooks/faq/useFaq.ts +53 -0
  336. package/skills/wix-headless-templates/faq/app/wix/faq/faq-core.ts +428 -0
  337. package/skills/wix-headless-templates/faq/app/wix/faq/faq-store.ts +212 -0
  338. package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +72 -0
  339. package/skills/wix-headless-templates/faq/app/wix/faq/types.ts +63 -0
  340. package/skills/wix-headless-templates/faq/app-astro/layouts/SiteLayout.astro +40 -0
  341. package/skills/wix-headless-templates/faq/app-astro/pages/faq.astro +39 -0
  342. package/skills/wix-headless-templates/faq/project/README.md +15 -0
  343. package/skills/wix-headless-templates/faq/project/astro.config.mjs +22 -0
  344. package/skills/wix-headless-templates/faq/project/package-lock.json +8837 -0
  345. package/skills/wix-headless-templates/faq/project/package.json +37 -0
  346. package/skills/wix-headless-templates/faq/project/public/favicon.svg +9 -0
  347. package/skills/wix-headless-templates/faq/project/src/assets/astro.svg +1 -0
  348. package/skills/wix-headless-templates/faq/project/src/assets/background.svg +1 -0
  349. package/skills/wix-headless-templates/faq/project/src/assets/wix.svg +18 -0
  350. package/skills/wix-headless-templates/faq/project/src/components/Hero.astro +77 -0
  351. package/skills/wix-headless-templates/faq/project/src/components/Welcome.astro +95 -0
  352. package/skills/wix-headless-templates/faq/project/src/components/faq/FaqAccordion.tsx +159 -0
  353. package/skills/wix-headless-templates/faq/project/src/components/faq/FaqCategoryNav.tsx +46 -0
  354. package/skills/wix-headless-templates/faq/project/src/components/faq/FaqSearch.tsx +56 -0
  355. package/skills/wix-headless-templates/faq/project/src/hooks/faq/useFaq.ts +53 -0
  356. package/skills/wix-headless-templates/faq/project/src/layouts/Layout.astro +22 -0
  357. package/skills/wix-headless-templates/faq/project/src/layouts/SiteLayout.astro +40 -0
  358. package/skills/wix-headless-templates/faq/project/src/pages/faq.astro +39 -0
  359. package/skills/wix-headless-templates/faq/project/src/pages/index.astro +8 -0
  360. package/skills/wix-headless-templates/faq/project/src/styles/global.css +57 -0
  361. package/skills/wix-headless-templates/faq/project/src/wix/config.ts +16 -0
  362. package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-core.ts +428 -0
  363. package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-store.ts +212 -0
  364. package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +72 -0
  365. package/skills/wix-headless-templates/faq/project/src/wix/faq/types.ts +63 -0
  366. package/skills/wix-headless-templates/faq/project/src/wix/media.ts +106 -0
  367. package/skills/wix-headless-templates/faq/project/src/wix/money.ts +24 -0
  368. package/skills/wix-headless-templates/faq/project/src/wix/sdk.ts +89 -0
  369. package/skills/wix-headless-templates/faq/project/tsconfig.json +5 -0
  370. package/skills/wix-headless-templates/faq/rest/faq.ts +71 -0
  371. package/skills/wix-headless-templates/faq/seed/SEED.md +104 -0
  372. package/skills/wix-headless-templates/faq/seed/read-site.mjs +23 -0
  373. package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +302 -0
  374. package/skills/wix-headless-templates/forms/INSTRUCTIONS.md +417 -0
  375. package/skills/wix-headless-templates/forms/app/hooks/forms/useWixForm.ts +108 -0
  376. package/skills/wix-headless-templates/forms/app/wix/forms/address-templates.generated.ts +13 -0
  377. package/skills/wix-headless-templates/forms/app/wix/forms/form-store.ts +533 -0
  378. package/skills/wix-headless-templates/forms/app/wix/forms/forms-core.ts +671 -0
  379. package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +57 -0
  380. package/skills/wix-headless-templates/forms/app/wix/forms/submissions-core.ts +423 -0
  381. package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +95 -0
  382. package/skills/wix-headless-templates/forms/app/wix/forms/types.ts +284 -0
  383. package/skills/wix-headless-templates/forms/project/README.md +15 -0
  384. package/skills/wix-headless-templates/forms/project/astro.config.mjs +22 -0
  385. package/skills/wix-headless-templates/forms/project/package-lock.json +9102 -0
  386. package/skills/wix-headless-templates/forms/project/package.json +37 -0
  387. package/skills/wix-headless-templates/forms/project/public/favicon.svg +9 -0
  388. package/skills/wix-headless-templates/forms/project/src/assets/astro.svg +1 -0
  389. package/skills/wix-headless-templates/forms/project/src/assets/background.svg +1 -0
  390. package/skills/wix-headless-templates/forms/project/src/assets/wix.svg +18 -0
  391. package/skills/wix-headless-templates/forms/project/src/components/Hero.astro +77 -0
  392. package/skills/wix-headless-templates/forms/project/src/components/Welcome.astro +95 -0
  393. package/skills/wix-headless-templates/forms/project/src/hooks/forms/useWixForm.ts +108 -0
  394. package/skills/wix-headless-templates/forms/project/src/layouts/Layout.astro +22 -0
  395. package/skills/wix-headless-templates/forms/project/src/pages/index.astro +8 -0
  396. package/skills/wix-headless-templates/forms/project/src/styles/global.css +57 -0
  397. package/skills/wix-headless-templates/forms/project/src/wix/config.ts +16 -0
  398. package/skills/wix-headless-templates/forms/project/src/wix/forms/address-templates.generated.ts +13 -0
  399. package/skills/wix-headless-templates/forms/project/src/wix/forms/form-store.ts +533 -0
  400. package/skills/wix-headless-templates/forms/project/src/wix/forms/forms-core.ts +671 -0
  401. package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +57 -0
  402. package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions-core.ts +423 -0
  403. package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +95 -0
  404. package/skills/wix-headless-templates/forms/project/src/wix/forms/types.ts +284 -0
  405. package/skills/wix-headless-templates/forms/project/src/wix/media.ts +106 -0
  406. package/skills/wix-headless-templates/forms/project/src/wix/money.ts +24 -0
  407. package/skills/wix-headless-templates/forms/project/src/wix/sdk.ts +89 -0
  408. package/skills/wix-headless-templates/forms/project/tsconfig.json +5 -0
  409. package/skills/wix-headless-templates/forms/rest/forms.ts +37 -0
  410. package/skills/wix-headless-templates/forms/rest/submissions.ts +83 -0
  411. package/skills/wix-headless-templates/forms/seed/SEED.md +225 -0
  412. package/skills/wix-headless-templates/forms/seed/read-site.mjs +53 -0
  413. package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +574 -0
  414. package/skills/wix-headless-templates/forms/tooling/address-templates.mjs +96 -0
  415. package/skills/wix-headless-templates/members/INSTRUCTIONS.md +345 -0
  416. package/skills/wix-headless-templates/members/app/components/members/AccountPage.tsx +16 -0
  417. package/skills/wix-headless-templates/members/app/components/members/AccountView.tsx +60 -0
  418. package/skills/wix-headless-templates/members/app/components/members/LoginForm.tsx +165 -0
  419. package/skills/wix-headless-templates/members/app/components/members/MemberMenu.tsx +78 -0
  420. package/skills/wix-headless-templates/members/app/components/members/RequireAuth.tsx +47 -0
  421. package/skills/wix-headless-templates/members/app/hooks/members/useMember.ts +67 -0
  422. package/skills/wix-headless-templates/members/app/wix/members/auth-core.ts +160 -0
  423. package/skills/wix-headless-templates/members/app/wix/members/auth.ts +117 -0
  424. package/skills/wix-headless-templates/members/app/wix/members/client.ts +27 -0
  425. package/skills/wix-headless-templates/members/app/wix/members/member-store.ts +133 -0
  426. package/skills/wix-headless-templates/members/app/wix/members/members-core.ts +43 -0
  427. package/skills/wix-headless-templates/members/app/wix/members/members.ts +29 -0
  428. package/skills/wix-headless-templates/members/app/wix/members/types.ts +21 -0
  429. package/skills/wix-headless-templates/members/app-astro/layouts/SiteLayout.astro +42 -0
  430. package/skills/wix-headless-templates/members/app-astro/pages/account.astro +9 -0
  431. package/skills/wix-headless-templates/members/app-astro/pages/login.astro +11 -0
  432. package/skills/wix-headless-templates/members/project/README.md +15 -0
  433. package/skills/wix-headless-templates/members/project/astro.config.mjs +22 -0
  434. package/skills/wix-headless-templates/members/project/package-lock.json +8892 -0
  435. package/skills/wix-headless-templates/members/project/package.json +37 -0
  436. package/skills/wix-headless-templates/members/project/public/favicon.svg +9 -0
  437. package/skills/wix-headless-templates/members/project/src/assets/astro.svg +1 -0
  438. package/skills/wix-headless-templates/members/project/src/assets/background.svg +1 -0
  439. package/skills/wix-headless-templates/members/project/src/assets/wix.svg +18 -0
  440. package/skills/wix-headless-templates/members/project/src/components/Hero.astro +77 -0
  441. package/skills/wix-headless-templates/members/project/src/components/Welcome.astro +95 -0
  442. package/skills/wix-headless-templates/members/project/src/components/members/AccountPage.tsx +16 -0
  443. package/skills/wix-headless-templates/members/project/src/components/members/AccountView.tsx +60 -0
  444. package/skills/wix-headless-templates/members/project/src/components/members/LoginForm.tsx +165 -0
  445. package/skills/wix-headless-templates/members/project/src/components/members/MemberMenu.tsx +78 -0
  446. package/skills/wix-headless-templates/members/project/src/components/members/RequireAuth.tsx +47 -0
  447. package/skills/wix-headless-templates/members/project/src/hooks/members/useMember.ts +67 -0
  448. package/skills/wix-headless-templates/members/project/src/layouts/Layout.astro +22 -0
  449. package/skills/wix-headless-templates/members/project/src/layouts/SiteLayout.astro +42 -0
  450. package/skills/wix-headless-templates/members/project/src/pages/account.astro +9 -0
  451. package/skills/wix-headless-templates/members/project/src/pages/index.astro +8 -0
  452. package/skills/wix-headless-templates/members/project/src/pages/login.astro +11 -0
  453. package/skills/wix-headless-templates/members/project/src/styles/global.css +57 -0
  454. package/skills/wix-headless-templates/members/project/src/wix/config.ts +16 -0
  455. package/skills/wix-headless-templates/members/project/src/wix/media.ts +106 -0
  456. package/skills/wix-headless-templates/members/project/src/wix/members/auth-core.ts +160 -0
  457. package/skills/wix-headless-templates/members/project/src/wix/members/auth.ts +117 -0
  458. package/skills/wix-headless-templates/members/project/src/wix/members/client.ts +27 -0
  459. package/skills/wix-headless-templates/members/project/src/wix/members/member-store.ts +133 -0
  460. package/skills/wix-headless-templates/members/project/src/wix/members/members-core.ts +43 -0
  461. package/skills/wix-headless-templates/members/project/src/wix/members/members.ts +29 -0
  462. package/skills/wix-headless-templates/members/project/src/wix/members/types.ts +21 -0
  463. package/skills/wix-headless-templates/members/project/src/wix/money.ts +24 -0
  464. package/skills/wix-headless-templates/members/project/src/wix/sdk.ts +89 -0
  465. package/skills/wix-headless-templates/members/project/tsconfig.json +5 -0
  466. package/skills/wix-headless-templates/members/rest/auth.ts +224 -0
  467. package/skills/wix-headless-templates/members/rest/members.ts +26 -0
  468. package/skills/wix-headless-templates/members/seed/SEED.md +39 -0
  469. package/skills/wix-headless-templates/members/seed/read-site.mjs +15 -0
  470. package/skills/wix-headless-templates/members/seed/seed-members.mjs +91 -0
  471. package/skills/wix-headless-templates/portfolio/INSTRUCTIONS.md +315 -0
  472. package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
  473. package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
  474. package/skills/wix-headless-templates/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
  475. package/skills/wix-headless-templates/portfolio/app/components/portfolio/ProjectDetailView.tsx +85 -0
  476. package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollectionProjects.ts +32 -0
  477. package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollections.ts +21 -0
  478. package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useProjectDetail.ts +31 -0
  479. package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
  480. package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collections-store.ts +58 -0
  481. package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
  482. package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio.ts +78 -0
  483. package/skills/wix-headless-templates/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
  484. package/skills/wix-headless-templates/portfolio/app/wix/portfolio/types.ts +55 -0
  485. package/skills/wix-headless-templates/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
  486. package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
  487. package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio.astro +21 -0
  488. package/skills/wix-headless-templates/portfolio/app-astro/pages/projects/[slug].astro +29 -0
  489. package/skills/wix-headless-templates/portfolio/project/README.md +15 -0
  490. package/skills/wix-headless-templates/portfolio/project/astro.config.mjs +22 -0
  491. package/skills/wix-headless-templates/portfolio/project/package-lock.json +8760 -0
  492. package/skills/wix-headless-templates/portfolio/project/package.json +37 -0
  493. package/skills/wix-headless-templates/portfolio/project/public/favicon.svg +9 -0
  494. package/skills/wix-headless-templates/portfolio/project/src/assets/astro.svg +1 -0
  495. package/skills/wix-headless-templates/portfolio/project/src/assets/background.svg +1 -0
  496. package/skills/wix-headless-templates/portfolio/project/src/assets/wix.svg +18 -0
  497. package/skills/wix-headless-templates/portfolio/project/src/components/Hero.astro +77 -0
  498. package/skills/wix-headless-templates/portfolio/project/src/components/Welcome.astro +95 -0
  499. package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionProjectsView.tsx +110 -0
  500. package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionsView.tsx +90 -0
  501. package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/GalleryMedia.tsx +35 -0
  502. package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/ProjectDetailView.tsx +85 -0
  503. package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollectionProjects.ts +32 -0
  504. package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollections.ts +21 -0
  505. package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useProjectDetail.ts +31 -0
  506. package/skills/wix-headless-templates/portfolio/project/src/layouts/Layout.astro +22 -0
  507. package/skills/wix-headless-templates/portfolio/project/src/layouts/SiteLayout.astro +40 -0
  508. package/skills/wix-headless-templates/portfolio/project/src/pages/index.astro +8 -0
  509. package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio/[slug].astro +30 -0
  510. package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio.astro +21 -0
  511. package/skills/wix-headless-templates/portfolio/project/src/pages/projects/[slug].astro +29 -0
  512. package/skills/wix-headless-templates/portfolio/project/src/styles/global.css +57 -0
  513. package/skills/wix-headless-templates/portfolio/project/src/wix/config.ts +16 -0
  514. package/skills/wix-headless-templates/portfolio/project/src/wix/media.ts +106 -0
  515. package/skills/wix-headless-templates/portfolio/project/src/wix/money.ts +24 -0
  516. package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collection-projects-store.ts +82 -0
  517. package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collections-store.ts +58 -0
  518. package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio-core.ts +177 -0
  519. package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio.ts +78 -0
  520. package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/project-detail-store.ts +81 -0
  521. package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/types.ts +55 -0
  522. package/skills/wix-headless-templates/portfolio/project/src/wix/sdk.ts +89 -0
  523. package/skills/wix-headless-templates/portfolio/project/tsconfig.json +5 -0
  524. package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +75 -0
  525. package/skills/wix-headless-templates/portfolio/seed/SEED.md +86 -0
  526. package/skills/wix-headless-templates/portfolio/seed/read-site.mjs +20 -0
  527. package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +253 -0
  528. package/skills/wix-headless-templates/pricing-plans/INSTRUCTIONS.md +376 -0
  529. package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +54 -0
  530. package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlansView.tsx +108 -0
  531. package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/RequirePlan.tsx +87 -0
  532. package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
  533. package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanAccess.ts +31 -0
  534. package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +16 -0
  535. package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlans.ts +22 -0
  536. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-core.ts +29 -0
  537. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-store.ts +92 -0
  538. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +37 -0
  539. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
  540. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-core.ts +212 -0
  541. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
  542. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans.ts +54 -0
  543. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
  544. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase.ts +22 -0
  545. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/types.ts +52 -0
  546. package/skills/wix-headless-templates/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
  547. package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans/[slug].astro +43 -0
  548. package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans.astro +21 -0
  549. package/skills/wix-headless-templates/pricing-plans/project/README.md +15 -0
  550. package/skills/wix-headless-templates/pricing-plans/project/astro.config.mjs +22 -0
  551. package/skills/wix-headless-templates/pricing-plans/project/package-lock.json +9799 -0
  552. package/skills/wix-headless-templates/pricing-plans/project/package.json +38 -0
  553. package/skills/wix-headless-templates/pricing-plans/project/public/favicon.svg +9 -0
  554. package/skills/wix-headless-templates/pricing-plans/project/src/assets/astro.svg +1 -0
  555. package/skills/wix-headless-templates/pricing-plans/project/src/assets/background.svg +1 -0
  556. package/skills/wix-headless-templates/pricing-plans/project/src/assets/wix.svg +18 -0
  557. package/skills/wix-headless-templates/pricing-plans/project/src/components/Hero.astro +77 -0
  558. package/skills/wix-headless-templates/pricing-plans/project/src/components/Welcome.astro +95 -0
  559. package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlanDetailView.tsx +54 -0
  560. package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlansView.tsx +108 -0
  561. package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/RequirePlan.tsx +87 -0
  562. package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/SubscribeButton.tsx +41 -0
  563. package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanAccess.ts +31 -0
  564. package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanPurchase.ts +16 -0
  565. package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlans.ts +22 -0
  566. package/skills/wix-headless-templates/pricing-plans/project/src/layouts/Layout.astro +22 -0
  567. package/skills/wix-headless-templates/pricing-plans/project/src/layouts/SiteLayout.astro +41 -0
  568. package/skills/wix-headless-templates/pricing-plans/project/src/pages/index.astro +8 -0
  569. package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans/[slug].astro +43 -0
  570. package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans.astro +21 -0
  571. package/skills/wix-headless-templates/pricing-plans/project/src/styles/global.css +57 -0
  572. package/skills/wix-headless-templates/pricing-plans/project/src/wix/config.ts +16 -0
  573. package/skills/wix-headless-templates/pricing-plans/project/src/wix/media.ts +106 -0
  574. package/skills/wix-headless-templates/pricing-plans/project/src/wix/money.ts +24 -0
  575. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-core.ts +29 -0
  576. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-store.ts +92 -0
  577. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +37 -0
  578. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-purchase-store.ts +54 -0
  579. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-core.ts +212 -0
  580. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-store.ts +64 -0
  581. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans.ts +54 -0
  582. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase-core.ts +43 -0
  583. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase.ts +22 -0
  584. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/types.ts +52 -0
  585. package/skills/wix-headless-templates/pricing-plans/project/src/wix/sdk.ts +89 -0
  586. package/skills/wix-headless-templates/pricing-plans/project/tsconfig.json +5 -0
  587. package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +31 -0
  588. package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +58 -0
  589. package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +20 -0
  590. package/skills/wix-headless-templates/pricing-plans/seed/SEED.md +93 -0
  591. package/skills/wix-headless-templates/pricing-plans/seed/read-site.mjs +22 -0
  592. package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +301 -0
  593. package/skills/wix-headless-templates/rentals/INSTRUCTIONS.md +309 -0
  594. package/skills/wix-headless-templates/rentals/app/components/rentals/RentalBookingView.tsx +195 -0
  595. package/skills/wix-headless-templates/rentals/app/components/rentals/RentalsView.tsx +89 -0
  596. package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentalFlow.ts +31 -0
  597. package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentals.ts +23 -0
  598. package/skills/wix-headless-templates/rentals/app/wix/rentals/rental-flow-store.ts +283 -0
  599. package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-core.ts +435 -0
  600. package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-store.ts +112 -0
  601. package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals.ts +173 -0
  602. package/skills/wix-headless-templates/rentals/app/wix/rentals/types.ts +113 -0
  603. package/skills/wix-headless-templates/rentals/app-astro/layouts/SiteLayout.astro +40 -0
  604. package/skills/wix-headless-templates/rentals/app-astro/pages/rentals/[slug].astro +81 -0
  605. package/skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro +24 -0
  606. package/skills/wix-headless-templates/rentals/project/README.md +15 -0
  607. package/skills/wix-headless-templates/rentals/project/astro.config.mjs +22 -0
  608. package/skills/wix-headless-templates/rentals/project/package-lock.json +10545 -0
  609. package/skills/wix-headless-templates/rentals/project/package.json +40 -0
  610. package/skills/wix-headless-templates/rentals/project/public/favicon.svg +9 -0
  611. package/skills/wix-headless-templates/rentals/project/src/assets/astro.svg +1 -0
  612. package/skills/wix-headless-templates/rentals/project/src/assets/background.svg +1 -0
  613. package/skills/wix-headless-templates/rentals/project/src/assets/wix.svg +18 -0
  614. package/skills/wix-headless-templates/rentals/project/src/components/Hero.astro +77 -0
  615. package/skills/wix-headless-templates/rentals/project/src/components/Welcome.astro +95 -0
  616. package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalBookingView.tsx +195 -0
  617. package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalsView.tsx +89 -0
  618. package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentalFlow.ts +31 -0
  619. package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentals.ts +23 -0
  620. package/skills/wix-headless-templates/rentals/project/src/layouts/Layout.astro +22 -0
  621. package/skills/wix-headless-templates/rentals/project/src/layouts/SiteLayout.astro +40 -0
  622. package/skills/wix-headless-templates/rentals/project/src/pages/index.astro +8 -0
  623. package/skills/wix-headless-templates/rentals/project/src/pages/rentals/[slug].astro +81 -0
  624. package/skills/wix-headless-templates/rentals/project/src/pages/rentals.astro +24 -0
  625. package/skills/wix-headless-templates/rentals/project/src/styles/global.css +57 -0
  626. package/skills/wix-headless-templates/rentals/project/src/wix/config.ts +16 -0
  627. package/skills/wix-headless-templates/rentals/project/src/wix/media.ts +106 -0
  628. package/skills/wix-headless-templates/rentals/project/src/wix/money.ts +24 -0
  629. package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rental-flow-store.ts +283 -0
  630. package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-core.ts +435 -0
  631. package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-store.ts +112 -0
  632. package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals.ts +173 -0
  633. package/skills/wix-headless-templates/rentals/project/src/wix/rentals/types.ts +113 -0
  634. package/skills/wix-headless-templates/rentals/project/src/wix/sdk.ts +89 -0
  635. package/skills/wix-headless-templates/rentals/project/tsconfig.json +5 -0
  636. package/skills/wix-headless-templates/rentals/rest/rentals.ts +153 -0
  637. package/skills/wix-headless-templates/rentals/seed/SEED.md +95 -0
  638. package/skills/wix-headless-templates/rentals/seed/read-site.mjs +34 -0
  639. package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +321 -0
  640. package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +468 -0
  641. package/skills/wix-headless-templates/restaurants/app/components/restaurants/MenuView.tsx +257 -0
  642. package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
  643. package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
  644. package/skills/wix-headless-templates/restaurants/app/components/restaurants/ReservationView.tsx +212 -0
  645. package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useMenus.ts +34 -0
  646. package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +52 -0
  647. package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useReservation.ts +49 -0
  648. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-core.ts +333 -0
  649. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-store.ts +89 -0
  650. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +109 -0
  651. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +141 -0
  652. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +287 -0
  653. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +237 -0
  654. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservation-store.ts +279 -0
  655. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations-core.ts +218 -0
  656. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations.ts +109 -0
  657. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/time-core.ts +118 -0
  658. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +337 -0
  659. package/skills/wix-headless-templates/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
  660. package/skills/wix-headless-templates/restaurants/app-astro/pages/menu.astro +22 -0
  661. package/skills/wix-headless-templates/restaurants/app-astro/pages/reservations.astro +12 -0
  662. package/skills/wix-headless-templates/restaurants/project/README.md +15 -0
  663. package/skills/wix-headless-templates/restaurants/project/astro.config.mjs +22 -0
  664. package/skills/wix-headless-templates/restaurants/project/package-lock.json +11038 -0
  665. package/skills/wix-headless-templates/restaurants/project/package.json +40 -0
  666. package/skills/wix-headless-templates/restaurants/project/public/favicon.svg +9 -0
  667. package/skills/wix-headless-templates/restaurants/project/src/assets/astro.svg +1 -0
  668. package/skills/wix-headless-templates/restaurants/project/src/assets/background.svg +1 -0
  669. package/skills/wix-headless-templates/restaurants/project/src/assets/wix.svg +18 -0
  670. package/skills/wix-headless-templates/restaurants/project/src/components/Hero.astro +77 -0
  671. package/skills/wix-headless-templates/restaurants/project/src/components/Welcome.astro +95 -0
  672. package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/MenuView.tsx +257 -0
  673. package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartButton.tsx +26 -0
  674. package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +121 -0
  675. package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/ReservationView.tsx +212 -0
  676. package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useMenus.ts +34 -0
  677. package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +52 -0
  678. package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useReservation.ts +49 -0
  679. package/skills/wix-headless-templates/restaurants/project/src/layouts/Layout.astro +22 -0
  680. package/skills/wix-headless-templates/restaurants/project/src/layouts/SiteLayout.astro +47 -0
  681. package/skills/wix-headless-templates/restaurants/project/src/pages/index.astro +8 -0
  682. package/skills/wix-headless-templates/restaurants/project/src/pages/menu.astro +22 -0
  683. package/skills/wix-headless-templates/restaurants/project/src/pages/reservations.astro +12 -0
  684. package/skills/wix-headless-templates/restaurants/project/src/styles/global.css +57 -0
  685. package/skills/wix-headless-templates/restaurants/project/src/wix/config.ts +16 -0
  686. package/skills/wix-headless-templates/restaurants/project/src/wix/media.ts +106 -0
  687. package/skills/wix-headless-templates/restaurants/project/src/wix/money.ts +24 -0
  688. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-core.ts +333 -0
  689. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-store.ts +89 -0
  690. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +109 -0
  691. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +141 -0
  692. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +287 -0
  693. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +237 -0
  694. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservation-store.ts +279 -0
  695. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations-core.ts +218 -0
  696. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations.ts +109 -0
  697. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/time-core.ts +118 -0
  698. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +337 -0
  699. package/skills/wix-headless-templates/restaurants/project/src/wix/sdk.ts +89 -0
  700. package/skills/wix-headless-templates/restaurants/project/tsconfig.json +5 -0
  701. package/skills/wix-headless-templates/restaurants/rest/menu.ts +96 -0
  702. package/skills/wix-headless-templates/restaurants/rest/ordering.ts +222 -0
  703. package/skills/wix-headless-templates/restaurants/rest/reservations.ts +102 -0
  704. package/skills/wix-headless-templates/restaurants/seed/SEED.md +118 -0
  705. package/skills/wix-headless-templates/restaurants/seed/read-site.mjs +25 -0
  706. package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +577 -0
  707. package/skills/wix-headless-templates/shared/CONTENT.md +22 -0
  708. package/skills/wix-headless-templates/shared/CUSTOM_OPERATIONS.md +100 -0
  709. package/skills/wix-headless-templates/shared/DESIGN.md +37 -0
  710. package/skills/wix-headless-templates/shared/SUPPLIED-CONTENT.md +27 -0
  711. package/skills/wix-headless-templates/shared/app/styles/global.css +57 -0
  712. package/skills/wix-headless-templates/shared/app/wix/config.ts +16 -0
  713. package/skills/wix-headless-templates/shared/app/wix/media.ts +106 -0
  714. package/skills/wix-headless-templates/shared/app/wix/money.ts +24 -0
  715. package/skills/wix-headless-templates/shared/app/wix/sdk.ts +89 -0
  716. package/skills/wix-headless-templates/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
  717. package/skills/wix-headless-templates/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +69 -0
  718. package/skills/wix-headless-templates/shared/capabilities/site-search/INSTRUCTIONS.md +194 -0
  719. package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchBox.tsx +136 -0
  720. package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchHit.tsx +50 -0
  721. package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchResults.tsx +300 -0
  722. package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSearch.ts +31 -0
  723. package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSuggest.ts +26 -0
  724. package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-core.ts +520 -0
  725. package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-store.ts +235 -0
  726. package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search.ts +80 -0
  727. package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/suggest-store.ts +178 -0
  728. package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/types.ts +158 -0
  729. package/skills/wix-headless-templates/shared/capabilities/site-search/app-astro/pages/search.astro +33 -0
  730. package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +82 -0
  731. package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +43 -0
  732. package/skills/wix-headless-templates/shared/rest/client.ts +155 -0
  733. package/skills/wix-headless-templates/shared/rest/config.ts +4 -0
  734. package/skills/wix-headless-templates/shared/rest/media.ts +92 -0
  735. package/skills/wix-headless-templates/shared/seed/images.mjs +183 -0
  736. package/skills/wix-headless-templates/shared/seed/read-site.mjs +97 -0
  737. package/skills/wix-headless-templates/shared/seed/site-context.mjs +70 -0
  738. package/skills/wix-headless-templates/shared/seed/site.mjs +48 -0
  739. package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +44 -0
  740. package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +685 -0
  741. package/skills/wix-headless-templates/storefront/app/components/storefront/CartButton.tsx +26 -0
  742. package/skills/wix-headless-templates/storefront/app/components/storefront/CartDrawer.tsx +239 -0
  743. package/skills/wix-headless-templates/storefront/app/components/storefront/FilterPanel.tsx +267 -0
  744. package/skills/wix-headless-templates/storefront/app/components/storefront/OptionPicker.tsx +171 -0
  745. package/skills/wix-headless-templates/storefront/app/components/storefront/QuickAdd.tsx +148 -0
  746. package/skills/wix-headless-templates/storefront/app/hooks/storefront/useCart.ts +59 -0
  747. package/skills/wix-headless-templates/storefront/app/hooks/storefront/useProductDetail.ts +42 -0
  748. package/skills/wix-headless-templates/storefront/app/hooks/storefront/useShop.ts +34 -0
  749. package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-core.ts +220 -0
  750. package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-store.ts +134 -0
  751. package/skills/wix-headless-templates/storefront/app/wix/storefront/cart.ts +187 -0
  752. package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog-core.ts +698 -0
  753. package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog.ts +260 -0
  754. package/skills/wix-headless-templates/storefront/app/wix/storefront/product-detail-store.ts +280 -0
  755. package/skills/wix-headless-templates/storefront/app/wix/storefront/shop-store.ts +341 -0
  756. package/skills/wix-headless-templates/storefront/app/wix/storefront/types.ts +305 -0
  757. package/skills/wix-headless-templates/storefront/app-astro/layouts/SiteLayout.astro +65 -0
  758. package/skills/wix-headless-templates/storefront/project/README.md +15 -0
  759. package/skills/wix-headless-templates/storefront/project/astro.config.mjs +22 -0
  760. package/skills/wix-headless-templates/storefront/project/package-lock.json +10786 -0
  761. package/skills/wix-headless-templates/storefront/project/package.json +41 -0
  762. package/skills/wix-headless-templates/storefront/project/public/favicon.svg +9 -0
  763. package/skills/wix-headless-templates/storefront/project/src/assets/astro.svg +1 -0
  764. package/skills/wix-headless-templates/storefront/project/src/assets/background.svg +1 -0
  765. package/skills/wix-headless-templates/storefront/project/src/assets/wix.svg +18 -0
  766. package/skills/wix-headless-templates/storefront/project/src/components/Hero.astro +77 -0
  767. package/skills/wix-headless-templates/storefront/project/src/components/Welcome.astro +95 -0
  768. package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartButton.tsx +26 -0
  769. package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartDrawer.tsx +239 -0
  770. package/skills/wix-headless-templates/storefront/project/src/components/storefront/FilterPanel.tsx +267 -0
  771. package/skills/wix-headless-templates/storefront/project/src/components/storefront/OptionPicker.tsx +171 -0
  772. package/skills/wix-headless-templates/storefront/project/src/components/storefront/QuickAdd.tsx +148 -0
  773. package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useCart.ts +59 -0
  774. package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useProductDetail.ts +42 -0
  775. package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useShop.ts +34 -0
  776. package/skills/wix-headless-templates/storefront/project/src/layouts/Layout.astro +22 -0
  777. package/skills/wix-headless-templates/storefront/project/src/layouts/SiteLayout.astro +65 -0
  778. package/skills/wix-headless-templates/storefront/project/src/pages/index.astro +8 -0
  779. package/skills/wix-headless-templates/storefront/project/src/styles/global.css +57 -0
  780. package/skills/wix-headless-templates/storefront/project/src/wix/config.ts +16 -0
  781. package/skills/wix-headless-templates/storefront/project/src/wix/media.ts +106 -0
  782. package/skills/wix-headless-templates/storefront/project/src/wix/money.ts +24 -0
  783. package/skills/wix-headless-templates/storefront/project/src/wix/sdk.ts +89 -0
  784. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-core.ts +220 -0
  785. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-store.ts +134 -0
  786. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart.ts +187 -0
  787. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog-core.ts +698 -0
  788. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog.ts +260 -0
  789. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/product-detail-store.ts +280 -0
  790. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/shop-store.ts +341 -0
  791. package/skills/wix-headless-templates/storefront/project/src/wix/storefront/types.ts +305 -0
  792. package/skills/wix-headless-templates/storefront/project/tsconfig.json +5 -0
  793. package/skills/wix-headless-templates/storefront/rest/cart.ts +183 -0
  794. package/skills/wix-headless-templates/storefront/rest/catalog.ts +267 -0
  795. package/skills/wix-headless-templates/storefront/seed/SEED.md +169 -0
  796. package/skills/wix-headless-templates/storefront/seed/read-site.mjs +38 -0
  797. package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +839 -0
  798. package/skills/wix-manage/SKILL.md +11 -7
  799. package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +1 -1
  800. package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +206 -0
  801. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +17 -24
  802. package/skills/wix-manage/references/sites/create-headless-site.md +2 -0
  803. package/skills/wix-manage/references/sites/upload-static-site.md +262 -171
  804. package/skills/wix-manage/references/stores/update-product-with-options.md +1 -1
  805. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +0 -184
  806. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +0 -204
  807. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +0 -44
  808. package/skills/wix-headless/entry/bootstrap.mjs +0 -156
  809. package/skills/wix-headless/entry/skill.md +0 -78
  810. package/skills/wix-headless-kit/cold-start/bootstrap.mjs +0 -156
  811. package/skills/wix-headless-kit/cold-start/cold-start.md +0 -111
  812. package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +0 -423
@@ -0,0 +1,141 @@
1
+ // Client-side order-cart state — a module-scope store, deliberately NOT a React context.
2
+ // A context can't span Astro islands (each island is its own React root); a module singleton
3
+ // is shared by every island in the page bundle, and works identically in a single-root SPA.
4
+ // Consume it through useOrderCart() (hooks/), or subscribe directly. Besides the cart it holds
5
+ // the site's ordering gates: the operation's state and each menu's ordering settings, so an add
6
+ // control can read "accepting orders?" and "is THIS menu orderable now?" without a fetch of its own.
7
+ import type { FulfillmentMethodInfo, MenuItem, MenuOrderingInfo, OrderCart, OrderSelection, OrderingStatus } from "./types";
8
+ import { menuOrderable } from "./ordering-core";
9
+ import {
10
+ addToOrder as apiAdd,
11
+ fetchFulfillmentMethods,
12
+ fetchMenuOrdering,
13
+ fetchOrderCart,
14
+ orderCheckoutUrl,
15
+ removeOrderLine as apiRemove,
16
+ resolveOrdering,
17
+ updateOrderQuantity as apiUpdate,
18
+ } from "./ordering";
19
+
20
+ export interface OrderCartState {
21
+ cart: OrderCart | null;
22
+ /** null while resolving; true only for an ENABLED operation; false → no ordering, disabled, or paused. */
23
+ ordering: boolean | null;
24
+ /** The operation's state (why `ordering` is false: NONE / DISABLED / PAUSED_UNTIL + pausedUntilIso). null while resolving. */
25
+ orderingStatus: OrderingStatus | null;
26
+ /** Per-menu ordering settings under the operation, keyed by menuId; null while loading or when unreadable. */
27
+ menuOrdering: Record<string, MenuOrderingInfo> | null;
28
+ /** The operation's enabled pickup/delivery methods, for display; null while loading. */
29
+ fulfillment: FulfillmentMethodInfo[] | null;
30
+ /**
31
+ * True while any cart operation is in flight — the DRAWER's flag (its steppers, remove and
32
+ * checkout controls), not a dish card's: a card disables its own add control on `pendingItemId`,
33
+ * or every dish in the grid dims for every add.
34
+ */
35
+ busy: boolean;
36
+ /** The menu item whose add is in flight, null otherwise — what a dish card's add control binds to. */
37
+ pendingItemId: string | null;
38
+ /** Last failed operation's message — render it; a new operation clears it. */
39
+ error: string | null;
40
+ /** Order drawer visibility (OrderCartButton opens it, OrderCartDrawer renders by it). */
41
+ open: boolean;
42
+ }
43
+
44
+ const EMPTY: OrderCartState = { cart: null, ordering: null, orderingStatus: null, menuOrdering: null, fulfillment: null, busy: false, pendingItemId: null, error: null, open: false };
45
+
46
+ let state: OrderCartState = EMPTY;
47
+ const listeners = new Set<() => void>();
48
+ let loaded = false;
49
+
50
+ function setState(patch: Partial<OrderCartState>): void {
51
+ state = { ...state, ...patch };
52
+ for (const l of listeners) l();
53
+ }
54
+
55
+ export function getOrderCartState(): OrderCartState {
56
+ return state;
57
+ }
58
+
59
+ export function subscribeOrderCart(listener: () => void): () => void {
60
+ listeners.add(listener);
61
+ // First subscriber triggers the initial load (browser only — SSR renders the empty state).
62
+ if (!loaded && typeof window !== "undefined") {
63
+ loaded = true;
64
+ void refreshOrderCart();
65
+ void resolveOrdering().then((s) => setState({ ordering: s.status === "ENABLED", orderingStatus: s }));
66
+ void fetchMenuOrdering().then((m) => setState({ menuOrdering: m })).catch(() => setState({ menuOrdering: null }));
67
+ void fetchFulfillmentMethods().then((f) => setState({ fulfillment: f }));
68
+ }
69
+ return () => listeners.delete(listener);
70
+ }
71
+
72
+ /**
73
+ * Can dishes of `menuId` be added right now? false when the menu isn't enabled for online
74
+ * ordering under the operation or is outside its availability window (render no add control);
75
+ * null while the settings are still loading or could not be read — treat null as "try" (the add
76
+ * itself is refused server-side with a message).
77
+ */
78
+ export function isMenuOrderable(menuId: string): boolean | null {
79
+ return menuOrderable(state.menuOrdering, menuId);
80
+ }
81
+
82
+ async function run(op: () => Promise<OrderCart>): Promise<void> {
83
+ setState({ busy: true, error: null });
84
+ try {
85
+ setState({ cart: await op(), busy: false });
86
+ } catch (e) {
87
+ setState({ busy: false, error: e instanceof Error ? e.message : String(e) });
88
+ throw e;
89
+ }
90
+ }
91
+
92
+ export async function refreshOrderCart(): Promise<void> {
93
+ try {
94
+ setState({ cart: await fetchOrderCart() });
95
+ } catch {
96
+ /* no cart yet — leave the empty state */
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Add a dish (the MenuItem DTO as rendered, with the menu/section ids it is rendered under and
102
+ * the visitor's selection) to the order and open the drawer. Throws (and sets .error) on refusal.
103
+ */
104
+ export async function addOrderLine(
105
+ item: MenuItem,
106
+ context: { menuId: string; sectionId: string },
107
+ quantity = 1,
108
+ selection?: OrderSelection,
109
+ ): Promise<void> {
110
+ setState({ pendingItemId: item.id });
111
+ try {
112
+ await run(() => apiAdd(item, context, quantity, selection));
113
+ } finally {
114
+ setState({ pendingItemId: null });
115
+ }
116
+ setState({ open: true });
117
+ }
118
+
119
+ export async function updateOrderLineQuantity(lineItemId: string, quantity: number): Promise<void> {
120
+ await run(() => apiUpdate(lineItemId, quantity));
121
+ }
122
+
123
+ export async function removeLineFromOrder(lineItemId: string): Promise<void> {
124
+ await run(() => apiRemove(lineItemId));
125
+ }
126
+
127
+ /** Navigate to the Wix-hosted checkout. Never hand-build a checkout URL. */
128
+ export async function goToOrderCheckout(): Promise<void> {
129
+ setState({ busy: true, error: null });
130
+ try {
131
+ const url = await orderCheckoutUrl();
132
+ window.location.href = url;
133
+ } catch (e) {
134
+ setState({ busy: false, error: e instanceof Error ? e.message : String(e) });
135
+ throw e;
136
+ }
137
+ }
138
+
139
+ export function setOrderCartOpen(open: boolean): void {
140
+ setState({ open });
141
+ }
@@ -0,0 +1,287 @@
1
+ // Online-ordering rules and DTO mapping — transport-agnostic, imported by both ./ordering.ts (SDK)
2
+ // and the REST twin in templates/restaurants/rest/ordering.ts (fetch). The restaurant cart rides
3
+ // on the eCom current cart (Cart V2); what makes a line a RESTAURANT line is the catalogReference
4
+ // built here: the Orders app id plus options { operationId, menuId, sectionId } and, exactly as
5
+ // Wix's own ordering code sends them, the visitor's choices: options.priceVariant { id,
6
+ // formattedPrice }, options.modifierGroups [{ id, modifiers: [{ id, price, formattedPrice }] }],
7
+ // options.specialRequests. Raw entities carry `_id` (SDK) or `id` (REST). Has its own formatMoney
8
+ // (a copy of ../money.ts) so it stands alone when stripped. Imports are type-only except the zone
9
+ // helpers from ./time-core (deployed beside this file).
10
+ import type { FulfillmentMethodInfo, MenuItem, MenuOrderingInfo, OrderCart, OrderLine, OrderSelection, OrderingStatus, SiteMoney, WeeklyWindow } from "./types";
11
+ import type { ImgSrc, Raw } from "./menu-core";
12
+ import { zonedMinutes, zonedParts } from "./time-core";
13
+
14
+ /** The Restaurants Orders app id — every restaurant cart line's catalogReference.appId. */
15
+ export const RESTAURANTS_ORDERS_APP_ID = "9a5d83fd-8570-482e-81ab-cfa88942ee60";
16
+
17
+ export const rawId = (raw: Raw | undefined | null): string => raw?._id ?? raw?.id ?? "";
18
+
19
+ /**
20
+ * Cart V2 money is ConvertedMoney { amount, convertedAmount } with NO formatted string, and the
21
+ * currency lives on the cart, not on the money. "" when the currency is unknown — never a guessed
22
+ * symbol, never a USD default.
23
+ */
24
+ export function formatMoney(money: Raw | null | undefined, currencyCode: string | null | undefined): string {
25
+ const value = money?.convertedAmount ?? money?.amount;
26
+ if (value == null || value === "" || !currencyCode) return "";
27
+ try {
28
+ return new Intl.NumberFormat(undefined, { style: "currency", currency: currencyCode }).format(Number(value));
29
+ } catch {
30
+ return `${value} ${currencyCode}`;
31
+ }
32
+ }
33
+
34
+ /** A site-currency decimal ("5", "0") formatted for display; "" when zero or the currency is unknown. */
35
+ function formatAmount(amount: string | null | undefined, money: SiteMoney): string {
36
+ const n = Number(amount ?? 0);
37
+ if (!Number.isFinite(n) || n <= 0 || !money.currency) return "";
38
+ try {
39
+ return new Intl.NumberFormat(money.locale || undefined, { style: "currency", currency: money.currency }).format(n);
40
+ } catch {
41
+ return `${n.toFixed(2)} ${money.currency}`;
42
+ }
43
+ }
44
+
45
+ export const cartCurrency = (raw: Raw | null | undefined): string =>
46
+ raw?.customerInfo?.currencyCode ?? raw?.businessInfo?.currencyCode ?? "";
47
+
48
+ // ---- operation ----------------------------------------------------------------------------------------------
49
+
50
+ const NO_ORDERING: OrderingStatus = { operationId: null, status: "NONE", pausedUntilIso: null, timeZone: "", fulfillmentIds: [], defaultFulfillmentType: null };
51
+
52
+ const isoOf = (v: unknown): string | null => {
53
+ if (!v) return null;
54
+ const d = v instanceof Date ? v : new Date(String(v));
55
+ return Number.isNaN(d.getTime()) ? null : d.toISOString();
56
+ };
57
+
58
+ /**
59
+ * The operation to order through and its state: an ENABLED one, else the default, else the first.
60
+ * Only ENABLED accepts orders (Wix: AcceptingOrders = operation.enabled && a fulfillment); DISABLED
61
+ * and PAUSED_UNTIL (with `pausedUntilOptions.time`) refuse every add — surface the reason.
62
+ */
63
+ export function resolveOperation(operations: Raw[]): OrderingStatus {
64
+ const op = operations.find((o) => o.onlineOrderingStatus === "ENABLED") ?? operations.find((o) => o.default) ?? operations[0];
65
+ if (!op || !rawId(op)) return NO_ORDERING;
66
+ const raw = String(op.onlineOrderingStatus ?? "");
67
+ const status: OrderingStatus["status"] = raw === "ENABLED" ? "ENABLED" : raw === "PAUSED_UNTIL" ? "PAUSED_UNTIL" : "DISABLED";
68
+ return {
69
+ operationId: rawId(op),
70
+ status,
71
+ pausedUntilIso: status === "PAUSED_UNTIL" ? isoOf(op.pausedUntilOptions?.time) : null,
72
+ timeZone: op.businessLocationDetails?.timeZone ?? "",
73
+ fulfillmentIds: ((op.fulfillmentIds ?? []) as string[]).filter(Boolean),
74
+ defaultFulfillmentType: op.defaultFulfillmentType === "DELIVERY" ? "DELIVERY" : op.defaultFulfillmentType === "PICKUP" ? "PICKUP" : null,
75
+ };
76
+ }
77
+
78
+ /** Kept for callers that only need the id — null when the site has no operation at all. */
79
+ export function pickOperationId(operations: Raw[]): string | null {
80
+ return resolveOperation(operations).operationId;
81
+ }
82
+
83
+ // ---- menu ordering settings (per operation) ---------------------------------------------------------
84
+
85
+ const DAYS: WeeklyWindow["day"][] = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
86
+ const hhmm = (t: Raw | undefined): string => `${String(t?.hours ?? 0).padStart(2, "0")}:${String(t?.minutes ?? 0).padStart(2, "0")}`;
87
+
88
+ /** One menu's ordering settings entry → the DTO (availability windows normalised to "HH:mm" / ISO). */
89
+ export function toMenuOrdering(raw: Raw): MenuOrderingInfo {
90
+ const a: Raw = raw.availability ?? {};
91
+ const type = String(a.type ?? "");
92
+ return {
93
+ menuId: raw.menuId ?? "",
94
+ enabled: raw.onlineOrderingEnabled !== false,
95
+ availability: {
96
+ type: type === "ALWAYS_AVAILABLE" || type === "WEEKLY_SCHEDULE" || type === "TIMESTAMP_RANGES" ? type : "UNSPECIFIED",
97
+ timeZone: a.timeZone ?? "",
98
+ weekly: ((a.weeklyScheduleOptions?.availableTimes ?? []) as Raw[]).flatMap((d) =>
99
+ ((d.timeRanges ?? []) as Raw[]).map((r): WeeklyWindow => ({ day: String(d.dayOfWeek) as WeeklyWindow["day"], start: hhmm(r.startTime), end: hhmm(r.endTime) })),
100
+ ),
101
+ ranges: ((a.timestampRangesOptions?.ranges ?? []) as Raw[])
102
+ .map((r) => ({ startIso: isoOf(r.startTime) ?? "", endIso: isoOf(r.endTime) ?? "" }))
103
+ .filter((r) => r.startIso && r.endIso),
104
+ },
105
+ };
106
+ }
107
+
108
+ /** The operation's menu settings keyed by menuId. */
109
+ export function toMenuOrderingMap(raws: Raw[]): Record<string, MenuOrderingInfo> {
110
+ const out: Record<string, MenuOrderingInfo> = {};
111
+ for (const raw of raws) {
112
+ const info = toMenuOrdering(raw);
113
+ if (info.menuId) out[info.menuId] = info;
114
+ }
115
+ return out;
116
+ }
117
+
118
+ const toMinutes = (s: string): number => {
119
+ const [h, m] = s.split(":").map(Number);
120
+ return (h || 0) * 60 + (m || 0);
121
+ };
122
+
123
+ /** Whether the menu's availability window contains `now`, evaluated in the setting's own timezone. */
124
+ export function isMenuAvailable(info: MenuOrderingInfo, now: Date = new Date()): boolean {
125
+ const { availability: a } = info;
126
+ if (a.type === "TIMESTAMP_RANGES") {
127
+ const t = now.getTime();
128
+ return a.ranges.some((r) => new Date(r.startIso).getTime() <= t && t < new Date(r.endIso).getTime());
129
+ }
130
+ if (a.type !== "WEEKLY_SCHEDULE") return true; // ALWAYS_AVAILABLE, or an unspecified type: don't block on it
131
+ const parts = zonedParts(now, a.timeZone);
132
+ const minutes = zonedMinutes(now, a.timeZone);
133
+ const today = DAYS[parts.weekday];
134
+ const yesterday = DAYS[(parts.weekday + 6) % 7];
135
+ return a.weekly.some((w) => {
136
+ const start = toMinutes(w.start), end = toMinutes(w.end);
137
+ if (w.day === today) return end > start ? start <= minutes && minutes < end : minutes >= start || minutes < end;
138
+ // a window that wraps past midnight also covers the early hours of the next day
139
+ return w.day === yesterday && end <= start && minutes < end;
140
+ });
141
+ }
142
+
143
+ /**
144
+ * Can dishes of `menuId` be added right now? true/false once the operation's menu settings are
145
+ * known; null while they are still loading or could not be read (the add itself is still refused
146
+ * server-side, with a message). A menu with no entry under the operation is not orderable.
147
+ */
148
+ export function menuOrderable(map: Record<string, MenuOrderingInfo> | null, menuId: string, now: Date = new Date()): boolean | null {
149
+ if (!map) return null;
150
+ const info = map[menuId];
151
+ return !!info && info.enabled && isMenuAvailable(info, now);
152
+ }
153
+
154
+ // ---- fulfillment methods ----------------------------------------------------------------------------------
155
+
156
+ /** The operation's enabled pickup/delivery methods (operation.fulfillmentIds, `enabled`), money formatted. */
157
+ export function toFulfillmentMethods(raws: Raw[], fulfillmentIds: string[], money: SiteMoney): FulfillmentMethodInfo[] {
158
+ const wanted = new Set(fulfillmentIds);
159
+ return raws
160
+ .filter((m) => m.enabled === true && wanted.has(rawId(m)))
161
+ .map((m): FulfillmentMethodInfo => ({
162
+ id: rawId(m),
163
+ type: m.type === "DELIVERY" ? "DELIVERY" : "PICKUP",
164
+ name: m.name ?? "",
165
+ fee: formatAmount(m.fee, money),
166
+ feeAmount: m.fee ?? "0",
167
+ minOrderPrice: formatAmount(m.minOrderPrice, money),
168
+ minOrderPriceAmount: m.minOrderPrice ?? "0",
169
+ }));
170
+ }
171
+
172
+ // ---- cart --------------------------------------------------------------------------------------------------------
173
+
174
+ export function toOrderLine(raw: Raw, currency: string, imgSrc: ImgSrc): OrderLine {
175
+ return {
176
+ lineItemId: rawId(raw), // the LINE id — what update/remove take, never the menu item id
177
+ itemName: raw.name?.original ?? "",
178
+ quantity: raw.quantityInfo?.confirmedQuantity ?? 0,
179
+ unitPrice: formatMoney(raw.pricing?.unitPrice, currency),
180
+ linePrice: formatMoney(raw.pricing?.totalPrice, currency),
181
+ imageUrl: imgSrc(raw.attributes?.image, 300, 300),
182
+ descriptionLines: ((raw.attributes?.descriptionLines ?? []) as Raw[])
183
+ .map((d) => {
184
+ const label = d.name?.original ?? "", value = d.plainText?.original ?? d.colorInfo?.original ?? "";
185
+ return label && value ? `${label}: ${value}` : value || label;
186
+ })
187
+ .filter(Boolean),
188
+ status: raw.status ?? "IN_STOCK", // not IN_STOCK → the line can't be checked out as-is
189
+ };
190
+ }
191
+
192
+ export function toOrderCart(raw: Raw | null, subtotal: string, imgSrc: ImgSrc): OrderCart {
193
+ const currency = cartCurrency(raw);
194
+ const lines = ((raw?.lineItems ?? []) as Raw[]).map((l) => toOrderLine(l, currency, imgSrc));
195
+ return { lines, itemCount: lines.reduce((n, l) => n + l.quantity, 0), subtotal, currency };
196
+ }
197
+
198
+ /** The after-discount subtotal from a cart estimate; "" when unknown. Fees, tax, delivery resolve at checkout. */
199
+ export function estimateSubtotal(estimate: Raw | null | undefined, raw: Raw): string {
200
+ return formatMoney(estimate?.summary?.priceSummary?.subtotal, cartCurrency(raw));
201
+ }
202
+
203
+ /** The line-refusal reasons an add can't recover from — checked before any call. */
204
+ export function assertOrderContext(itemId: string, menuId: string, sectionId: string): void {
205
+ if (!itemId || !menuId || !sectionId) throw new Error("addToOrder needs the item, menu, and section ids.");
206
+ }
207
+
208
+ /** Reject a dish that can't be ordered before any call is made — the message is what the visitor reads. */
209
+ export function assertOrderable(item: Pick<MenuItem, "marketPrice" | "soldOut" | "name">): void {
210
+ if (item.marketPrice) throw new Error(`${item.name || "This dish"} is priced at the counter and can't be ordered online.`);
211
+ if (item.soldOut) throw new Error(`${item.name || "This dish"} is sold out.`);
212
+ }
213
+
214
+ /**
215
+ * The one catalogItems entry of an add — the Orders app id, the three context ids, and the
216
+ * visitor's choices in the exact option keys Wix's ordering sends: `priceVariant` (id + its
217
+ * formatted price), `modifierGroups` (the entity ids — a selection KEY resolves back to its id —
218
+ * each with `price` as the decimal up-charge and `formattedPrice` only when charged), and
219
+ * `specialRequests` when the item accepts one. Formatted strings are the DTO's (site currency).
220
+ */
221
+ export function orderCatalogItem(
222
+ item: MenuItem,
223
+ ctx: { operationId: string; menuId: string; sectionId: string },
224
+ quantity: number,
225
+ selection: OrderSelection,
226
+ ): Raw {
227
+ const variant = item.variants.find((v) => v.variantId === selection.variantId);
228
+ const modifierGroups = item.modifierGroups
229
+ .map((g) => ({
230
+ id: g.id,
231
+ modifiers: (selection.modifiers[g.id] ?? [])
232
+ .map((key) => g.modifiers.find((m) => m.key === key))
233
+ .filter((m): m is MenuItem["modifierGroups"][number]["modifiers"][number] => !!m)
234
+ .map((m) => ({ id: m.id, price: m.additionalChargeAmount, ...(Number(m.additionalChargeAmount) > 0 && m.additionalCharge ? { formattedPrice: m.additionalCharge } : {}) })),
235
+ }))
236
+ .filter((g) => g.modifiers.length > 0);
237
+ const note = item.acceptsSpecialRequests ? selection.specialRequest.trim() : "";
238
+ return {
239
+ quantity,
240
+ catalogReference: {
241
+ catalogItemId: item.id,
242
+ appId: RESTAURANTS_ORDERS_APP_ID,
243
+ options: {
244
+ operationId: ctx.operationId,
245
+ menuId: ctx.menuId,
246
+ sectionId: ctx.sectionId,
247
+ ...(variant ? { priceVariant: { id: variant.variantId, formattedPrice: variant.price } } : {}),
248
+ ...(modifierGroups.length ? { modifierGroups } : {}),
249
+ ...(note ? { specialRequests: note } : {}),
250
+ },
251
+ },
252
+ };
253
+ }
254
+
255
+ /** Read the add result — a refused add still returns 200: a line whose status isn't IN_STOCK, or no line, is a refusal. */
256
+ export function assertOrderAdded(cart: Raw | null | undefined, itemId: string): void {
257
+ // V2 nests the reference under `source` — a top-level lineItem.catalogReference no longer exists.
258
+ const line = ((cart?.lineItems ?? []) as Raw[]).find((l) => l.source?.catalogReference?.catalogItemId === itemId);
259
+ if (line?.status && line.status !== "IN_STOCK") {
260
+ throw new Error(`This dish isn't available right now (${String(line.status).toLowerCase().replace(/_/g, " ")}).`);
261
+ }
262
+ if (!line || line.quantityInfo?.confirmedQuantity === 0) {
263
+ throw new Error("The dish couldn't be added to the order — please try again.");
264
+ }
265
+ }
266
+
267
+ /** Refuse checkout for an empty order or any line not IN_STOCK — say which. */
268
+ export function assertOrderCheckoutable(raw: Raw | null): void {
269
+ const lines: Raw[] = raw?.lineItems ?? [];
270
+ if (!lines.length) throw new Error("Your order is empty.");
271
+ const unavailable = lines.filter((l) => l.status && l.status !== "IN_STOCK");
272
+ if (unavailable.length) {
273
+ throw new Error(`Some dishes are no longer available: ${unavailable.map((l) => l.name?.original).filter(Boolean).join(", ")}.`);
274
+ }
275
+ if (!rawId(raw)) throw new Error("Checkout couldn't start: the order has no id.");
276
+ }
277
+
278
+ /** The message an add control shows when the operation refuses orders; "" when it accepts them. */
279
+ export function orderingUnavailableReason(status: OrderingStatus | null): string {
280
+ if (!status) return "";
281
+ switch (status.status) {
282
+ case "ENABLED": return "";
283
+ case "PAUSED_UNTIL": return "Ordering is paused right now";
284
+ case "DISABLED": return "Ordering unavailable";
285
+ default: return "Ordering unavailable";
286
+ }
287
+ }
@@ -0,0 +1,237 @@
1
+ // Online ordering (Restaurants Orders + Wix eCom Cart V2) over the SDK — the only file that
2
+ // touches the raw cart, operation, and settings entities on this transport. Rules and mappers
3
+ // live in ./ordering-core (shared with the REST twin in templates/restaurants/rest/); this file is
4
+ // the transport only. Copy as-is; extend by calling these exports, never by editing them. The
5
+ // request shapes are exact and rewriting them is how carts break:
6
+ // - the catalogReference appId is the ORDERS app (9a5d83fd-…), never the Stores id;
7
+ // - options MUST carry operationId + menuId + sectionId (all three);
8
+ // - the visitor's choices ride in options.priceVariant / options.modifierGroups /
9
+ // options.specialRequests, the keys Wix's own ordering code sends (built in ordering-core).
10
+ // Failures are loud: throws on a missing or paused ordering operation, an invalid selection,
11
+ // unavailable lines, and an empty order at checkout — surface the message, don't swallow it.
12
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/list-operations.md
13
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/menu-ordering-settings/query-menu-ordering-settings.md
14
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/list-fulfillment-methods.md
15
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/list-items.md
16
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/get-current-cart.md
17
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/add-line-items-to-current-cart.md
18
+ // docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/update-line-items.md
19
+ // docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
20
+ import {
21
+ operations as operationsModule,
22
+ fulfillmentMethods as fulfillmentModule,
23
+ menuOrderingSettings as menuSettingsModule,
24
+ items as itemsModule,
25
+ } from "@wix/restaurants";
26
+ import { currentCartV2 } from "@wix/ecom";
27
+ import { redirects as redirectsModule } from "@wix/redirects";
28
+ import { wixModule } from "../sdk";
29
+ import { imgSrc } from "../media";
30
+ import { fetchSiteMoney } from "./menu";
31
+ import { initialSelection, nextCursor, validateSelection, type Raw } from "./menu-core";
32
+ import {
33
+ RESTAURANTS_ORDERS_APP_ID,
34
+ assertOrderAdded,
35
+ assertOrderCheckoutable,
36
+ assertOrderContext,
37
+ assertOrderable,
38
+ estimateSubtotal,
39
+ orderCatalogItem,
40
+ rawId,
41
+ resolveOperation,
42
+ toFulfillmentMethods,
43
+ toMenuOrderingMap,
44
+ toOrderCart,
45
+ } from "./ordering-core";
46
+ import type { FulfillmentMethodInfo, MenuItem, MenuOrderingInfo, OrderCart, OrderSelection, OrderingStatus } from "./types";
47
+
48
+ export { RESTAURANTS_ORDERS_APP_ID };
49
+
50
+ const operationsApi = wixModule(operationsModule);
51
+ const fulfillmentApi = wixModule(fulfillmentModule);
52
+ const menuSettingsApi = wixModule(menuSettingsModule);
53
+ const itemsApi = wixModule(itemsModule);
54
+ const cartApi = wixModule(currentCartV2);
55
+ const redirects = wixModule(redirectsModule);
56
+
57
+ // The ordering operation is site config — resolve once, reuse for every add.
58
+ let orderingPromise: Promise<OrderingStatus> | null = null;
59
+
60
+ /**
61
+ * The operation to order through and its state (ENABLED, else the default, else the first).
62
+ * `status` "NONE" when the site has no online ordering configured; DISABLED / PAUSED_UNTIL refuse
63
+ * every add — the add control reads the reason from it.
64
+ */
65
+ export function resolveOrdering(): Promise<OrderingStatus> {
66
+ orderingPromise ??= operationsApi
67
+ .listOperations()
68
+ .then((res: Raw) => resolveOperation(res.operations ?? []))
69
+ .catch(() => {
70
+ orderingPromise = null; // transient failure — allow a retry on the next call
71
+ return resolveOperation([]);
72
+ });
73
+ return orderingPromise;
74
+ }
75
+
76
+ /** The id of the operation to order through — null when the site has none. */
77
+ export function resolveOperationId(): Promise<string | null> {
78
+ return resolveOrdering().then((s) => s.operationId);
79
+ }
80
+
81
+ /**
82
+ * Every menu's ordering settings under the operation, keyed by menuId: which menus take online
83
+ * orders and when (availability windows in their own timezone). A menu absent from the map is
84
+ * not orderable. {} when there is no operation.
85
+ */
86
+ export async function fetchMenuOrdering(): Promise<Record<string, MenuOrderingInfo>> {
87
+ const { operationId } = await resolveOrdering();
88
+ if (!operationId) return {};
89
+ const raws: Raw[] = [];
90
+ let page = await menuSettingsApi.queryMenuOrderingSettings().eq("operationId", operationId).find();
91
+ raws.push(...(page.items as Raw[]));
92
+ while (page.hasNext()) {
93
+ page = await page.next();
94
+ raws.push(...(page.items as Raw[]));
95
+ }
96
+ return toMenuOrderingMap(raws);
97
+ }
98
+
99
+ /**
100
+ * The operation's enabled pickup/delivery methods (operation.fulfillmentIds only), fees and
101
+ * minimums formatted in the site currency — for display; the buyer picks one on the hosted checkout.
102
+ */
103
+ export async function fetchFulfillmentMethods(): Promise<FulfillmentMethodInfo[]> {
104
+ try {
105
+ const [status, money] = await Promise.all([resolveOrdering(), fetchSiteMoney()]);
106
+ if (!status.fulfillmentIds.length) return [];
107
+ const raws: Raw[] = [];
108
+ let cursor: string | null = null;
109
+ do {
110
+ const res: Raw = await fulfillmentApi.listFulfillmentMethods(cursor ? { cursorPaging: { cursor } } : {});
111
+ raws.push(...((res.fulfillmentMethods ?? []) as Raw[]));
112
+ cursor = nextCursor(res);
113
+ } while (cursor);
114
+ return toFulfillmentMethods(raws, status.fulfillmentIds, money);
115
+ } catch {
116
+ return []; // display nicety — ordering still works without the list
117
+ }
118
+ }
119
+
120
+ // A line's attributes.image may come back absent — join the menu items' images by the line's
121
+ // catalogItemId and cache for the session.
122
+ const lineImageCache = new Map<string, string>();
123
+ async function fillLineImages(cart: OrderCart, raws: Raw[]): Promise<void> {
124
+ const wanted = new Map<string, number[]>(); // itemId -> line indexes
125
+ raws.forEach((raw, i) => {
126
+ if (cart.lines[i].imageUrl) return;
127
+ const itemId = raw.source?.catalogReference?.catalogItemId;
128
+ if (!itemId) return;
129
+ const cached = lineImageCache.get(itemId);
130
+ if (cached !== undefined) {
131
+ cart.lines[i].imageUrl = cached;
132
+ return;
133
+ }
134
+ wanted.set(itemId, [...(wanted.get(itemId) ?? []), i]);
135
+ });
136
+ if (!wanted.size) return;
137
+ try {
138
+ const res: Raw = await itemsApi.listItems({ itemIds: [...wanted.keys()] });
139
+ for (const item of (res.items ?? []) as Raw[]) {
140
+ const url = imgSrc(item.image, 300, 300);
141
+ lineImageCache.set(rawId(item), url);
142
+ for (const i of wanted.get(rawId(item)) ?? []) cart.lines[i].imageUrl = url;
143
+ }
144
+ } catch {
145
+ /* images are a nicety — the cart stays correct without them */
146
+ }
147
+ }
148
+
149
+ async function readCartWithSubtotal(raw: Raw | null): Promise<OrderCart> {
150
+ // Only estimate a cart WITH lines — on an absent/empty cart the endpoint returns 404.
151
+ if (!raw?.lineItems?.length) return toOrderCart(raw, "", imgSrc);
152
+ // The authoritative after-discount subtotal comes from the cart estimate, never from
153
+ // hand-summing line items (fees, tax, and delivery resolve at checkout).
154
+ let subtotal = "";
155
+ try {
156
+ subtotal = estimateSubtotal(await cartApi.estimateCurrentCart(), raw);
157
+ } catch {
158
+ /* estimate is a display nicety — the cart itself is still valid */
159
+ }
160
+ const cart = toOrderCart(raw, subtotal, imgSrc);
161
+ await fillLineImages(cart, raw.lineItems as Raw[]);
162
+ return cart;
163
+ }
164
+
165
+ /** Read the visitor's current order cart. An empty cart (not an error) when none exists yet. */
166
+ export async function fetchOrderCart(): Promise<OrderCart> {
167
+ try {
168
+ const { cart } = await cartApi.getCurrentCart();
169
+ return readCartWithSubtotal(cart as Raw);
170
+ } catch {
171
+ return toOrderCart(null, "", imgSrc);
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Add a dish to the current order. `item` is the MenuItem DTO as rendered; `menuId` and
177
+ * `sectionId` are the ids of the menu and section it is RENDERED UNDER — thread them from the
178
+ * render context (the fetchMenus tree), never re-derive them. `selection` is what the visitor
179
+ * chose (start from initialSelection(item)); omitted → the item's defaults. Throws when ordering
180
+ * isn't accepting, the dish can't be ordered, a modifier rule fails, or the line is refused.
181
+ */
182
+ export async function addToOrder(
183
+ item: MenuItem,
184
+ { menuId, sectionId }: { menuId: string; sectionId: string },
185
+ quantity = 1,
186
+ selection: OrderSelection = initialSelection(item),
187
+ ): Promise<OrderCart> {
188
+ const { operationId, status } = await resolveOrdering();
189
+ if (!operationId || status !== "ENABLED") throw new Error("Online ordering isn't available right now.");
190
+ assertOrderContext(item.id, menuId, sectionId);
191
+ assertOrderable(item);
192
+ const check = validateSelection(item, selection);
193
+ if (!check.ok) throw new Error(Object.values(check.errors)[0]);
194
+ const { cart } = await cartApi.addLineItemsToCurrentCart({
195
+ catalogItems: [orderCatalogItem(item, { operationId, menuId, sectionId }, quantity, selection)],
196
+ });
197
+ assertOrderAdded(cart as Raw, item.id);
198
+ return readCartWithSubtotal(cart as Raw);
199
+ }
200
+
201
+ /** Change a line's quantity. `lineItemId` is OrderLine.lineItemId, never the menu item id. */
202
+ export async function updateOrderQuantity(lineItemId: string, quantity: number): Promise<OrderCart> {
203
+ const { cart } = await cartApi.updateLineItemsInCurrentCart({
204
+ lineItems: [{ lineItemId, quantity: { newQuantity: quantity } }],
205
+ });
206
+ return readCartWithSubtotal(cart as Raw);
207
+ }
208
+
209
+ /** Remove a line from the order by OrderLine.lineItemId. */
210
+ export async function removeOrderLine(lineItemId: string): Promise<OrderCart> {
211
+ const { cart } = await cartApi.removeLineItemsFromCurrentCart([lineItemId]);
212
+ return readCartWithSubtotal(cart as Raw);
213
+ }
214
+
215
+ /**
216
+ * Start the Wix-hosted checkout for the current order and return the URL to navigate to.
217
+ * The cart's id IS the checkout id — no separate checkout-creation call. Fulfillment
218
+ * (pickup/delivery + time) and payment are collected on the hosted page. Call from the
219
+ * browser: the return origin must be window.location.origin (https), never a server-derived
220
+ * request origin (http behind the proxy → the return redirect 403s).
221
+ */
222
+ export async function orderCheckoutUrl(): Promise<string> {
223
+ const { cart } = await cartApi.getCurrentCart();
224
+ const raw = cart as Raw;
225
+ assertOrderCheckoutable(raw);
226
+ const origin = typeof window !== "undefined" ? window.location.origin : "";
227
+ const session = await redirects.createRedirectSession({
228
+ ecomCheckout: { checkoutId: rawId(raw) },
229
+ callbacks: {
230
+ postFlowUrl: origin ? `${origin}/` : undefined,
231
+ thankYouPageUrl: origin ? `${origin}/` : undefined,
232
+ },
233
+ });
234
+ const url = session?.redirectSession?.fullUrl;
235
+ if (!url) throw new Error("Checkout couldn't start: no redirect URL returned.");
236
+ return url;
237
+ }