@wix/agent-skills 1.19.2 → 1.20.1
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.
- package/package.json +1 -1
- package/skills/wix-app/references/SERVICE_PLUGIN.md +14 -1
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +7 -6
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +4 -0
- package/skills/wix-app/references/service-plugin/AVAILABILITY-TIME-SLOTS-CONFIGURATION.md +118 -0
- package/skills/wix-app/references/service-plugin/BOOKING-POLICY.md +65 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-PRICING.md +71 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +11 -3
- package/skills/wix-app/references/service-plugin/BOOKINGS-VALIDATION.md +137 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +23 -16
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +4 -2
- package/skills/wix-app/references/service-plugin/REALTIME-PERMISSIONS.md +45 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +15 -0
- package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +4 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +4 -0
- package/skills/wix-headless/references/CAPABILITIES.md +2 -2
- package/skills/wix-headless/references/inline-recipes/experience-store.md +4 -3
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +98 -18
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +8 -8
- package/skills/wix-headless-fast/SKILL.md +200 -34
- package/skills/wix-headless-fast/entry/skill.md +10 -2
- package/skills/wix-headless-fast/install/attach.mjs +253 -0
- package/skills/wix-headless-fast/install/deploy.mjs +109 -9
- package/skills/wix-headless-fast/install/fast-path.mjs +28 -31
- package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +224 -60
- package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +2 -3
- package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +2 -3
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +24 -116
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +16 -64
- package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +137 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +78 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +117 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +13 -60
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +47 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +10 -28
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +2 -4
- package/skills/wix-headless-fast/references/blog/rest/posts.ts +42 -0
- package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +62 -0
- package/skills/wix-headless-fast/references/blog/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +179 -33
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +2 -1
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +26 -132
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +18 -49
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +218 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +169 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +57 -142
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +92 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +90 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +22 -61
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +3 -1
- package/skills/wix-headless-fast/references/bookings/rest/booking.ts +113 -0
- package/skills/wix-headless-fast/references/bookings/rest/services.ts +55 -0
- package/skills/wix-headless-fast/references/bookings/seed/SEED.md +10 -0
- package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +236 -62
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +19 -52
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +16 -36
- package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +158 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +177 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +13 -41
- package/skills/wix-headless-fast/references/cms/rest/items.ts +125 -0
- package/skills/wix-headless-fast/references/cms/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +239 -83
- package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +1 -1
- package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +7 -5
- package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +2 -2
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +28 -110
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +19 -54
- package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +130 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +97 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +13 -94
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +113 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +156 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +38 -69
- package/skills/wix-headless-fast/references/events/rest/events.ts +57 -0
- package/skills/wix-headless-fast/references/events/rest/registration.ts +83 -0
- package/skills/wix-headless-fast/references/events/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +214 -26
- package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +35 -267
- package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +332 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +238 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +28 -243
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +216 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +32 -204
- package/skills/wix-headless-fast/references/forms/rest/forms.ts +34 -0
- package/skills/wix-headless-fast/references/forms/rest/submissions.ts +56 -0
- package/skills/wix-headless-fast/references/forms/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +15 -8
- package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +314 -63
- package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +1 -1
- package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +105 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +36 -65
- package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +1 -1
- package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +11 -32
- package/skills/wix-headless-fast/references/members/rest/auth.ts +215 -0
- package/skills/wix-headless-fast/references/members/rest/members.ts +26 -0
- package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +238 -59
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +2 -2
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +2 -2
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +8 -38
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +23 -50
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +16 -34
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +22 -49
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +31 -118
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +212 -51
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +9 -20
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +7 -32
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +12 -33
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +17 -34
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +106 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +7 -55
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +11 -34
- package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +31 -0
- package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +240 -47
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +2 -2
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +2 -2
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +14 -35
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +28 -171
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +155 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +23 -117
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +124 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +45 -114
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +193 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +94 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +15 -87
- package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +60 -0
- package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +169 -0
- package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +68 -0
- package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +23 -0
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +55 -1
- package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +13 -0
- package/skills/wix-headless-fast/references/shared/rest/client.ts +155 -0
- package/skills/wix-headless-fast/references/shared/rest/config.ts +3 -0
- package/skills/wix-headless-fast/references/shared/rest/media.ts +65 -0
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +371 -81
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +37 -3
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +266 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +95 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +136 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +29 -130
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +26 -182
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +121 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +53 -136
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +309 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +73 -230
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +147 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +289 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +62 -4
- package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +21 -2
- package/skills/wix-headless-fast/references/storefront/rest/cart.ts +132 -0
- package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +123 -0
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +25 -5
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +24 -0
- package/skills/wix-manage/SKILL.md +4 -1
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-manage/references/events/create-wix-event.md +46 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +51 -1
- package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +6 -6
- package/skills/wix-manage/references/seo/manage-seo-suggestions.md +351 -0
- package/skills/wix-vibe-headless/install/deploy.cjs +33 -2
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed-with-install.md +1 -1
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +13 -4
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +1 -1
- package/skills/wix-vibe-headless/platforms/base44.md +19 -4
- package/skills/wix-vibe-headless/platforms/generic.md +6 -0
- package/skills/wix-vibe-headless/references/_shared/nav/nav.tanstack.js +30 -0
- package/skills/wix-vibe-headless/references/_shared/routing.md +86 -0
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +44 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +1 -1
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +42 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +42 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +42 -0
- package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +1 -1
- package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +1 -1
- package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +43 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +1 -1
- package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +43 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +1 -1
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +1 -1
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +36 -0
- package/skills/wix-vibe-headless/references/shared/app/lib/nav.js +9 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +42 -41
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +7 -1
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +3 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +6 -0
- package/skills/wix-headless-fast/install/pin-agents-md.mjs +0 -57
|
@@ -107,6 +107,7 @@ export default function ProductCard({ product }) {
|
|
|
107
107
|
promoBadge, // { type: 'ribbon', label } | null — the primary ribbon, for a single-badge slot
|
|
108
108
|
priceDisplay, // the price the buyer pays (discounted when an automatic discount applies), or a min–max range
|
|
109
109
|
compareAtDisplay, // struck "was" price | null — never beside a range (the PDP shows the real comparison)
|
|
110
|
+
teaser, // plain-text description for the tile — plainDescription is HTML; never render it raw on a card
|
|
110
111
|
colors, // hex colour strings
|
|
111
112
|
optionLabel, // e.g. "3 sizes · 2 materials", or ""
|
|
112
113
|
isQuickAddable, // no product options and not sold out; does NOT check modifiers
|
|
@@ -234,24 +235,6 @@ export default function ProductDetail() {
|
|
|
234
235
|
- Render the PDP gallery from `images` — every image reachable (thumbnails, arrows, or a swipeable rail), not just the first; a single-image product gets no empty strip.
|
|
235
236
|
- `submit()` resets `adding` after completion and preserves the cart result: `undefined` on success, `null` on failure. Add failures live in `useCart().error`, not the PDP load `error`; the shipped drawer opens to display them.
|
|
236
237
|
|
|
237
|
-
For an optional **add and check out** shortcut, check the add result before checkout:
|
|
238
|
-
```jsx
|
|
239
|
-
// Inside ProductDetail, with the other hooks above any conditional returns:
|
|
240
|
-
const { checkout, loading: cartLoading } = useCart(); // named import from @/context/CartContext
|
|
241
|
-
async function addAndCheckout() {
|
|
242
|
-
if (!d.product || !d.canAdd || d.adding || cartLoading) return;
|
|
243
|
-
const result = await d.submit();
|
|
244
|
-
if (result === null) return; // add failed; preserve its error and do not check out the old cart
|
|
245
|
-
await checkout();
|
|
246
|
-
}
|
|
247
|
-
// <button disabled={!d.canAdd || d.adding || cartLoading} onClick={addAndCheckout}>Add and check out</button>
|
|
248
|
-
```
|
|
249
|
-
This adds to the shopper's **current cart** and checks that cart out — so label it that way. A true
|
|
250
|
-
**Buy Now** (skip the cart, buy just this item) needs a standalone cart handed to the redirect session;
|
|
251
|
-
it is not shipped, and routing "Buy now" through the current cart is wrong (it would carry whatever the
|
|
252
|
-
cart already holds). For direct `addToCart(...)` calls, use the same `result === null` check before checkout.
|
|
253
|
-
A resolved promise alone does not mean success; a truthiness check also rejects successful `undefined`.
|
|
254
|
-
|
|
255
238
|
### Variant and modifier controls
|
|
256
239
|
The product-detail example above provides both groups:
|
|
257
240
|
```js
|
|
@@ -265,7 +248,9 @@ The product-detail example above provides both groups:
|
|
|
265
248
|
// Text modifier: d.setModifier(m.key, text)
|
|
266
249
|
```
|
|
267
250
|
Retired option choices are filtered out. Respect each choice's `inStock` and modifier's
|
|
268
|
-
`mandatory` flag
|
|
251
|
+
`mandatory` flag. A choice with `isColorSwatch` renders as a **color swatch** filled with its
|
|
252
|
+
`colorCode` and labelled by its name — not as a text pill; the hook supplies the values and selection
|
|
253
|
+
state without prescribing the rest of the layout.
|
|
269
254
|
|
|
270
255
|
### Images
|
|
271
256
|
`useProductCard` returns normalized `image`/`hoverImage`, and `useProductDetail` returns normalized
|
|
@@ -341,13 +326,26 @@ currency; `convertedAmount` is in display currency. Format
|
|
|
341
326
|
back to `USD`). Use `summary.priceSummary.subtotal` (after discounts) with `cart.subtotal` as the
|
|
342
327
|
fallback while `summary` is null, a Discount row only when `priceSummary.discount` is above zero, and
|
|
343
328
|
line `pricing.totalPrice`; never sum lines yourself. Shipping and tax resolve at checkout — say
|
|
344
|
-
"calculated at checkout", never a hardcoded charge, threshold, or a made-up zero.
|
|
329
|
+
"calculated at checkout", never a hardcoded charge, threshold, or a made-up zero. The estimate's
|
|
330
|
+
`priceSummary.delivery`, `tax`, and `additionalFees` read `"0"` when nothing was calculated (verified
|
|
331
|
+
live), so a zero there is not "Free shipping" or "No tax" — don't render those rows from the estimate.
|
|
345
332
|
|
|
346
333
|
Line `quantityInfo.confirmedQuantity` is the current quantity; `availableQuantity` caps increases
|
|
347
334
|
when finite. `status` can be `IN_STOCK`, `PARTIALLY_IN_STOCK`, `OUT_OF_STOCK`, or
|
|
348
335
|
`REMOVED_FROM_CATALOG`; surface unavailable lines and prevent checkout until resolved.
|
|
349
336
|
|
|
350
337
|
## Routes and provider
|
|
338
|
+
|
|
339
|
+
> **The template decides this step, and `src/routes/__root.jsx` is the question to ask first.**
|
|
340
|
+
> Present → TanStack Start, which mounts these pages as route files at the end of this step; absent
|
|
341
|
+
> → React Router, which the wiring below is written for. Ask in that order: an `src/App.jsx` can
|
|
342
|
+
> exist on a TanStack app because an agent created one, and `__root.jsx` is never there by mistake.
|
|
343
|
+
> The installed `src/lib/nav.js` defaults to the React Router adapter, so on TanStack swap it:
|
|
344
|
+
> [both patterns](../_shared/routing.md).
|
|
345
|
+
>
|
|
346
|
+
> **Import `Link`, `useParams` and friends from `@/lib/nav` in the pages you write too** — same
|
|
347
|
+
> names as the router exports, and nothing you write is pinned to one template.
|
|
348
|
+
|
|
351
349
|
**No shipped source reads needed to wire this.** `CartDrawer` and `CartButton`
|
|
352
350
|
are default exports that take **no props**. `CartProvider` is a named export accepting `children`;
|
|
353
351
|
wire these exactly as shown below.
|
|
@@ -434,27 +432,30 @@ function Layout() {
|
|
|
434
432
|
}
|
|
435
433
|
```
|
|
436
434
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
435
|
+
|
|
436
|
+
### TanStack Start template — the same pages, mounted as files
|
|
437
|
+
|
|
438
|
+
Chrome (header, footer, the fixed banner region described above) goes in `src/routes/__root.jsx`
|
|
439
|
+
around its `<Outlet/>`, and any provider this vertical asks for wraps that `<Outlet/>` once. Each
|
|
440
|
+
route is a two-line file; shipped pages stay in `src/pages/` untouched.
|
|
441
|
+
|
|
442
|
+
| route | file | component |
|
|
443
|
+
|---|---|---|
|
|
444
|
+
| `/` | `src/routes/index.jsx` | `Home` |
|
|
445
|
+
| `/shop` | `src/routes/shop.jsx` | `Shop` |
|
|
446
|
+
| `/product/:slug` | `src/routes/product.$slug.jsx` | `ProductDetail` |
|
|
447
|
+
|
|
448
|
+
```jsx
|
|
449
|
+
// src/routes/shop.jsx
|
|
450
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
451
|
+
import Shop from "@/pages/Shop";
|
|
452
|
+
|
|
453
|
+
export const Route = createFileRoute("/shop")({ component: Shop });
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Path params are `$name` in both the filename and the route path; `useParams()` from `@/lib/nav`
|
|
457
|
+
reads them unchanged. Full pattern, including `ssr: false` for per-user routes:
|
|
458
|
+
[`../_shared/routing.md`](../_shared/routing.md).
|
|
458
459
|
|
|
459
460
|
## Missing capabilities
|
|
460
461
|
For anything these interfaces do not cover, consult the official Wix API documentation using
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// without touching the badge logic, price rules, or colour-dot extraction.
|
|
5
5
|
//
|
|
6
6
|
// Usage:
|
|
7
|
-
// const { isSoldOut, leftBadges, ribbons, promoBadge, priceDisplay, compareAtDisplay,
|
|
7
|
+
// const { isSoldOut, leftBadges, ribbons, promoBadge, priceDisplay, compareAtDisplay, teaser,
|
|
8
8
|
// colors, optionLabel, isQuickAddable, directAddVariantId, image, hoverImage } = useProductCard(product);
|
|
9
9
|
// // then render however you want; quick-add: addToCart(product.id, directAddVariantId) from useCart().
|
|
10
10
|
|
|
@@ -73,6 +73,11 @@ export function useProductCard(product) {
|
|
|
73
73
|
// The variant a direct add sends (a product with no options still has one variant).
|
|
74
74
|
const directAddVariantId = isQuickAddable ? minVariant?.id ?? null : null;
|
|
75
75
|
|
|
76
|
+
// plainDescription is an HTML string despite its name (<p>…</p>). A card wants plain text:
|
|
77
|
+
// strip the tags and cut at a word boundary, so no tile ever prints a literal "<p>".
|
|
78
|
+
const text = (product?.plainDescription || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
79
|
+
const teaser = text.length > 140 ? `${text.slice(0, 140).replace(/\s+\S*$/, "")}…` : text;
|
|
80
|
+
|
|
76
81
|
// Images: normalised through lib/storeImage so URLs are consistent across the tile,
|
|
77
82
|
// the PDP gallery, and the cart. Hover image is the second gallery shot (if one exists).
|
|
78
83
|
const image = productImage(product);
|
|
@@ -87,6 +92,7 @@ export function useProductCard(product) {
|
|
|
87
92
|
promoBadge, // { type: 'ribbon', label } | null — the primary ribbon, for a single-badge slot
|
|
88
93
|
priceDisplay, // formatted price the buyer pays, or a min–max range
|
|
89
94
|
compareAtDisplay, // formatted struck "was" price | null (never beside a range)
|
|
95
|
+
teaser, // plain-text description for the tile (tags stripped, ~140 chars) — never render plainDescription raw on a card
|
|
90
96
|
colors, // hex strings — render as dots; the tile shows up to however many you want
|
|
91
97
|
optionLabel, // "3 sizes · 2 materials" or empty string
|
|
92
98
|
isQuickAddable,
|
|
@@ -41,6 +41,9 @@ const result = await seed.setupStore(ctx, {
|
|
|
41
41
|
// currency: { requested, actual, status, warnings } }
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
A product `name` is at most **80 characters** — Wix rejects the whole batch over that, so keep
|
|
45
|
+
names short and put the detail in `description`.
|
|
46
|
+
|
|
44
47
|
The optional `currency` sets the site's payment currency before product creation. Pass it only when
|
|
45
48
|
the user explicitly asked for a currency, or when it's obvious for the store — otherwise omit it. Do
|
|
46
49
|
not infer a currency from the builder's country/region or the brief's language; when in doubt, leave
|
|
@@ -174,6 +174,12 @@ function buildOptions(options = []) {
|
|
|
174
174
|
function validateProducts(products) {
|
|
175
175
|
const seen = new Map();
|
|
176
176
|
for (const product of products) {
|
|
177
|
+
// Wix caps a product name at 80 characters and the bulk create rejects the WHOLE batch over it
|
|
178
|
+
// ("name has size 175, expected 80 or less"), so the 81st character costs the entire seed.
|
|
179
|
+
if (typeof product.name === "string" && product.name.length > 80) {
|
|
180
|
+
throw new Error(`Product "${product.name.slice(0, 48)}…": the name is ${product.name.length} characters and Wix allows 80. ` +
|
|
181
|
+
`Shorten it and move the detail into description. No products were created by this call.`);
|
|
182
|
+
}
|
|
177
183
|
if (product.inStock !== undefined && typeof product.inStock !== "boolean") {
|
|
178
184
|
throw new Error(`Product "${product.name}": inStock must be a boolean. No products were created by this call.`);
|
|
179
185
|
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Record what this project is in its agent instruction files, so a later session — which has
|
|
2
|
-
// none of the build conversation and may never open SKILL.md — still knows the Wix site is the
|
|
3
|
-
// source of truth and which skill answers which kind of question.
|
|
4
|
-
//
|
|
5
|
-
// node <SKILL_ROOT>/install/pin-agents-md.mjs --vertical <name> [--stack astro]
|
|
6
|
-
//
|
|
7
|
-
// Run from the project root. Kept out of deploy.mjs on purpose: "copy a vertical's files" and
|
|
8
|
-
// "record the project's ground rules" are separate concerns with separate reasons to change.
|
|
9
|
-
// APPENDS to each file — a template's or the user's own content is never overwritten — and is
|
|
10
|
-
// idempotent via the heading sentinel, so re-running fast-path.mjs writes at most once.
|
|
11
|
-
// Project facts that live in the repo (site id, app id) are NOT copied here; they would go
|
|
12
|
-
// stale against wix.config.json, which is the one place that owns them.
|
|
13
|
-
import { appendFileSync, existsSync, readFileSync } from "node:fs";
|
|
14
|
-
import { join } from "node:path";
|
|
15
|
-
|
|
16
|
-
const argv = process.argv.slice(2);
|
|
17
|
-
const flag = (n, d) => { const i = argv.indexOf(`--${n}`); return i >= 0 ? argv[i + 1] : d; };
|
|
18
|
-
|
|
19
|
-
const vertical = flag("vertical");
|
|
20
|
-
const stack = flag("stack", "astro");
|
|
21
|
-
// "astro" means the Wix-managed flavour (ambient auth), which is worth naming. Any other stack
|
|
22
|
-
// is echoed as given rather than mapped, so adding one can't silently mislabel the project.
|
|
23
|
-
const frontend = stack === "astro" ? "Wix-managed Astro" : stack.charAt(0).toUpperCase() + stack.slice(1);
|
|
24
|
-
|
|
25
|
-
const SENTINEL = "## This app — a Wix Headless frontend";
|
|
26
|
-
const note = `
|
|
27
|
-
${SENTINEL}
|
|
28
|
-
|
|
29
|
-
A ${frontend} frontend for a live Wix site; \`wix.config.json\` identifies the site. Built on
|
|
30
|
-
the **${vertical}** Wix business solution — more can be added to this same app. **The Wix site
|
|
31
|
-
owns the content and commerce** — read and write it through the Wix APIs, never hardcode what
|
|
32
|
-
it holds.
|
|
33
|
-
|
|
34
|
-
The Wix skills are installed at \`.agents/skills/\` — read them from that exact path:
|
|
35
|
-
|
|
36
|
-
- **\`wix-headless-fast\`** — the code already deployed in \`src/\` and how to extend it. Every
|
|
37
|
-
business solution it ships sits under \`references/<solution>/\`: \`INSTRUCTIONS.md\` is that
|
|
38
|
-
solution's playbook, \`seed/\` creates its content. To add one to this app, run from the
|
|
39
|
-
project root:
|
|
40
|
-
\`node .agents/skills/wix-headless-fast/install/deploy.mjs <solution> --stack ${stack}\`
|
|
41
|
-
- **\`wix-docs\`** — the Wix API reference. Confirm any endpoint, request shape, field, or enum
|
|
42
|
-
here before writing code against it, frontend or backend. Never infer a contract from
|
|
43
|
-
generated SDK types or \`node_modules\`.
|
|
44
|
-
- **\`wix-manage\`** — recipes for managing the live site itself, as opposed to changing this
|
|
45
|
-
codebase. No recipe for the task? Fall back to \`wix-docs\`.
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
// Both files, independently — a project may have either, both, or neither, and agents differ
|
|
49
|
-
// in which one they read.
|
|
50
|
-
const pinned = ["AGENTS.md", "CLAUDE.md"].map((name) => {
|
|
51
|
-
const file = join(process.cwd(), name);
|
|
52
|
-
const existing = existsSync(file) ? readFileSync(file, "utf8") : "";
|
|
53
|
-
const wrote = !existing.includes(SENTINEL);
|
|
54
|
-
if (wrote) appendFileSync(file, (existing && !existing.endsWith("\n") ? "\n" : "") + note);
|
|
55
|
-
return { file: name, wrote, created: wrote && !existing };
|
|
56
|
-
});
|
|
57
|
-
console.log(JSON.stringify({ event: "agents_md", pinned }));
|