@wix/agent-skills 1.16.3 → 1.18.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.
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +115 -12
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +1 -1
- package/skills/wix-app/references/BACKEND_API.md +18 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +6 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +10 -2
- package/skills/wix-app/references/DASHBOARD_PAGE.md +32 -70
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +145 -127
- package/skills/wix-app/references/SITE_PLUGIN.md +14 -2
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +74 -68
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +2 -2
- package/skills/wix-app/references/dashboard-page/COLLECTION_TOOLKIT.md +79 -0
- package/skills/wix-app/references/dashboard-page/ENTITY_PAGE_TOOLKIT.md +73 -0
- package/skills/wix-app/references/dashboard-page/PATTERNS_BUNDLE_READING.md +52 -0
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +184 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +182 -99
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +94 -49
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +16 -6
- package/skills/wix-app/references/editor-react-component/BROWSER-SUPPORT.md +56 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +275 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +35 -40
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +167 -445
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +56 -29
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +53 -158
- package/skills/wix-app/references/editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md +78 -0
- package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +42 -134
- package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +11 -3
- package/skills/wix-app/references/editor-react-component/PARTS.md +46 -24
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +63 -179
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +79 -163
- package/skills/wix-app/references/editor-react-component/SITE-CONTEXT-HOOKS.md +36 -21
- package/skills/wix-app/references/editor-react-component/SSR.md +30 -99
- package/skills/wix-base44-connector/SKILL.md +156 -50
- package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +78 -0
- package/skills/wix-base44-connector/scripts/utils.js +239 -45
- package/skills/wix-headless/entry/bootstrap.mjs +9 -2
- package/skills/wix-headless/entry/skill.md +1 -1
- package/skills/wix-headless/references/CAPABILITIES.md +9 -1
- package/skills/wix-headless/references/DESIGN.md +1 -0
- package/skills/wix-headless/references/DISCOVERY.md +2 -1
- package/skills/wix-headless/references/IMAGE_GENERATION.md +1 -0
- package/skills/wix-headless/references/SDK_HANDOFF.md +5 -2
- package/skills/wix-headless/references/SEED.md +2 -1
- package/skills/wix-headless/references/SETUP.md +1 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +2 -2
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +68 -31
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +26 -10
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +8 -8
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +10 -8
- package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +254 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +27 -24
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +13 -0
- package/skills/wix-headless/references/inline-recipes/setup-rentals.md +254 -0
- package/skills/wix-headless/references/managed/AUTHENTICATION.md +5 -0
- package/skills/wix-headless/references/non-astro.md +1 -1
- package/skills/wix-headless-fast/SKILL.md +166 -0
- package/skills/wix-headless-fast/entry/skill.md +99 -0
- package/skills/wix-headless-fast/install/deploy.mjs +433 -0
- package/skills/wix-headless-fast/install/fast-path.mjs +141 -0
- package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +137 -0
- package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +137 -0
- package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +113 -0
- package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +123 -0
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +70 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +99 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +76 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +62 -0
- package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +99 -0
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +24 -0
- package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +16156 -0
- package/skills/wix-headless-fast/references/blog/seed/SEED.md +72 -0
- package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +287 -0
- package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +129 -0
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +143 -0
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +119 -0
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +138 -0
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +54 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +206 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +96 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +70 -0
- package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +76 -0
- package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +22 -0
- package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +11962 -0
- package/skills/wix-headless-fast/references/bookings/seed/SEED.md +61 -0
- package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +302 -0
- package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +179 -0
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +83 -0
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +57 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +151 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +75 -0
- package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +11262 -0
- package/skills/wix-headless-fast/references/cms/seed/SEED.md +103 -0
- package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +324 -0
- package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +149 -0
- package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +66 -0
- package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +176 -0
- package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +118 -0
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +117 -0
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +59 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +136 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +128 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +61 -0
- package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +80 -0
- package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +21 -0
- package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +11884 -0
- package/skills/wix-headless-fast/references/events/seed/SEED.md +86 -0
- package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +276 -0
- package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +150 -0
- package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +317 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +269 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +231 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +135 -0
- package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +10593 -0
- package/skills/wix-headless-fast/references/forms/seed/SEED.md +108 -0
- package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +320 -0
- package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +63 -0
- package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +155 -0
- package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +66 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +88 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +53 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +122 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +50 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +10 -0
- package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +10329 -0
- package/skills/wix-headless-fast/references/members/seed/SEED.md +39 -0
- package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +94 -0
- package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +134 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +115 -0
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +59 -0
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +39 -0
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +58 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +165 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +10197 -0
- package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +78 -0
- package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +258 -0
- package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +133 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +58 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +126 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +37 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +39 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +75 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +45 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +30 -0
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +40 -0
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +11226 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +71 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +279 -0
- package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +165 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +142 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +155 -0
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +55 -0
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +43 -0
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +177 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +165 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +103 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +254 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +146 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +168 -0
- package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +12560 -0
- package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +81 -0
- package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +479 -0
- package/skills/wix-headless-fast/references/shared/CONTENT.md +22 -0
- package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +73 -0
- package/skills/wix-headless-fast/references/shared/DESIGN.md +26 -0
- package/skills/wix-headless-fast/references/shared/app/styles/global.css +52 -0
- package/skills/wix-headless-fast/references/shared/app/wix/config.ts +15 -0
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +27 -0
- package/skills/wix-headless-fast/references/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +76 -0
- package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +46 -0
- package/skills/wix-headless-fast/references/shared/seed/images.mjs +145 -0
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +149 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +121 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductCard.tsx +100 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductDetailView.tsx +130 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductGrid.tsx +48 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ShopView.tsx +66 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/VariantPicker.tsx +103 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +48 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +140 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +80 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +101 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +221 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +215 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +109 -0
- package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +46 -0
- package/skills/wix-headless-fast/references/storefront/app-astro/pages/products/[slug].astro +56 -0
- package/skills/wix-headless-fast/references/storefront/app-astro/pages/shop.astro +23 -0
- package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +12247 -0
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +85 -0
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +415 -0
- package/skills/wix-manage/SKILL.md +28 -2
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +20 -13
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +24 -11
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +5 -5
- package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +141 -0
- package/skills/wix-manage/references/google-business-profile/connect-google-business-profile.md +134 -0
- package/skills/wix-manage/references/google-business-profile/manage-google-business-profile-locations.md +182 -0
- package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +3 -0
- package/skills/wix-manage/references/seo/manage-seo-tags.md +315 -0
- package/skills/wix-manage/references/seo/manage-url-redirects.md +250 -0
- package/skills/wix-manage/references/sites/query-sites.md +72 -161
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +21 -6
- package/skills/wix-manage/references/stores/update-product-with-options.md +83 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +5 -6
- package/skills/wix-vibe-headless/SKILL.md +18 -4
- package/skills/wix-vibe-headless/install/deploy.cjs +12 -4
- package/skills/wix-vibe-headless/install/pin-agents-md.cjs +2 -1
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +16 -10
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +13 -8
- package/skills/wix-vibe-headless/platforms/base44.md +27 -62
- package/skills/wix-vibe-headless/platforms/generic.md +6 -3
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +45 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +67 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +128 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +5 -3
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +9 -8
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +250 -0
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +12 -5
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +41 -0
- package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.js +267 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +6 -3
- package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +470 -0
- package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +425 -0
- package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +187 -0
- package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +238 -0
- package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +108 -0
- package/skills/wix-vibe-headless/references/forms/seed/SEED.md +1762 -0
- package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +13 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +4 -1
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +23 -11
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +1 -1
- package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +29 -31
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +152 -92
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +37 -38
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +2 -2
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +15 -8
- package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +37 -0
- package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +35 -35
- package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +18 -6
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +30 -7
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +46 -10
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +0 -172
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +0 -143
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +0 -516
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +0 -225
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +0 -6
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +0 -95
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +0 -110
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +0 -51
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +0 -49
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +0 -92
- package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +0 -139
|
@@ -1,138 +1,156 @@
|
|
|
1
1
|
# Wix Editor React Component Builder
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build Editor React Components for Harmony Editor and Studio2 in Wix CLI
|
|
4
|
+
applications. These components are not supported in other Wix editors.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Before You Start
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Determine whether the request creates a component or edits an existing one.
|
|
9
|
+
Inspect the existing component before changing it.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
## File Contract
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Use the Wix CLI scaffold as the source of truth. Do not replace it with a custom
|
|
14
|
+
layout or a hand-written manifest. After applying this workflow, preserve these
|
|
15
|
+
file responsibilities:
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
| File | Ownership | Purpose |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `<component-name>.props.ts` | Edit | Export the props type and `defaultProps` from one shared source. |
|
|
20
|
+
| `<component-name>.tsx` | Edit | Implement the component UI and behavior. |
|
|
21
|
+
| `<component-name>.module.css` | Edit | Define scoped component styles. |
|
|
22
|
+
| `component.tsx` | Keep generated | Wire the component and `defaultProps` with `withDefaults`. |
|
|
23
|
+
| `component.preview.tsx` | Edit narrowly | Keep generated wrappers; sync the preview adapter, one crucial data field, and root class. |
|
|
24
|
+
| `<component-name>.generated.ts` | NEVER edit | Generated manifest consumed by the editor. |
|
|
25
|
+
| `<component-name>.extension.ts` | Edit narrowly | Apply supported partial manifest overrides. |
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Lists a file set that does **not** include a `*.generated.ts` companion.
|
|
19
|
-
|
|
20
|
-
## Architecture
|
|
21
|
-
|
|
22
|
-
Editor React components consist of the following template files (replace `<componentName>` with the actual component name in kebab-case):
|
|
23
|
-
|
|
24
|
-
### `<componentName>.props.ts`
|
|
25
|
-
|
|
26
|
-
Props file for the component. Holds the TypeScript props type (`type ComponentNameProps = { ... }`) and the `defaultProps` constant. Both `<componentName>.tsx` and `component.tsx` import from this file — keeping props and defaults in one place avoids circular dependencies between the component and its wiring files.
|
|
27
|
-
|
|
28
|
-
### `<componentName>.tsx`
|
|
29
|
-
|
|
30
|
-
The React component file. Contains the component's UI logic and JSX structure.
|
|
31
|
-
|
|
32
|
-
### `<componentName>.module.css`
|
|
33
|
-
|
|
34
|
-
CSS Module file for the component. Contains all styles scoped to the component.
|
|
35
|
-
|
|
36
|
-
### `component.tsx`
|
|
37
|
-
|
|
38
|
-
Entry point for the component. Imports the default component export from `<componentName>.tsx` and `defaultProps` from `<componentName>.props.ts`, then wires them with `withDefaults`. Do not change this file.
|
|
39
|
-
|
|
40
|
-
### `component.preview.tsx`
|
|
41
|
-
|
|
42
|
-
Editor-specific entry point, always generated by the CLI as a passthrough. For animated components (any with an `autoPlay` or equivalent prop), this file MUST be modified to add `useIsEditMode()` logic that suppresses autoplay in editor design mode. See [`editor-react-component/COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) and [`editor-react-component/ANIMATED-COMPONENTS.md`](editor-react-component/ANIMATED-COMPONENTS.md) §4.
|
|
43
|
-
|
|
44
|
-
### `<componentName>.generated.ts`
|
|
45
|
-
|
|
46
|
-
Auto-generated file that describes the component manifest. **Do not write or edit content in this file.** It is updated automatically based on the React component by running:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
npx wix build && npx wix generate manifest
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
This includes the `states` block for any design states — it is generated from the component's markup and CSS (see [`editor-react-component/DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md)).
|
|
53
|
-
|
|
54
|
-
### `<componentName>.extension.ts`
|
|
55
|
-
|
|
56
|
-
File where you can override the generated manifest from `<componentName>.generated.ts`. Only include overrides that appear in the boilerplate component — do not add extra overrides beyond what the boilerplate provides.
|
|
27
|
+
Supplementary files such as `constants.ts`, hooks, or internal sub-components
|
|
28
|
+
are allowed when the implementation needs them. Keep the scaffolded files and
|
|
29
|
+
their responsibilities intact.
|
|
57
30
|
|
|
58
31
|
## Workflow
|
|
59
32
|
|
|
60
|
-
1. **
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
the
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
editor
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
33
|
+
1. **Scaffold only when creating.** If the component folder does not exist, run:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx wix generate --params '{"extensionType":"EDITOR_REACT_COMPONENT","name":"ComponentName","folder":"component-name","description":"A brief description"}'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The command creates `src/extensions/site/components/<component-name>/` and
|
|
40
|
+
registers the extension in `src/extensions.ts`. Do not rerun it for an
|
|
41
|
+
existing component.
|
|
42
|
+
|
|
43
|
+
2. **Run the dependency preflight.** Verify that all component creation and
|
|
44
|
+
accessibility-review dependencies are installed:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node -e "const fs=require('fs'),path=require('path'),ps=['@wix/react-component-schema','@wix/react-component-utils','@wix/editor-react-types','@babel/parser','@babel/traverse','@babel/types','eslint','eslint-plugin-jsx-a11y','@typescript-eslint/parser','typescript','@types/eslint-plugin-jsx-a11y'];const missing=ps.filter(p=>!(require.resolve.paths(p)||[]).some(d=>fs.existsSync(path.join(d,p,'package.json'))));if(missing.length){console.error('Missing dependencies: '+missing.join(', '));process.exit(1)}" || { d="$PWD"; while [ "$d" != "/" ] && [ ! -f "$d/yarn.lock" ]; do d="${d%/*}"; done; if [ -f "$d/yarn.lock" ]; then yarn add @wix/react-component-schema @wix/react-component-utils @wix/editor-react-types && yarn add -D @babel/parser @babel/traverse @babel/types eslint eslint-plugin-jsx-a11y @typescript-eslint/parser 'typescript@<7' @types/eslint-plugin-jsx-a11y; else npm install @wix/react-component-schema @wix/react-component-utils @wix/editor-react-types && npm install --save-dev @babel/parser @babel/traverse @babel/types eslint eslint-plugin-jsx-a11y @typescript-eslint/parser 'typescript@<7' @types/eslint-plugin-jsx-a11y; fi; }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
3. **Plan the contract and structure.** Identify content and behavior props,
|
|
51
|
+
elect the semantic root, identify named inner parts, and decide which design
|
|
52
|
+
states each part supports. Read the relevant references from the routing
|
|
53
|
+
table below before writing code.
|
|
54
|
+
|
|
55
|
+
4. **Implement the editable sources.** Preserve the scaffold contract. Keep
|
|
56
|
+
props/defaults in the props file, component logic in the main TSX file, and
|
|
57
|
+
static styling in the CSS Module. Do not edit `*.generated.ts`.
|
|
58
|
+
|
|
59
|
+
5. **Run the accessibility review.** Follow
|
|
60
|
+
[`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md): run both bundled
|
|
61
|
+
scanners, triage their output, complete the manual semantic checklist, fix
|
|
62
|
+
confirmed issues, and rerun the scanners on changed JSX files.
|
|
63
|
+
|
|
64
|
+
6. **Configure the editor extension when required.** For a new component or a
|
|
65
|
+
requested sizing, installation, or manifest change, apply
|
|
66
|
+
[`editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md)
|
|
67
|
+
to `<component-name>.extension.ts`. Otherwise leave the file unchanged.
|
|
68
|
+
Finally, synchronize `requiredDataFields` and `rootClassName` in
|
|
69
|
+
`component.preview.tsx`.
|
|
70
|
+
|
|
71
|
+
7. **Generate and validate.** Run:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx wix build && npx wix generate manifest
|
|
75
|
+
npx tsc --noEmit
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Run relevant project tests and lint commands when available. Inspect the
|
|
79
|
+
regenerated manifest; never repair it by hand. Design-state generation needs
|
|
80
|
+
`@wix/cli` 1.1.210 or newer, and prop-triggered `ElementState` generation
|
|
81
|
+
needs 1.1.215 or newer. If expected states are absent on an older CLI, report
|
|
82
|
+
the version constraint and let the user decide whether to upgrade. If the
|
|
83
|
+
build or manifest command exits with an error, diagnose it with
|
|
84
|
+
[`editor-react-component/MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md), apply the
|
|
85
|
+
matching fix, and rerun both commands.
|
|
86
|
+
|
|
87
|
+
8. **Report the result.** Summarize edited files and checks. Call out any
|
|
88
|
+
unresolved instruction conflict, missing dependency, unsupported CLI
|
|
89
|
+
version, or check that could not run.
|
|
90
|
+
|
|
91
|
+
## Reference Policy
|
|
92
|
+
|
|
93
|
+
Read every reference required for the current scope. Read an optional reference
|
|
94
|
+
only when its trigger applies; when it does, that reference becomes required.
|
|
95
|
+
Apply every matching row; do not load the entire reference set by default.
|
|
96
|
+
|
|
97
|
+
References refine the active workflow step; they do not restart the workflow or
|
|
98
|
+
expand the user's requested scope. `SKILL.md` is the only reference router;
|
|
99
|
+
reference files are self-contained leaves and do not route to other references.
|
|
100
|
+
For an existing component, preserve out-of-scope public props, styling,
|
|
101
|
+
extension configuration, and supporting files. Never re-scaffold an existing
|
|
102
|
+
component or edit `*.generated.ts` as a reference-driven fix.
|
|
103
|
+
|
|
104
|
+
### Required References
|
|
105
|
+
|
|
106
|
+
| Scope | Required references |
|
|
107
|
+
| --- | --- |
|
|
108
|
+
| Creating a component | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md), [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PARTS.md`](editor-react-component/PARTS.md), [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md), [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md), [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md), [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md), and [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
|
|
109
|
+
| Editing React or JSX | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md) and [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md) |
|
|
110
|
+
| Changing the public contract, semantic root, or named parts | [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PARTS.md`](editor-react-component/PARTS.md), and [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md) |
|
|
111
|
+
| Changing public data props or the elected root global class | [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
|
|
112
|
+
| Creating or changing an item array where only one body is visible | [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md), and [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
|
|
113
|
+
| Creating or changing CSS | [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md) |
|
|
114
|
+
| Changing the root direction contract, direction-sensitive behavior, or a `ReactNode` slot | [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md) |
|
|
115
|
+
| Changing sizing, installation, or manifest overrides | [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
|
|
116
|
+
|
|
117
|
+
### Optional References
|
|
118
|
+
|
|
119
|
+
| Trigger | Read |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| An interactive or selectable part is created or changed—for example a button, link, input, tab, accordion trigger, or carousel control—or a custom state is added | [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
|
|
122
|
+
| Public event callbacks are added or changed | [`FUNCTION-HANDLERS.md`](editor-react-component/FUNCTION-HANDLERS.md) |
|
|
123
|
+
| Browser APIs, effects, or time-dependent output are introduced | [`SSR.md`](editor-react-component/SSR.md) |
|
|
124
|
+
| A CSS feature or DOM API that is not clearly long-established is introduced, or the user asks for one by name | [`BROWSER-SUPPORT.md`](editor-react-component/BROWSER-SUPPORT.md) |
|
|
125
|
+
| `npx wix build` or manifest generation exits with an error | [`MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md) |
|
|
126
|
+
| Primary content is playable, looped, or autoplaying | [`ANIMATED-COMPONENTS.md`](editor-react-component/ANIMATED-COMPONENTS.md) and [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
|
|
127
|
+
| Runtime site pages, URLs, JavaScript direction, or reduced-motion context is needed | [`SITE-CONTEXT-HOOKS.md`](editor-react-component/SITE-CONTEXT-HOOKS.md) |
|
|
128
|
+
| Non-animation behavior must differ in editor design mode | [`SITE-CONTEXT-HOOKS.md`](editor-react-component/SITE-CONTEXT-HOOKS.md) and [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
|
|
129
|
+
| The prompt explicitly requests a branded, themed, or brand-aware component | [`BRANDED-COMPONENTS.md`](editor-react-component/BRANDED-COMPONENTS.md) |
|
|
130
|
+
|
|
131
|
+
## Core Invariants
|
|
132
|
+
|
|
133
|
+
- Use React 18-compatible APIs; do not assume React 19 runtime features.
|
|
134
|
+
- Include typed `id`, `className`, `direction`, and `a11y` support.
|
|
135
|
+
- Apply `dir={direction}` and the unconditional fallback-direction class to the
|
|
136
|
+
elected root. Use logical CSS properties for direction-sensitive layout.
|
|
137
|
+
- Keep render output deterministic and avoid browser globals during render.
|
|
138
|
+
- Use only Baseline Widely Available CSS features and DOM APIs, or ones that
|
|
139
|
+
fall back to them. When a design needs a feature that is not, build the
|
|
140
|
+
supported alternative.
|
|
141
|
+
- Route ARIA through the typed `a11y` contract; do not add one-off ARIA props.
|
|
142
|
+
- Give every named inner part a global class, a CSS Module class, and a matching
|
|
143
|
+
`elementProps` entry. The elected root uses top-level props instead.
|
|
144
|
+
- Pair each eligible native editor design-state selector with its
|
|
145
|
+
editor-injected global modifier. Keep a non-input control's keyboard-only
|
|
146
|
+
`:focus-visible` indicator standalone unless editable focus styling is
|
|
147
|
+
explicitly requested. Toggle custom global state classes from data.
|
|
148
|
+
- For an item array where only one body is visible, give every item a `name`,
|
|
149
|
+
use `ActiveItemIndex<'arrayPropName'>`, render every body, and hide inactive
|
|
150
|
+
bodies accessibly.
|
|
151
|
+
- If primary content autoplays or loops, provide an accessible play/pause
|
|
152
|
+
control, honor reduced motion, and suppress autoplay in editor design mode.
|
|
153
|
+
- In `component.preview.tsx`, keep `withDefaults` and `withFallbackPlaceholder`,
|
|
154
|
+
wrap the preview adapter when present, normally put
|
|
155
|
+
only the one data prop crucial to meaningful rendering in
|
|
156
|
+
`requiredDataFields`, and match `rootClassName` to the root global class.
|
|
@@ -324,14 +324,14 @@ Site plugins can import and use Wix SDK modules directly — you do NOT need `cr
|
|
|
324
324
|
```typescript
|
|
325
325
|
// ✅ CORRECT — Import SDK modules directly
|
|
326
326
|
import { items } from "@wix/data";
|
|
327
|
-
import {
|
|
327
|
+
import { currentCartV2 } from "@wix/ecom";
|
|
328
328
|
import { products } from "@wix/stores";
|
|
329
329
|
|
|
330
330
|
class MyPlugin extends HTMLElement {
|
|
331
331
|
async loadData() {
|
|
332
332
|
// Call SDK methods directly — no createClient needed
|
|
333
333
|
const result = await items.query("MyCollection").find();
|
|
334
|
-
const cart = await
|
|
334
|
+
const { cart } = await currentCartV2.getCurrentCart();
|
|
335
335
|
const productList = await products.queryProducts().limit(10).find();
|
|
336
336
|
}
|
|
337
337
|
}
|
|
@@ -344,6 +344,18 @@ const wixClient = createClient({ modules: { items, products } });
|
|
|
344
344
|
await wixClient.items.query(...); // Wrong — API surface differs through client
|
|
345
345
|
```
|
|
346
346
|
|
|
347
|
+
### Identity of SDK Calls in Site Plugins
|
|
348
|
+
|
|
349
|
+
A plugin runs as the **site visitor or member**, never as the app — see [Identity and Elevation Requirement](../SKILL.md#identity-and-elevation-requirement) before routing any SDK call out to a backend endpoint.
|
|
350
|
+
|
|
351
|
+
The three calls above are correct exactly as written, and each for a different reason:
|
|
352
|
+
|
|
353
|
+
| Call | Why it works directly |
|
|
354
|
+
| --- | --- |
|
|
355
|
+
| `items.query(...)` | Wix Data enforces the collection's `dataPermissions` per caller — the scaffolded default reads as `ANYONE`. See [Permissions](DATA_COLLECTION.md#permissions) |
|
|
356
|
+
| `currentCartV2.getCurrentCart()` | Resolves the cart from the caller's session. Elevating it would return the app's cart, not the visitor's |
|
|
357
|
+
| `products.queryProducts()` | Catalog base fields are public. `MERCHANT_DATA` and non-visible products are withheld unless the app holds `SCOPE.STORES.PRODUCT_READ_ADMIN` — don't request them from a plugin |
|
|
358
|
+
|
|
347
359
|
### Performance Considerations
|
|
348
360
|
|
|
349
361
|
- Keep bundle size small - plugins load on user-facing pages
|
|
@@ -2,18 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
## Prerequisites
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Lookups here are direct file reads — no script. Resolve the installed package root once per session and reuse it:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
node -e "
|
|
9
|
+
const fs = require('fs'), path = require('path');
|
|
10
|
+
function tryEnablePnp() {
|
|
11
|
+
let dir = process.cwd();
|
|
12
|
+
for (;;) {
|
|
13
|
+
const pnp = path.join(dir, '.pnp.cjs');
|
|
14
|
+
if (fs.existsSync(pnp)) { try { require(pnp).setup(); } catch {} return; }
|
|
15
|
+
const parent = path.dirname(dir);
|
|
16
|
+
if (parent === dir) return;
|
|
17
|
+
dir = parent;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
tryEnablePnp();
|
|
21
|
+
try {
|
|
22
|
+
console.log(path.dirname(require.resolve('@wix/patterns/package.json', { paths: [process.cwd()] })));
|
|
23
|
+
} catch {
|
|
24
|
+
let dir = process.cwd();
|
|
25
|
+
for (;;) {
|
|
26
|
+
const candidate = path.join(dir, 'node_modules', '@wix', 'patterns');
|
|
27
|
+
if (fs.existsSync(path.join(candidate, 'package.json'))) { console.log(candidate); process.exit(0); }
|
|
28
|
+
const parent = path.dirname(dir);
|
|
29
|
+
if (parent === dir) { console.error('@wix/patterns not found'); process.exit(1); }
|
|
30
|
+
dir = parent;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
"
|
|
9
34
|
```
|
|
10
35
|
|
|
11
|
-
|
|
36
|
+
A bare `require.resolve` without the PnP-activation step throws in a Yarn Berry project even when the package is installed — run the whole snippet, not a shortened version.
|
|
37
|
+
|
|
38
|
+
Then confirm the installed version actually ships the bundle index:
|
|
12
39
|
|
|
13
40
|
```bash
|
|
14
|
-
|
|
41
|
+
ls <pkgRoot>/dist/dts-bundle/index.json
|
|
15
42
|
```
|
|
16
43
|
|
|
44
|
+
**If it's missing, stop — do not look elsewhere for types or docs.** The installed `@wix/patterns` predates the index; it ships from **1.458.0** onward, so upgrade to at least that and re-run the check. A missing *file* is not the same as a name not being covered (see below): the mechanism itself isn't available yet.
|
|
45
|
+
|
|
46
|
+
**Never inspect `node_modules` by hand** — no `ls`, no `find`, no `cat` of an arbitrary path, and that includes the sanctioned directories: never browse `dist/dts-bundle/` or `dist/docs/` looking around. Every lookup below names the exact file to `Read` — go straight to it.
|
|
47
|
+
|
|
17
48
|
## Library Architecture
|
|
18
49
|
|
|
19
50
|
### Composition Hierarchy
|
|
@@ -29,55 +60,33 @@ Provider <- WixPatternsProvider or WixPatternsBMProvider
|
|
|
29
60
|
|
|
30
61
|
Each collection type follows the same Component + State + Hook pattern:
|
|
31
62
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
This table covers the common collection types — the full, authoritative list is in `node_modules/@wix/patterns/dist/docs/index.json`.
|
|
63
|
+
| Component | State Type | Hook |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| `Table` | `TableState` | `useTableCollection()` |
|
|
66
|
+
| `Grid` | `GridState` | `useGridCollection()` |
|
|
67
|
+
| `TableGridSwitch` | `TableGridSwitchState` | `useTableGridSwitchCollection()` |
|
|
68
|
+
| `TableFolders` | `TableFoldersState` | `useTableFolders()` |
|
|
69
|
+
| `GridFolders` | `GridFoldersState` | `useGridFolders()` |
|
|
41
70
|
|
|
42
|
-
Create state with the hook -> pass it to the component's `state` prop -> wrap in a page component.
|
|
71
|
+
Common types only; `dist/dts-bundle/index.json` has the authoritative set. Create state with the hook -> pass it to the component's `state` prop -> wrap in a page component.
|
|
43
72
|
|
|
44
73
|
### Choosing the Right Provider
|
|
45
74
|
|
|
46
|
-
| Provider
|
|
47
|
-
|
|
48
|
-
| `WixPatternsProvider`
|
|
49
|
-
| `WixPatternsBMProvider`
|
|
50
|
-
| `WixPatternsGizaProvider`
|
|
51
|
-
| `WixPatternsEssentialsProvider` | Yoshi Fullstack.
|
|
52
|
-
| `WixPatternsBaseProvider`
|
|
53
|
-
|
|
54
|
-
Prefer `WixPatternsProvider` unless the project is on one of the specific Yoshi flows above — it is the documented recommendation for most apps, and it resolves the environment for you rather than making you pick.
|
|
75
|
+
| Provider | When to Use |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `WixPatternsProvider` | **Default — start here.** Auto-detects the environment (BM, Essentials, Giza). |
|
|
78
|
+
| `WixPatternsBMProvider` | Optional alternative for Yoshi BM Flow over Business Manager. |
|
|
79
|
+
| `WixPatternsGizaProvider` | Optional alternative for Yoshi BM Flow over Giza. |
|
|
80
|
+
| `WixPatternsEssentialsProvider` | Yoshi Fullstack. |
|
|
81
|
+
| `WixPatternsBaseProvider` | App does **not** run under Giza/WixEssentials and you inject services (i18n, sentry) yourself. |
|
|
55
82
|
|
|
56
|
-
**Confirm the import path in the provider's own
|
|
83
|
+
**Confirm the import path in the provider's own bundle** — they don't all share a subpath (`WixPatternsEssentialsProvider` and `WixPatternsBaseProvider` are under `@wix/patterns/essentials`). The project's `package.json` identifies the flow.
|
|
57
84
|
|
|
58
85
|
### Keep Provider and Page Separate
|
|
59
86
|
|
|
60
|
-
The provider **must**
|
|
87
|
+
The provider **must** live in a parent component of the page content: hooks like `useTableCollection` need its context to already exist above them in the React tree.
|
|
61
88
|
|
|
62
|
-
**Wrong
|
|
63
|
-
```tsx
|
|
64
|
-
function BadApp() {
|
|
65
|
-
const state = useTableCollection({
|
|
66
|
-
queryName: 'my-items',
|
|
67
|
-
itemKey: (item) => item.id,
|
|
68
|
-
itemName: (item) => item.name,
|
|
69
|
-
fetchData: async () => ({ items: [], total: 0 }),
|
|
70
|
-
filters: {},
|
|
71
|
-
}); // fails at runtime — no provider context above this component
|
|
72
|
-
return (
|
|
73
|
-
<WixPatternsProvider>
|
|
74
|
-
<CollectionPage>
|
|
75
|
-
<Table state={state} columns={[{ title: 'Name', render: (item) => item.name }]} />
|
|
76
|
-
</CollectionPage>
|
|
77
|
-
</WixPatternsProvider>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
```
|
|
89
|
+
**Wrong:** calling `useTableCollection` in the same component that renders `WixPatternsProvider`. The hook runs before the provider exists above it, so it throws at runtime — and the JSX nesting looks right, which is what makes this hard to spot.
|
|
81
90
|
|
|
82
91
|
**Correct — provider in root, page in a separate file:**
|
|
83
92
|
```tsx
|
|
@@ -97,13 +106,14 @@ import { Table, useTableCollection } from '@wix/patterns';
|
|
|
97
106
|
import { CollectionPage } from '@wix/patterns/page';
|
|
98
107
|
|
|
99
108
|
function MyCollectionPage() {
|
|
109
|
+
// works — the provider context exists above this component
|
|
100
110
|
const state = useTableCollection({
|
|
101
111
|
queryName: 'my-items',
|
|
102
112
|
itemKey: (item) => item.id,
|
|
103
113
|
itemName: (item) => item.name,
|
|
104
114
|
fetchData: async () => ({ items: [], total: 0 }),
|
|
105
115
|
filters: {},
|
|
106
|
-
});
|
|
116
|
+
});
|
|
107
117
|
return (
|
|
108
118
|
<CollectionPage>
|
|
109
119
|
<Table state={state} columns={[{ title: 'Name', render: (item) => item.name }]} />
|
|
@@ -112,33 +122,33 @@ function MyCollectionPage() {
|
|
|
112
122
|
}
|
|
113
123
|
```
|
|
114
124
|
|
|
115
|
-
|
|
125
|
+
Keep the provider (and router, if any) in the app's root component and each page in its own file.
|
|
116
126
|
|
|
117
|
-
|
|
127
|
+
For **multiple pages**, use the `@wix/patterns` routing solution (`PatternsReactRouter`, `PatternsReactRoute`, `usePatternsNavigate`) rather than a separate router; look the doc files up for setup.
|
|
118
128
|
|
|
119
129
|
## How to Look Things Up
|
|
120
130
|
|
|
121
131
|
**Don't guess which components or props exist — read the doc files first.**
|
|
122
132
|
|
|
123
|
-
### Finding the right
|
|
133
|
+
### Finding the right name
|
|
134
|
+
|
|
135
|
+
`Read <pkgRoot>/dist/dts-bundle/index.json` — one entry per name, grouped implicitly by its `category` field. Lookup is **exact-match only**: no fuzzy matching, no typo suggestions. If the exact key isn't there, scan the index you already hold for something close before concluding the name isn't covered.
|
|
124
136
|
|
|
125
|
-
|
|
126
|
-
- **By browsing:** List the `dist/docs/` folder. Filenames match component names directly (e.g., `Table.md`, `useTableCollection.md`). Note some names contain spaces (`AI Assistant.md`) or dots (`CollectionPage.Header.md`) — quote paths when searching.
|
|
127
|
-
- **By concept:** Search filenames for keywords (e.g., "filter"). Check `index.json` categories — related components share a category prefix.
|
|
137
|
+
Not every real `@wix/patterns` export is in this index — only the names these guides actually reference. If a name you need genuinely isn't there, **stop and say so rather than falling back to `node_modules`.**
|
|
128
138
|
|
|
129
139
|
### Reading doc files
|
|
130
140
|
|
|
131
|
-
|
|
141
|
+
`Read <pkgRoot>/dist/docs/index.json` to resolve a name to its doc file — or a `symbols` alias, for the cases where the Storybook title doesn't match the export (`ExportTo.md` documents `ExportButton`) — then `Read <pkgRoot>/dist/docs/<file>.md` directly, the whole file, not piped through `head`. It covers more names than the bundle index above: it's produced for every documented component, not just the curated ones.
|
|
132
142
|
|
|
133
|
-
|
|
143
|
+
**Always check the import statement inside the doc** — not everything comes from `@wix/patterns` (some use subpaths like `@wix/patterns/provider`).
|
|
134
144
|
|
|
135
|
-
|
|
145
|
+
### Reading the file the index names
|
|
136
146
|
|
|
137
|
-
|
|
147
|
+
The mechanics of the file an index names — types the docs don't cover, which one-line stubs are answers rather than truncation, subpath entry points, cross-references, split compound-component docs — are in [Reading bundles and docs](dashboard-page/PATTERNS_BUNDLE_READING.md). Read it before your first `dist/dts-bundle/*.d.ts` of the session.
|
|
138
148
|
|
|
139
149
|
## The Collection → Entity Flow
|
|
140
150
|
|
|
141
|
-
A collection page and its item form are **two patterns pages**, not a page plus a modal. Getting the table right and then hand-building the "add item" form
|
|
151
|
+
A collection page and its item form are **two patterns pages**, not a page plus a modal. Getting the table right and then hand-building the "add item" form as a dashboard modal is the most common way this goes wrong.
|
|
142
152
|
|
|
143
153
|
| Step | What owns it |
|
|
144
154
|
| --- | --- |
|
|
@@ -149,24 +159,20 @@ A collection page and its item form are **two patterns pages**, not a page plus
|
|
|
149
159
|
| Body layout | `EntityPage.Header`, `.MainContent`, `.AdditionalContent`, `.Card` |
|
|
150
160
|
| The individual fields inside those cards | `@wix/design-system` (`FormField`, `Input`, `Text`) |
|
|
151
161
|
|
|
152
|
-
`navigateToEntityPage`
|
|
162
|
+
Prefer `navigateToEntityPage` over a plain route change: the entity header (title, subtitle, breadcrumbs) renders immediately, without waiting for the fetch.
|
|
153
163
|
|
|
154
|
-
Read `EntityPage.md`, `useEntityPage.md`, and `usePatternsNavigate.md` before implementing — and note
|
|
164
|
+
Read `EntityPage.md`, `useEntityPage.md`, and `usePatternsNavigate.md` before implementing — and note `useCreateCollection` is **not** about creating items; it returns a function that initializes collection state.
|
|
155
165
|
|
|
156
|
-
|
|
166
|
+
Three things about the `useEntityPage` call are worth getting right first time — both generics, what `onSave` receives, which params exist: [ENTITY_PAGE_TOOLKIT.md](dashboard-page/ENTITY_PAGE_TOOLKIT.md).
|
|
167
|
+
|
|
168
|
+
Reserve dashboard modals for dialogs that neither write nor display a listed record — a delete or discard confirmation, an unsaved-changes prompt. **A create / "add new" form is not one of them**: it writes the record, so it is an `EntityPage` even though nothing is being edited yet. Size and field count are not exceptions — a one-field create form is still an `EntityPage`. A page that lists no records is outside this rule.
|
|
157
169
|
|
|
158
170
|
## When Patterns Has No Equivalent
|
|
159
171
|
|
|
160
|
-
A concept is only "missing" from patterns after you've checked `index.json` **and** searched
|
|
172
|
+
A concept is only "missing" from patterns after you've checked `dist/dts-bundle/index.json` and `dist/docs/index.json` **and** searched by keyword within what you've read. Then, and only then:
|
|
161
173
|
|
|
162
174
|
1. Look the component up in `@wix/design-system` via the `wix-design-system` skill.
|
|
163
175
|
2. Render it *inside* the patterns page shell / collection, not as a replacement for it.
|
|
164
|
-
3. If WDS lacks it too, compose from WDS primitives (`Box`, `Card`, `Text`) — never restyle patterns internals
|
|
165
|
-
|
|
166
|
-
Anything page- or collection-shaped (page shell, header, table, grid, filters, sorting, paging, row actions, bulk actions) is patterns' territory. If you're about to build one of those from WDS parts, you skipped a lookup.
|
|
167
|
-
|
|
168
|
-
## Tips
|
|
176
|
+
3. If WDS lacks it too, compose from WDS primitives (`Box`, `Card`, `Text`) — never restyle patterns internals, never add another UI library.
|
|
169
177
|
|
|
170
|
-
-
|
|
171
|
-
- **Hook docs** list configuration options as props in the API table.
|
|
172
|
-
- **Type docs** (e.g., `TableState.md`) describe the shape of state objects.
|
|
178
|
+
Anything page- or collection-shaped (page shell, header, table, grid, filters, sorting, paging, row and bulk actions) is patterns' territory. If you're about to build one from WDS parts, you skipped a lookup.
|
|
@@ -21,8 +21,8 @@ Order events use **`@wix/ecom`** (namespace `orders`). Order **refund** events a
|
|
|
21
21
|
| Order canceled | `import { orders } from "@wix/ecom"` | `orders.onOrderCanceled(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onOrderCanceled](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/order-canceled?apiView=SDK) |
|
|
22
22
|
| Refund created | `import { refunds } from "@wix/payments"` | `refunds.onRefundCreated(handler)` | `SCOPE.DC-PAYMENTS.READ-REFUNDS` | [onRefundCreated](https://dev.wix.com/docs/api-reference/business-management/payments/refunds/refund-created?apiView=SDK) |
|
|
23
23
|
| Refund updated | `import { refunds } from "@wix/payments"` | `refunds.onRefundUpdated(handler)` | `SCOPE.DC-PAYMENTS.READ-REFUNDS` | [onRefundUpdated](https://dev.wix.com/docs/api-reference/business-management/payments/refunds/refund-updated?apiView=SDK) |
|
|
24
|
-
| Cart created | `import {
|
|
25
|
-
| Cart updated | `import {
|
|
24
|
+
| Cart created | `import { cartV2 } from "@wix/ecom"` | `cartV2.onCartCreated(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onCartCreated](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/cart-created?apiView=SDK) |
|
|
25
|
+
| Cart updated | `import { cartV2 } from "@wix/ecom"` | `cartV2.onCartUpdated(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onCartUpdated](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/cart-updated?apiView=SDK) |
|
|
26
26
|
|
|
27
27
|
## Bookings Events
|
|
28
28
|
|