@wix/agent-skills 1.17.0 → 1.18.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/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 +74 -83
- package/skills/wix-app/references/SITE_PLUGIN.md +12 -0
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +74 -68
- 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/ANIMATED-COMPONENTS.md +12 -11
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +1 -0
- package/skills/wix-app/references/editor-react-component/BROWSER-SUPPORT.md +56 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +16 -8
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +47 -14
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +3 -0
- package/skills/wix-base44-connector/SKILL.md +133 -44
- package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +78 -0
- package/skills/wix-base44-connector/scripts/utils.js +216 -30
- 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 +4 -1
- 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 +26 -8
- 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-rentals.md +254 -0
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +57 -10
- 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/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 +113 -89
- package/skills/wix-manage/references/dashboard-navigation/routes.json +12 -52
- package/skills/wix-manage/references/ecommerce/shipping/ecom-shipping-api.md +0 -2
- package/skills/wix-manage/references/forms/create-form.md +272 -184
- package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +13 -10
- package/skills/wix-manage/references/forms/update-form.md +122 -0
- 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/media/generate-image-with-ai.md +86 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +37 -7
- package/skills/wix-manage/references/stores/update-product-with-options.md +83 -0
- 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 +3 -1
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +3 -1
- package/skills/wix-vibe-headless/platforms/base44.md +27 -61
- package/skills/wix-vibe-headless/platforms/generic.md +6 -3
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +43 -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-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 +486 -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 +1836 -0
- package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +13 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +137 -84
- 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-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-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,32 +1,26 @@
|
|
|
1
1
|
# Wix Editor React Component Builder
|
|
2
2
|
|
|
3
|
-
Build Editor React Components for Harmony
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Before You Start
|
|
7
|
-
|
|
8
|
-
Determine whether the request creates a component or edits an existing one.
|
|
9
|
-
Inspect the existing component before changing it.
|
|
3
|
+
Build Editor React Components for Harmony/Studio2 Wix CLI apps only. First
|
|
4
|
+
determine **create vs edit**; for edits, inspect the existing component and
|
|
5
|
+
never re-scaffold.
|
|
10
6
|
|
|
11
7
|
## File Contract
|
|
12
8
|
|
|
13
9
|
Use the Wix CLI scaffold as the source of truth. Do not replace it with a custom
|
|
14
|
-
layout or a hand-written manifest.
|
|
15
|
-
file responsibilities:
|
|
10
|
+
layout or a hand-written manifest. Preserve these file responsibilities:
|
|
16
11
|
|
|
17
12
|
| File | Ownership | Purpose |
|
|
18
13
|
| --- | --- | --- |
|
|
19
|
-
| `<component-name>.props.ts` | Edit |
|
|
20
|
-
| `<component-name>.tsx` | Edit |
|
|
21
|
-
| `<component-name>.module.css` | Edit |
|
|
22
|
-
| `component.tsx` | Keep generated | Wire
|
|
23
|
-
| `component.preview.tsx` |
|
|
24
|
-
| `<component-name>.generated.ts` | NEVER edit | Generated manifest
|
|
25
|
-
| `<component-name>.extension.ts` | Edit narrowly |
|
|
26
|
-
|
|
27
|
-
Supplementary files
|
|
28
|
-
|
|
29
|
-
their responsibilities intact.
|
|
14
|
+
| `<component-name>.props.ts` | Edit | Props type + `defaultProps` |
|
|
15
|
+
| `<component-name>.tsx` | Edit | Component UI and behavior |
|
|
16
|
+
| `<component-name>.module.css` | Edit | Scoped component styles |
|
|
17
|
+
| `component.tsx` | Keep generated | Wire component and `defaultProps` with `withDefaults` |
|
|
18
|
+
| `component.preview.tsx` | Edit narrowly | Sync preview adapter, one crucial data field, root class |
|
|
19
|
+
| `<component-name>.generated.ts` | NEVER edit | Generated manifest — do not edit |
|
|
20
|
+
| `<component-name>.extension.ts` | Edit narrowly | Supported partial manifest overrides |
|
|
21
|
+
|
|
22
|
+
Supplementary files (constants, hooks, sub-components) are allowed; keep scaffold
|
|
23
|
+
roles intact.
|
|
30
24
|
|
|
31
25
|
## Workflow
|
|
32
26
|
|
|
@@ -36,9 +30,8 @@ their responsibilities intact.
|
|
|
36
30
|
npx wix generate --params '{"extensionType":"EDITOR_REACT_COMPONENT","name":"ComponentName","folder":"component-name","description":"A brief description"}'
|
|
37
31
|
```
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
existing component.
|
|
33
|
+
Creates `src/extensions/site/components/<component-name>/` and registers the
|
|
34
|
+
extension in `src/extensions.ts`. Do not rerun for an existing component.
|
|
42
35
|
|
|
43
36
|
2. **Run the dependency preflight.** Verify that all component creation and
|
|
44
37
|
accessibility-review dependencies are installed:
|
|
@@ -47,24 +40,24 @@ their responsibilities intact.
|
|
|
47
40
|
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
41
|
```
|
|
49
42
|
|
|
50
|
-
3. **Plan the contract and structure.** Identify
|
|
51
|
-
|
|
52
|
-
states each part supports. Read the relevant references from the routing
|
|
53
|
-
table below before writing code.
|
|
43
|
+
3. **Plan the contract and structure.** Identify props, semantic root, named
|
|
44
|
+
parts, and design states; read routed references below before writing code.
|
|
54
45
|
|
|
55
|
-
4. **Implement the editable sources.** Preserve the scaffold contract
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
4. **Implement the editable sources.** Preserve the scaffold contract: props in
|
|
47
|
+
the props file, logic in TSX, styles in the CSS Module. Do not edit
|
|
48
|
+
`*.generated.ts`.
|
|
58
49
|
|
|
59
50
|
5. **Run the accessibility review.** Follow
|
|
60
|
-
[`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md): run
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
[`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md): run scanners,
|
|
52
|
+
triage output, complete the manual checklist, fix issues, rerun on changed
|
|
53
|
+
JSX.
|
|
63
54
|
|
|
64
55
|
6. **Configure the editor extension when required.** For a new component or a
|
|
65
56
|
requested sizing, installation, or manifest change, apply
|
|
66
57
|
[`editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md)
|
|
67
|
-
to `<component-name>.extension.ts`. Otherwise
|
|
58
|
+
to `<component-name>.extension.ts`. Otherwise leave the file unchanged.
|
|
59
|
+
Synchronize `requiredDataFields` and `rootClassName` in
|
|
60
|
+
`component.preview.tsx`.
|
|
68
61
|
|
|
69
62
|
7. **Generate and validate.** Run:
|
|
70
63
|
|
|
@@ -73,73 +66,71 @@ their responsibilities intact.
|
|
|
73
66
|
npx tsc --noEmit
|
|
74
67
|
```
|
|
75
68
|
|
|
76
|
-
Run relevant
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
needs 1.1.215 or newer. If expected states are absent on an older CLI, report
|
|
80
|
-
the version constraint and let the user decide whether to upgrade. If the
|
|
81
|
-
build or manifest command exits with an error, diagnose it with
|
|
82
|
-
[`editor-react-component/MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md), apply the
|
|
83
|
-
matching fix, and rerun both commands.
|
|
69
|
+
Run relevant tests and lint when available. Inspect the regenerated manifest;
|
|
70
|
+
never repair it by hand. On failure, diagnose with
|
|
71
|
+
[`editor-react-component/MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md).
|
|
84
72
|
|
|
85
73
|
8. **Report the result.** Summarize edited files and checks. Call out any
|
|
86
|
-
unresolved
|
|
87
|
-
|
|
74
|
+
unresolved conflict, missing dependency, unsupported CLI version, or check
|
|
75
|
+
that could not run.
|
|
88
76
|
|
|
89
77
|
## Reference Policy
|
|
90
78
|
|
|
91
|
-
Read
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
- Read **only** matching required + triggered optional rows; optional triggers
|
|
80
|
+
become required when they match.
|
|
81
|
+
- References refine the active step; they do not restart workflow or expand scope.
|
|
82
|
+
- Never re-scaffold an existing component or edit `*.generated.ts`.
|
|
94
83
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
For an existing component, preserve out-of-scope public props, styling,
|
|
99
|
-
extension configuration, and supporting files. Never re-scaffold an existing
|
|
100
|
-
component or edit `*.generated.ts` as a reference-driven fix.
|
|
84
|
+
`SKILL.md` is the only reference router; reference files are self-contained
|
|
85
|
+
leaves. For existing components, preserve out-of-scope public props, styling,
|
|
86
|
+
extension configuration, and supporting files.
|
|
101
87
|
|
|
102
88
|
### Required References
|
|
103
89
|
|
|
104
90
|
| Scope | Required references |
|
|
105
91
|
| --- | --- |
|
|
106
|
-
| 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),
|
|
107
|
-
| Editing React or JSX | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md)
|
|
108
|
-
| Changing
|
|
109
|
-
|
|
|
92
|
+
| 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), [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
|
|
93
|
+
| Editing React or JSX | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md) |
|
|
94
|
+
| Changing public contract, semantic root, or named parts | [`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) |
|
|
95
|
+
| Changing public data props or elected root global class | [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
|
|
96
|
+
| 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), [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
|
|
110
97
|
| Creating or changing CSS | [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md) |
|
|
111
|
-
|
|
|
112
|
-
|
|
|
98
|
+
| Root direction contract, direction-sensitive behavior, or `ReactNode` slot | [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md) |
|
|
99
|
+
| Sizing, installation, or manifest overrides | [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
|
|
113
100
|
|
|
114
101
|
### Optional References
|
|
115
102
|
|
|
116
103
|
| Trigger | Read |
|
|
117
104
|
| --- | --- |
|
|
118
|
-
|
|
|
119
|
-
| Public event callbacks
|
|
120
|
-
| Browser APIs, effects, or time-dependent output
|
|
105
|
+
| Interactive/selectable part or custom state | [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
|
|
106
|
+
| Public event callbacks added or changed | [`FUNCTION-HANDLERS.md`](editor-react-component/FUNCTION-HANDLERS.md) |
|
|
107
|
+
| Browser APIs, effects, or time-dependent output | [`SSR.md`](editor-react-component/SSR.md) |
|
|
108
|
+
| Non-established CSS feature or DOM API, or user asks for one by name | [`BROWSER-SUPPORT.md`](editor-react-component/BROWSER-SUPPORT.md) |
|
|
121
109
|
| `npx wix build` or manifest generation exits with an error | [`MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md) |
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
| The prompt explicitly requests a branded, themed, or brand-aware component | [`BRANDED-COMPONENTS.md`](editor-react-component/BRANDED-COMPONENTS.md) |
|
|
110
|
+
| Animation, video, carousel, or other playable/looped/autoplaying content | [`ANIMATED-COMPONENTS.md`](editor-react-component/ANIMATED-COMPONENTS.md), [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
|
|
111
|
+
| Site/runtime/editor context hooks needed | [`SITE-CONTEXT-HOOKS.md`](editor-react-component/SITE-CONTEXT-HOOKS.md) (+ [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) when design-mode behavior differs) |
|
|
112
|
+
| Branded, themed, or brand-aware component requested | [`BRANDED-COMPONENTS.md`](editor-react-component/BRANDED-COMPONENTS.md) |
|
|
126
113
|
|
|
127
|
-
##
|
|
114
|
+
## Non-Negotiables
|
|
128
115
|
|
|
129
|
-
-
|
|
116
|
+
- React 18 only; do not assume React 19 runtime features.
|
|
130
117
|
- Include typed `id`, `className`, `direction`, and `a11y` support.
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
118
|
+
- Elected root: `dir={direction}`, fallback-direction class, logical CSS for
|
|
119
|
+
direction-sensitive layout.
|
|
120
|
+
- Deterministic render; no browser globals during render.
|
|
121
|
+
- Explicit foreground colors need a known contrasting background; transparent
|
|
122
|
+
roots inherit from the host.
|
|
123
|
+
- Baseline Widely Available CSS/DOM only, or supported fallbacks.
|
|
124
|
+
- Route ARIA through `a11y`; no one-off ARIA props.
|
|
125
|
+
- Named parts: global class, module class, and `elementProps` (root uses
|
|
126
|
+
top-level props).
|
|
127
|
+
- Native design states: pair selectors with injected modifiers; keep non-input
|
|
128
|
+
`:focus-visible` standalone unless editable focus is requested; toggle custom
|
|
129
|
+
state classes from data.
|
|
130
|
+
- Single-visible-body arrays: `name` per item, `ActiveItemIndex<'prop'>`, render
|
|
131
|
+
all bodies, hide inactive accessibly.
|
|
132
|
+
- Autoplay/loop: play/pause control, honor reduced motion, suppress autoplay in
|
|
133
|
+
editor design mode.
|
|
134
|
+
- `component.preview.tsx`: keep `withDefaults` and `withFallbackPlaceholder`,
|
|
135
|
+
wrap the preview adapter when present, one crucial `requiredDataFields`
|
|
136
|
+
entry, and `rootClassName` matching the root global class.
|
|
@@ -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.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Collection Toolkit — what to reach for, per user need
|
|
2
|
+
|
|
3
|
+
[UX_SUCCESS_MODEL.md](UX_SUCCESS_MODEL.md) says what a dashboard must do for the person using it. This file says which component does it, so the stage list resolves to real names instead of a hand-rolled approximation.
|
|
4
|
+
|
|
5
|
+
Everything below is a real name in the installed `@wix/patterns`. Confirm the props before writing JSX by reading its doc from `dist/docs/index.json` — and if a name is missing from `dist/dts-bundle/index.json`, the installed version is older than this file; work from that inventory, not from memory.
|
|
6
|
+
|
|
7
|
+
> **The two requirements below are not suggestions.** A page that renders a filtered table and nothing else is the single most common failure of a generated dashboard: it answers "what are all the records" and nothing about how many, which one needs attention, or why something happened. Measured runs produce exactly that page unless the requirement is stated.
|
|
8
|
+
>
|
|
9
|
+
> 1. **A dashboard that reports on records shows aggregate numbers**, not only rows.
|
|
10
|
+
> 2. **A dashboard whose rows represent real business records lets the user open one**, unless the prompt is explicitly a report or an export.
|
|
11
|
+
|
|
12
|
+
## Understand — the aggregate
|
|
13
|
+
|
|
14
|
+
| Need | Component |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Totals, counts, status breakdown above the table | `SummaryBar` |
|
|
17
|
+
| Which subset the numbers describe | wire each metric to the collection's filter state so the count follows the filters |
|
|
18
|
+
|
|
19
|
+
`SummaryBar` sits inside the page shell, above the collection. Compute the values from the same query the table uses, or a count query alongside it — a metric that disagrees with the visible rows is worse than no metric.
|
|
20
|
+
|
|
21
|
+
## Focus — narrowing
|
|
22
|
+
|
|
23
|
+
| Need | Component |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| Free-text search | `CollectionSearch` |
|
|
26
|
+
| The filter bar itself | `CollectionToolbarFilters` |
|
|
27
|
+
| Pick several values from a known list | `MultiSelectCheckboxFilter`, `MultiInlineCheckboxFilter`, `MultiAutoInlineCheckboxFilter` |
|
|
28
|
+
| Pick one value | `SingleSelectFilter`, `RadioGroupFilter`, `TabsFilter` |
|
|
29
|
+
| Values fetched from an API, not a fixed list | `MultiSelectCollectionFilter` + `useFilterCollection` |
|
|
30
|
+
| Type-ahead over many values | `AutoCompleteFilter` |
|
|
31
|
+
| Date or number ranges | `DateRangeFilter`, `NumberRangeFilter` |
|
|
32
|
+
| Comparison operators (greater than, contains) | `OperatorFilterPicker` + `operatorFilter` |
|
|
33
|
+
| The filter's state object | `idNameArrayFilter`, `stringFilter`, `stringsArrayFilter`, `arrayFilter`, `dateRangeFilter`, `customFilter` |
|
|
34
|
+
| A fixed in-memory option list for a filter | `useStaticListFilterCollection` |
|
|
35
|
+
| Sorting | `Sortable Columns`, `MultiLevelSorting` |
|
|
36
|
+
|
|
37
|
+
**Ask for several names at once.** `docs`, `types` and `exports` all take a list — `types ComputedQuery OffsetQuery RangeItem`, `exports page form router` — and each call is a full model turn, so five one-name calls cost five turns for one call's worth of answer. `exports` with no argument lists the 31 entry points; that is a one-off orientation, not something to re-run.
|
|
38
|
+
|
|
39
|
+
**A factory or hook's doc is often empty where its signature should be** — `docs idNameArrayFilter` prints an `## API` heading with nothing under it, because the props table only exists for components. Ask `types idNameArrayFilter` instead and you get the signature: `<T extends { id: string; name: string }>(params?) => ArrayFilterState<T>`. That applies to every `use…` hook and every `…Filter` factory in the table above, and it is the difference between knowing the name and being able to call it.
|
|
40
|
+
|
|
41
|
+
**A filter must narrow the result.** Declare it in the collection hook's `filters` map and read it inside `fetchData`, so the value reaches the query. Filter UI that renders but never changes the rows is a defect that looks like a feature — and it is the failure mode these components exist to prevent.
|
|
42
|
+
|
|
43
|
+
## Investigate — opening one record
|
|
44
|
+
|
|
45
|
+
| Surface | Use when | Built from |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| **Side panel** | Inspect or lightly edit one record while keeping the filtered list on screen. The V1 default for review dashboards. | WDS `SidePanel` — patterns has no side panel |
|
|
48
|
+
| **Entity page** | Multi-section detail, editing, history, or a link someone can share. | `EntityPage` + `useEntityPage`, reached with `usePatternsNavigate().navigateToEntityPage`, form state from `@wix/patterns/form`. The call itself: [ENTITY_PAGE_TOOLKIT.md](ENTITY_PAGE_TOOLKIT.md) |
|
|
49
|
+
| **Expanded row** | A couple of extra fields, no separate workspace needed. | The collection's own row expansion |
|
|
50
|
+
| **Picker / bulk confirm** | Choosing records, or confirming an action on many. | `PickerModal` + `usePickerModal`, `bulkActionModal` |
|
|
51
|
+
|
|
52
|
+
A dialog that creates, updates or displays one listed record is **not** a dashboard modal — a create / "add new" form included, since it writes the record. See [DASHBOARD_MODAL.md](../DASHBOARD_MODAL.md). A row the user cannot open is the second most common failure after the missing aggregate.
|
|
53
|
+
|
|
54
|
+
**Form state on an entity page** comes from `@wix/patterns/form` — `useForm` for the form, `useController` for a single field. That subpath re-exports `@wix/bex-core/form`, which wraps `react-hook-form`, so its API is react-hook-form's and only a handful of its names appear in the patterns docs: `FieldValues`, `ControllerProps` and most of the rest are documented by react-hook-form, not here. `Read <pkgRoot>/dist/dts-bundle/exports/form.d.ts` to see what the subpath actually gives you.
|
|
55
|
+
|
|
56
|
+
## Act and confirm
|
|
57
|
+
|
|
58
|
+
| Need | Component |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| Row actions | `PrimaryActions`, `SecondaryActions`, `More Actions`, `deleteSecondaryAction` |
|
|
61
|
+
| Page-level button | `PrimaryPageButton`, `PrimaryActionButton` |
|
|
62
|
+
| Acting on a multi-row selection | `MultiBulkActionToolbar`, `bulkActionModal` |
|
|
63
|
+
| Immediate feedback, then reconcile | `useOptimisticActions`, `CollectionOptimisticActions` |
|
|
64
|
+
| A banner above the table | `TableTopNotification` |
|
|
65
|
+
|
|
66
|
+
## The states that are not the happy path
|
|
67
|
+
|
|
68
|
+
| State | Component |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| Collection is genuinely empty | `CollectionEmptyState` |
|
|
71
|
+
| Filters or search matched nothing | `CollectionNoResultsState` |
|
|
72
|
+
| Feature needs a paid plan | `CollectionPremiumEmptyState` |
|
|
73
|
+
| Load failed | the collection state's error handling — give the user a way to retry |
|
|
74
|
+
|
|
75
|
+
Empty and no-results are different messages: one means "add your first record", the other means "loosen the filters". Shipping only the first makes a working filter look broken.
|
|
76
|
+
|
|
77
|
+
## Export
|
|
78
|
+
|
|
79
|
+
`ExportButton` (its doc is `ExportTo`) for CSV and similar. Reach for it when the prompt mentions exporting, downloading, or sending records elsewhere.
|