@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Entity Page Toolkit — calling `useEntityPage`
|
|
2
|
+
|
|
3
|
+
[COLLECTION_TOOLKIT.md](COLLECTION_TOOLKIT.md) says a row the user cannot open is a defect, and sends you to `EntityPage` + `useEntityPage` to fix it. This file is the call itself.
|
|
4
|
+
|
|
5
|
+
## The call
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { useEntityPage, EntityPage } from '@wix/patterns';
|
|
9
|
+
import { useForm } from '@wix/patterns/form';
|
|
10
|
+
|
|
11
|
+
interface Shift {
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ShiftFormFields {
|
|
17
|
+
name?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const form = useForm<ShiftFormFields>({ defaultValues: { name: '' } });
|
|
21
|
+
|
|
22
|
+
const state = useEntityPage<Shift, ShiftFormFields>({
|
|
23
|
+
fetch: () => api.getShift(shiftId).then((entity) => ({ entity })),
|
|
24
|
+
onSave: ({ widgetsFormData }) =>
|
|
25
|
+
api
|
|
26
|
+
.updateShift(shiftId, { ...form.getValues(), ...widgetsFormData })
|
|
27
|
+
.then((updatedEntity) => ({ updatedEntity })),
|
|
28
|
+
form,
|
|
29
|
+
parentPath: '/shifts',
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`EntityPage` and `useEntityPage` are **root** exports. `@wix/patterns/page` holds `CollectionPage` and `WidgetsFormProvider` only, so importing the entity page from there is `TS2305: has no exported member` — the collection page and the entity page do not live in the same place. `Read <pkgRoot>/dist/dts-bundle/exports/page.d.ts` to see what that subpath actually gives you.
|
|
34
|
+
|
|
35
|
+
## Name both generics
|
|
36
|
+
|
|
37
|
+
`useEntityPage<T, V extends FieldValues = FieldValues>` takes the entity type **and** the form-values type. `V` does not infer from the `form` argument — it falls back to `FieldValues`, and a `useForm<ShiftFormFields>()` then fails to assign with `Type 'UseFormReturn<ShiftFormFields, …>' is not assignable to type 'UseFormReturn<FieldValues>'`. Naming a single generic only works when the form is untyped.
|
|
38
|
+
|
|
39
|
+
`useEntityPage<any, ShiftFormFields>` makes that error go away and takes the entity type with it — `state.entity` becomes `any`, and every field access below it stops being checked. Name the entity type.
|
|
40
|
+
|
|
41
|
+
## `onSave` does not hand you the form values
|
|
42
|
+
|
|
43
|
+
`OnSaveParams` has exactly one key. `widgetsFormData` carries what the **widget** fields contributed — extended fields, tags — not what the user typed into your own fields. Those come from the form you already own:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
onSave: ({ widgetsFormData }) => {
|
|
47
|
+
const values = form.getValues(); // your fields
|
|
48
|
+
const { extendedFields, tags } = widgetsFormData; // widget fields
|
|
49
|
+
…
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Reaching for a `values`-shaped key on the `onSave` argument is the usual first guess, and there isn't one.
|
|
54
|
+
|
|
55
|
+
## The params are a `Pick`
|
|
56
|
+
|
|
57
|
+
`UseEntityPageParams` picks a fixed set off `EntityPageStateParams` — `fetch`, `onSave`, `saveSuccessToast`, `saveErrorToast`, `deleteAction`, `transformEntityToCollectionItem`, `isNewEntity`, `form`, `parentPageId`, `parentPath`, `parentReferrer`, `schemaSource`. Anything outside that list is an excess-property error on the object literal. `container` is the common guess and is not one of them: the hook calls `useWixPatternsContainer()` itself.
|
|
58
|
+
|
|
59
|
+
Confirm the shape rather than guessing — the hook's doc has an empty API section, because props tables only exist for components. `Read <pkgRoot>/dist/dts-bundle/index.json`, then `Read` the bundled `.d.ts` for each of `useEntityPage`, `UseEntityPageParams`, and `OnSaveParams` at exactly the `file` path the index gives.
|
|
60
|
+
|
|
61
|
+
## Around the call
|
|
62
|
+
|
|
63
|
+
| Step | What owns it |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| Getting here from the collection page | `usePatternsNavigate()` → `navigateToEntityPage({ path, entity })` |
|
|
66
|
+
| Registering the route | `PatternsReactRoute` inside `PatternsReactRouter` |
|
|
67
|
+
| Form state and field binding | `useForm` / `useController` from `@wix/patterns/form` |
|
|
68
|
+
| Body layout | `EntityPage.Header`, `.MainContent`, `.AdditionalContent`, `.Card` |
|
|
69
|
+
| The fields inside those cards | `@wix/design-system` (`FormField`, `Input`, `Text`) |
|
|
70
|
+
|
|
71
|
+
`@wix/patterns/form` re-exports `@wix/bex-core/form`, which wraps `react-hook-form` — so `form.getValues()`, `form.reset()` and the rest are react-hook-form's API, documented there rather than in the patterns docs.
|
|
72
|
+
|
|
73
|
+
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).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Reading `@wix/patterns` Bundles and Docs
|
|
2
|
+
|
|
3
|
+
> **Scope.** You are here because a lookup in `dist/dts-bundle/index.json` or
|
|
4
|
+
> `dist/docs/index.json` gave you an entry and you are about to open the file it names. Getting to that index in the first
|
|
5
|
+
> place — resolving the package root, the version floor, the docs lookup, and the rule
|
|
6
|
+
> against browsing `node_modules` by hand — is in
|
|
7
|
+
> [WIX_PATTERNS_DOCS.md](../WIX_PATTERNS_DOCS.md). Nothing here replaces those steps.
|
|
8
|
+
|
|
9
|
+
## Types the docs don't cover
|
|
10
|
+
|
|
11
|
+
The docs cover components and props, not the types those props use — `Filter<T>`, `RangeItem<T>`, `CursorQuery`, a `...Props` interface. `Read <pkgRoot>/dist/dts-bundle/index.json`, look up the type name, then `Read <pkgRoot>/dist/dts-bundle/<entry.file>` using exactly the `file` path the index gives — **never reconstruct the path from the name**; bundles are nested one directory per kind (`components/Table.d.ts`, `hooks/useForm.d.ts`, `types/RangeItem.d.ts`, …), so guessing `<Name>.d.ts` at the top level is wrong by construction.
|
|
12
|
+
|
|
13
|
+
Several of these types (`RangeItem`, `Filter`, `CursorQuery`, the filter factory functions) actually live in `@wix/bex-core` — the bundle already resolves and inlines the real declaration, so you get the full shape with no deep, undeclared `@wix/bex-core/dist/types/...` path to chase. Still always import it from `@wix/patterns`, per the index's `importPath` field, never from wherever the bundle says it's really declared.
|
|
14
|
+
|
|
15
|
+
That inlining applies to the data shapes you write. State objects you *receive* are a separate case — see the next section.
|
|
16
|
+
|
|
17
|
+
## A bundle stops where you stop writing code
|
|
18
|
+
|
|
19
|
+
A bundle carries its own name's declaration plus every shape **you** would write by hand. It deliberately does *not* expand what the library hands you, so two kinds of one-line stub are normal and are answers, not truncation:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
/**
|
|
23
|
+
* `TableState` — you receive this, you don't construct it.
|
|
24
|
+
* Produced by `useTableCollection()` (also `useAmbassadorTable()`, `useTableContext()`).
|
|
25
|
+
* Look `TableState` up in the bundle index for its own API.
|
|
26
|
+
*/
|
|
27
|
+
declare class TableState<T, F> {
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
An empty body with a **"Produced by"** note means: call that hook or factory to get one. That is usually the whole answer — `<Table state={...}>` needs `useTableCollection()`, not `TableState`'s internals. If you do need its members (`state.toolbar`, `state.visibleColumns`), it has its own index entry — look the name up and read that bundle, where its body is complete.
|
|
32
|
+
|
|
33
|
+
A stub saying **"cut here because it has its own bundle"** means the same thing for a shape you *do* write: it wasn't copied in twice, so look the name up and read its own file.
|
|
34
|
+
|
|
35
|
+
Every bundle fits in a single read; the index's `bytes` field says how big before you open it. So a bundle is never partially shown — if something looks missing, it was cut on purpose and the stub names where to find it.
|
|
36
|
+
|
|
37
|
+
A handful of names carry `"status": "unreachable"` with a message saying not to import them (the `...BaseProps` interfaces a component's props `extends`). Read those for the props they contribute; don't write an import for them.
|
|
38
|
+
|
|
39
|
+
## Subpath entry points
|
|
40
|
+
|
|
41
|
+
`@wix/patterns` is 31 entry points, not one namespace, and `/form` re-exports `@wix/bex-core/form`. To see what's importable from a specific one: `Read <pkgRoot>/dist/dts-bundle/exports/<subpath>.d.ts` directly (`.` is `exports/index.d.ts`; a nested one like `./testkit/backend` is `exports/testkit/backend.d.ts`). This only lists the curated names covered above — a file with nothing in it (a one-line comment) means no curated name lives on that subpath yet, not that the subpath doesn't exist.
|
|
42
|
+
|
|
43
|
+
## Following cross-references
|
|
44
|
+
|
|
45
|
+
Docs link to related names as Storybook URLs (`[TableState](./?path=/story/...--tablestate)`) — resolve the link text back to a filename via `dist/docs/index.json`, the same way you found the first doc, and `Read` it if you actually need it. There's no automatic multi-level expansion here; follow only the links you need.
|
|
46
|
+
|
|
47
|
+
Links to `https://www.docs.wixdesignsystem.com/` are external (Wix Design System) — not part of `@wix/patterns` docs. Likewise, a bundled `.d.ts` that references a deep `@wix/design-system/dist/...` path is pointing at that library's own internals — look the name up via the `wix-design-system` skill's own tool, not by opening the path.
|
|
48
|
+
|
|
49
|
+
## Tips
|
|
50
|
+
|
|
51
|
+
- **Compound components** have separate docs per sub-part: `CollectionPage.md`, `CollectionPage.Header.md`, `CollectionPage.Content.md`.
|
|
52
|
+
- **Hook docs** list configuration options as props in the API table.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Dashboard UX Success Model
|
|
2
|
+
|
|
3
|
+
What makes a generated dashboard page actually *succeed* for the person using it. Use this to turn a vague prompt ("help me manage order exceptions") into concrete requirements, and as the checklist before calling a dashboard done.
|
|
4
|
+
|
|
5
|
+
Ported from the FeatureVibe dashboard product doc.
|
|
6
|
+
|
|
7
|
+
> **North Star.** A successful dashboard helps a site owner or collaborator **understand what matters, complete the intended task, and trust the result**. It fulfills the user's prompt through a clear workflow, the right presentation, and trustworthy business data.
|
|
8
|
+
|
|
9
|
+
This file is about *what to build*. For *how* to build it, see [WDS_LAYOUT.md](WDS_LAYOUT.md) for content layout and [DASHBOARD_PAGE.md](../DASHBOARD_PAGE.md) for the `@wix/patterns` → `@wix/design-system` component order — the workflow stages below are user needs, not an excuse to hand-roll shells, tables, or filter bars.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## The Success Model
|
|
13
|
+
|
|
14
|
+
A generated dashboard succeeds across three connected dimensions.
|
|
15
|
+
|
|
16
|
+
| Success dimension | What must be true |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Workflow success | The dashboard supports a complete journey from understanding to a confirmed outcome. |
|
|
19
|
+
| Presentation success | Information is shown clearly and in the format that best supports the task. |
|
|
20
|
+
| Data success | Information is accurate and consistent, including when it comes from multiple sources. |
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## The Workflow Journey
|
|
24
|
+
|
|
25
|
+
The prompt defines the outcome. The stages define the journey from understanding the situation to confirming the result. They are **user needs**, not necessarily separate screens or a rigid sequence.
|
|
26
|
+
|
|
27
|
+
| Stage | User outcome |
|
|
28
|
+
|---|---|
|
|
29
|
+
| **Understand** | Know the current situation. |
|
|
30
|
+
| **Focus** | Recognize what matters or requires attention. |
|
|
31
|
+
| **Investigate** | Access the details needed to decide. |
|
|
32
|
+
| **Act** | Complete the intended business task. |
|
|
33
|
+
| **Feedback** | See that the action succeeded and the state changed correctly. |
|
|
34
|
+
|
|
35
|
+
### 1. Understand
|
|
36
|
+
|
|
37
|
+
**Intent:** Help the user understand the business area this dashboard supports, what the data represents, and how to interpret it.
|
|
38
|
+
|
|
39
|
+
- Present the most important totals, trends, and status indicators.
|
|
40
|
+
- Make scope, time range, and freshness clear.
|
|
41
|
+
- Distinguish no data, loading, access, connection, and system problems.
|
|
42
|
+
- Connect summaries to underlying items.
|
|
43
|
+
|
|
44
|
+
**Success:** The user can explain what is happening now.
|
|
45
|
+
|
|
46
|
+
### 2. Focus
|
|
47
|
+
|
|
48
|
+
**Intent:** Help the user recognize what matters or requires attention.
|
|
49
|
+
|
|
50
|
+
- Choose the view that best supports the task.
|
|
51
|
+
- Reduce noise through hierarchy, search, filters, sorting, saved views, and alerts.
|
|
52
|
+
- Explain empty results and offer a useful next step.
|
|
53
|
+
- Make the most important next action clear.
|
|
54
|
+
|
|
55
|
+
**Success:** The user knows where to direct attention and what to do next.
|
|
56
|
+
|
|
57
|
+
### 3. Investigate
|
|
58
|
+
|
|
59
|
+
**Intent:** Give the user enough context to make a confident decision.
|
|
60
|
+
|
|
61
|
+
- Reveal detail progressively without making users lose their place.
|
|
62
|
+
- Show related information, history, and meaningful connections.
|
|
63
|
+
- Make missing, unmatched, or uncertain information visible.
|
|
64
|
+
|
|
65
|
+
**Success:** The user can understand why something happened and decide how to respond.
|
|
66
|
+
|
|
67
|
+
### 4. Act
|
|
68
|
+
|
|
69
|
+
**Intent:** Let the user complete the intended business task.
|
|
70
|
+
|
|
71
|
+
- Provide the actions required by the prompt and allowed by permissions.
|
|
72
|
+
- Support individual and bulk actions when both are useful.
|
|
73
|
+
- Make consequences clear and protect against destructive mistakes.
|
|
74
|
+
|
|
75
|
+
**Success:** The user can complete the task without leaving the workflow or guessing what to do.
|
|
76
|
+
|
|
77
|
+
### 5. Feedback
|
|
78
|
+
|
|
79
|
+
**Intent:** Confirm that the action succeeded and the business state changed correctly.
|
|
80
|
+
|
|
81
|
+
- Provide immediate feedback after an action.
|
|
82
|
+
- Refresh relevant items, summaries, counts, filters, and views.
|
|
83
|
+
- Keep status and history visible when users may need to return later.
|
|
84
|
+
|
|
85
|
+
**Success:** The user can see the confirmed result everywhere it matters.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## The 5 WHATs
|
|
89
|
+
|
|
90
|
+
How to gain enough context to ensure a complete workflow. Translate each prompt into concrete journey requirements:
|
|
91
|
+
|
|
92
|
+
- What outcome is the user trying to achieve?
|
|
93
|
+
- What must they understand before acting?
|
|
94
|
+
- What requires deeper investigation?
|
|
95
|
+
- Which actions must be available?
|
|
96
|
+
- What visible result will confirm success?
|
|
97
|
+
|
|
98
|
+
> **Example:** "Help me manage order exceptions" requires an overview of open issues, ways to focus on urgent cases, enough order context to decide, actions to resolve each issue, and confirmation that resolved items leave the active list.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## Presentation Success
|
|
102
|
+
|
|
103
|
+
Presentation success applies across all five stages. Choose both the right **representation** and the right **interaction surface**, while keeping hierarchy, meaning, and state consistent.
|
|
104
|
+
|
|
105
|
+
### Choosing the Right View
|
|
106
|
+
|
|
107
|
+
| View | Use when… | Success looks like… |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| **Table** | Users compare many records across several attributes. | Records are easy to scan, compare, filter, select, and act on. |
|
|
110
|
+
| **Gallery** | Visual recognition is central. | Images identify items while key status and actions remain visible. |
|
|
111
|
+
| **List** | Items have one dominant identity and limited supporting detail. | Users scan quickly without unnecessary density. |
|
|
112
|
+
| **Kanban** | Work moves through meaningful stages. | Stage, workload, and valid movement are understandable. |
|
|
113
|
+
| **Timeline or calendar** | Time, sequence, or scheduling matters. | Upcoming activity, conflicts, and timing are clear. |
|
|
114
|
+
| **Chart** | The user needs to understand a trend or relationship. | The visualization answers a specific business question. |
|
|
115
|
+
| **Summary metrics** | The user needs a quick health signal. | Metrics clarify current conditions and where to focus. |
|
|
116
|
+
|
|
117
|
+
- Choose the default view that best supports the primary task.
|
|
118
|
+
- Offer another view only when it provides distinct value.
|
|
119
|
+
- Keep filters, state, and meaning consistent when users change views.
|
|
120
|
+
- Connect summaries and visualizations back to the relevant records.
|
|
121
|
+
|
|
122
|
+
### Choosing the Right Drill-In
|
|
123
|
+
|
|
124
|
+
Choose the smallest interface that gives users enough context and room to complete the task. These are defaults, not rigid rules.
|
|
125
|
+
|
|
126
|
+
| Interface | Use when… | Success looks like… |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| **Side panel** | The user should review or update one item while keeping the dashboard visible. | Context is preserved while deeper work remains focused. |
|
|
129
|
+
| **Modal** | The user needs to complete a focused, bounded task or decision. | Attention stays on one task and the user can return cleanly. |
|
|
130
|
+
| **Entity page** | The task involves complex details, multi-section editing, history, or related information. | The user has enough space and structure to complete deeper work. |
|
|
131
|
+
| **Inline or expanded row** | The user needs a quick inspection or simple action. | Detail appears without creating a separate workspace. |
|
|
132
|
+
|
|
133
|
+
Which Wix primitive builds each of these — and which components serve the summaries, filters and empty states named above — is in [Collection Toolkit](COLLECTION_TOOLKIT.md). Patterns has no side panel; that one is WDS.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Data Success
|
|
137
|
+
|
|
138
|
+
Data success means giving users a complete and trustworthy view of the business. A dashboard may rely on one source or connect related customer, transaction, payment, and operational data.
|
|
139
|
+
|
|
140
|
+
### Major Data Sources
|
|
141
|
+
|
|
142
|
+
| Data source | What it provides |
|
|
143
|
+
|---|---|
|
|
144
|
+
| **CMS** | Custom collections, items, references, and custom business records. |
|
|
145
|
+
| **Stores** | Products, variants, categories, inventory, and locations. |
|
|
146
|
+
| **eCommerce** | Carts, checkouts, orders, line items, and fulfillment. |
|
|
147
|
+
| **Bookings** | Services, appointments, classes, courses, staff, availability, and attendance. |
|
|
148
|
+
| **Contacts and Members** | Customer identity, profiles, labels, roles, and audience context. |
|
|
149
|
+
| **Payments and Pricing Plans** | Transactions, refunds, payouts, plans, subscriptions, and renewals. |
|
|
150
|
+
| **Events** | Events, tickets, registrations, guests, and check-ins. |
|
|
151
|
+
| **Other connected sources** | Restaurants, Forms, Invoices, Programs, and external systems. |
|
|
152
|
+
|
|
153
|
+
### What Must Succeed Across Sources
|
|
154
|
+
|
|
155
|
+
| Requirement | User outcome |
|
|
156
|
+
|---|---|
|
|
157
|
+
| **Meaningful relationship** | Sources combine around the business item or decision the user cares about. |
|
|
158
|
+
| **Consistent meaning** | Shared concepts use understandable and consistent language. |
|
|
159
|
+
| **Clear gaps** | Missing or unmatched information is visible rather than silently ignored. |
|
|
160
|
+
| **Trusted actions** | Actions update the correct source and the result appears everywhere relevant. |
|
|
161
|
+
| **Right level of combination** | Related items may be combined; useful but distinct sources remain separate. |
|
|
162
|
+
|
|
163
|
+
> The goal is not to merge everything. Combine sources when the relationship helps users understand or act; otherwise keep them separate but connected.
|
|
164
|
+
|
|
165
|
+
### Multi-Source Examples
|
|
166
|
+
|
|
167
|
+
| Single view | Primary record | Connected sources | User outcome |
|
|
168
|
+
|---|---|---|---|
|
|
169
|
+
| **Order exceptions** | eCommerce order | Payments, Contacts, Stores | Resolve unpaid, delayed, or incorrect orders from one queue. |
|
|
170
|
+
| **Booking follow-up** | Booking or appointment | Bookings, Contacts, Payments | Find missed or unpaid appointments and contact the client. |
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## Evaluation
|
|
174
|
+
|
|
175
|
+
Rendering is not enough. A successful dashboard passes every check below.
|
|
176
|
+
|
|
177
|
+
- [ ] **Prompt fulfilled:** The main result requested by the user is delivered.
|
|
178
|
+
- [ ] **Task completion:** The intended task works from entry to confirmed result.
|
|
179
|
+
- [ ] **Presentation fit:** Layout, actions, and empty states make the task easy to understand and complete.
|
|
180
|
+
- [ ] **Trusted data:** All sources and views form one accurate picture of the business.
|
|
181
|
+
- [ ] **Consistent results:** Actions, filters, views, summaries, and details agree.
|
|
182
|
+
- [ ] **Business fit:** The experience matches the user's context, role, and permissions.
|
|
183
|
+
|
|
184
|
+
> **Final evaluation question.** Does this dashboard give the user a **clear, trustworthy, and effective** way to accomplish what they asked for?
|
|
@@ -205,21 +205,21 @@ Wire the named part completely:
|
|
|
205
205
|
|
|
206
206
|
## 4. Suppress Autoplay in `component.preview.tsx`
|
|
207
207
|
|
|
208
|
-
The Wix CLI scaffold generates `component.preview.tsx`.
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
The Wix CLI scaffold generates `component.preview.tsx`. Read the file first,
|
|
209
|
+
then edit only the body of the existing preview component. Do not overwrite
|
|
210
|
+
the file from scratch.
|
|
211
211
|
|
|
212
|
-
###
|
|
212
|
+
### Edit the generated `component.preview.tsx`
|
|
213
213
|
|
|
214
|
-
Add `useIsEditMode` to the existing `@wix/react-component-utils` import.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
Add `useIsEditMode` to the existing `@wix/react-component-utils` import. Then
|
|
215
|
+
edit only the body of the existing `ComponentNamePreview` function — add the
|
|
216
|
+
`isEditMode` check and gate the autoplay props. Do not touch the
|
|
217
|
+
`withFallbackPlaceholder` call, the `withDefaults` export, or any other part
|
|
218
|
+
of the file.
|
|
218
219
|
|
|
219
220
|
```tsx
|
|
220
|
-
const
|
|
221
|
+
const ComponentNamePreview: FC<ComponentProps<typeof Component>> = (props) => {
|
|
221
222
|
const isEditMode = useIsEditMode();
|
|
222
|
-
|
|
223
223
|
return (
|
|
224
224
|
<Component
|
|
225
225
|
{...props}
|
|
@@ -243,4 +243,5 @@ In preview mode (`isEditMode` is `false`) → both use the user's configured val
|
|
|
243
243
|
- [ ] Hover has a paired editor design state; `:focus-visible` remains a
|
|
244
244
|
standalone keyboard indicator.
|
|
245
245
|
- [ ] Hover-only visibility changes behavior, not the button's editable styling surface.
|
|
246
|
-
- [ ] The preview
|
|
246
|
+
- [ ] The preview exports the adapter with synchronized fallback metadata and
|
|
247
|
+
disables autoplay in design mode.
|
|
@@ -26,6 +26,7 @@ using CSS Modules `@value`, then consume with `var()`.
|
|
|
26
26
|
**Body:** `wst-paragraph-1..3-font` / `wst-paragraph-1..3-color`
|
|
27
27
|
|
|
28
28
|
- Do not use `var(--wst-*)` directly; import the `@value` alias first.
|
|
29
|
+
- Do not pass a fallback as `var()`'s second argument
|
|
29
30
|
- Do not use `@import`; CSS Modules resolves theme aliases through `@value`.
|
|
30
31
|
- Do not use `wst-base-1-color` for text. Prefer heading/paragraph color tokens,
|
|
31
32
|
or `wst-base-2-color` when a base contrast color is required.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Browser Support
|
|
2
|
+
|
|
3
|
+
Which CSS features and DOM APIs an Editor React Component may use. This is about
|
|
4
|
+
support in the visitor's browser, a separate question from whether an API exists
|
|
5
|
+
during server rendering.
|
|
6
|
+
|
|
7
|
+
## The rule
|
|
8
|
+
|
|
9
|
+
**Use only features at Baseline "Widely Available", or ones that fall back to it** —
|
|
10
|
+
supported for 30+ months in every browser [Wix
|
|
11
|
+
supports](https://support.wix.com/en/article/supported-devices-browsers-and-operating-systems):
|
|
12
|
+
Chrome (desktop + Android), Edge, Firefox (desktop + Android), Safari (macOS +
|
|
13
|
+
iOS/iPadOS).
|
|
14
|
+
|
|
15
|
+
A fallback must genuinely degrade rather than break: the unsupported path still
|
|
16
|
+
has to render a usable component.
|
|
17
|
+
|
|
18
|
+
## Deciding, without looking it up
|
|
19
|
+
|
|
20
|
+
These rules resolve nearly everything. Stop at the first step that answers:
|
|
21
|
+
|
|
22
|
+
1. **Named literally in the skill or repository instructions?** → pre-authorized:
|
|
23
|
+
use it, no warning. A string test, not a judgment call — `@property` in your
|
|
24
|
+
instructions authorizes it, a general endorsement of modern CSS authorizes
|
|
25
|
+
nothing. A feature named only in the *user's* request is **not** pre-authorized;
|
|
26
|
+
run the steps below, then the [insist protocol](#insist-protocol).
|
|
27
|
+
2. **Date arithmetic.** Subtract 30 months from today's real date. Was it already
|
|
28
|
+
shipping in every browser above by then? Mobile lags — iOS Safari and Firefox
|
|
29
|
+
Android are the usual holdouts.
|
|
30
|
+
3. **Smell test**, when that's inconclusive. Widely Available means *boring* for 2.5
|
|
31
|
+
years. Learned it as "the modern way", or would enjoy showing it off → no. Plain
|
|
32
|
+
CSS or DOM you'd have written five years ago → yes. Called "now Baseline"
|
|
33
|
+
anywhere → that phrasing marks *newly* available → no.
|
|
34
|
+
4. **Still unsure → not permitted.** Permitting wrongly ships a component that is
|
|
35
|
+
broken for real visitors; denying wrongly costs only a slightly plainer
|
|
36
|
+
implementation the user can ask you to change.
|
|
37
|
+
|
|
38
|
+
Search only when it earns the cost — the user asks about support directly, or the
|
|
39
|
+
feature is central enough that deny-and-offer would waste a real round trip. Prefer
|
|
40
|
+
fetching an MDN or caniuse page over driving a browser.
|
|
41
|
+
|
|
42
|
+
**Standing exception:** `@property` is always fine for design tokens, generated or
|
|
43
|
+
hand-written — rewriting a token registration, or warning about one, breaks the
|
|
44
|
+
component.
|
|
45
|
+
|
|
46
|
+
**Feels new, is not** — run the arithmetic, not the reputation: `:has()`,
|
|
47
|
+
`@container` size queries, `subgrid`, `color-mix()`, `inert`,
|
|
48
|
+
`Array.prototype.toSorted`.
|
|
49
|
+
|
|
50
|
+
## Insist protocol
|
|
51
|
+
|
|
52
|
+
1. **Build the widely-supported alternative** by default. Don't ask first, and don't
|
|
53
|
+
leave the component unbuilt.
|
|
54
|
+
2. **Use the feature only if the user then asks for it explicitly**, and guard it so
|
|
55
|
+
it degrades rather than breaks — `@supports` for CSS, `CSS.supports()` or a
|
|
56
|
+
capability check for JS.
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
# Editor Preview Entry
|
|
2
2
|
|
|
3
|
-
Use this
|
|
4
|
-
|
|
3
|
+
Use this when creating a component or changing its data, root, or editor-only
|
|
4
|
+
behavior.
|
|
5
5
|
|
|
6
|
-
## Preserve the
|
|
6
|
+
## Preserve the Structure, Synchronize the Contract
|
|
7
7
|
|
|
8
8
|
The Wix CLI scaffold generates `component.preview.tsx` and wires its URL into
|
|
9
9
|
the extension's editor resource. It includes `withDefaults`,
|
|
10
10
|
`withFallbackPlaceholder`, required-data fields, and the root class name.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Keep the wrapper structure and synchronize its values:
|
|
13
|
+
|
|
14
|
+
- Wrap the preview adapter when one exists; otherwise wrap `Component`.
|
|
15
|
+
- In `requiredDataFields`, normally use only the one prop crucial to meaningful
|
|
16
|
+
rendering, such as `animationUrl`. Use more only when each is essential.
|
|
17
|
+
- Set `rootClassName` to the elected root's exact global class, not `styles.root`.
|
|
18
|
+
|
|
19
|
+
Never remove `withFallbackPlaceholder`.
|
|
15
20
|
|
|
16
21
|
## Detect Editor Design Mode
|
|
17
22
|
|
|
@@ -35,10 +40,13 @@ timers, or network activity while a site owner is designing.
|
|
|
35
40
|
For autoplaying components, force autoplay off in editor design mode and keep
|
|
36
41
|
the live/preview prop values unchanged.
|
|
37
42
|
|
|
43
|
+
Export the adapter through `withFallbackPlaceholder` and synchronize its data
|
|
44
|
+
field and root class.
|
|
45
|
+
|
|
38
46
|
## Checklist
|
|
39
47
|
|
|
40
|
-
- [ ] Generated
|
|
41
|
-
- [ ]
|
|
48
|
+
- [ ] Generated wrappers target the preview adapter when one exists.
|
|
49
|
+
- [ ] Normally one crucial data field and the exact root global class are set.
|
|
42
50
|
- [ ] The extension still loads the preview URL as its editor resource.
|
|
43
51
|
- [ ] `useIsEditMode()` is called inside a component.
|
|
44
52
|
- [ ] Live/preview behavior still receives the site owner's original props.
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# CSS Guidelines
|
|
2
2
|
|
|
3
3
|
Use these rules for the scaffolded `<component-name>.module.css` file and any
|
|
4
|
-
colocated CSS Modules owned by internal sub-components.
|
|
5
|
-
decisions outside the request unchanged. These rules keep the component
|
|
4
|
+
colocated CSS Modules owned by internal sub-components. These rules keep the component
|
|
6
5
|
editable by zero config, responsive to its Wix-owned container, and safe in
|
|
7
6
|
both LTR and RTL layouts.
|
|
8
7
|
|
|
8
|
+
**Visual intent.** When the request specifies how the component should look —
|
|
9
|
+
mood, palette, layout style, or a reference — follow that direction. Default to a modern, refined look — intentional layout, pleasing proportions, polished and deliberate styling.
|
|
10
|
+
|
|
9
11
|
## Contents
|
|
10
12
|
|
|
11
13
|
- [Classes and Named Parts](#classes-and-named-parts)
|
|
@@ -177,6 +179,22 @@ A dynamic runtime value that cannot be represented statically may use a narrowly
|
|
|
177
179
|
scoped CSS custom property set from JSX, but keep the actual style rule in CSS
|
|
178
180
|
and do not expose a visual prop solely for that purpose.
|
|
179
181
|
|
|
182
|
+
```css
|
|
183
|
+
/* Typography: zero config builds the `font` control from both longhands.
|
|
184
|
+
A part with a size but no family gets a control with no default. */
|
|
185
|
+
.cta {
|
|
186
|
+
font-family: 'Inter', sans-serif;
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
font-weight: 600;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Avoid: a module-only wrapper is not an editor element. A size here is
|
|
192
|
+
uneditable and silently overrides the parent's typography control. */
|
|
193
|
+
.cta-label {
|
|
194
|
+
font-size: 14px;
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
180
198
|
## Interaction and Motion
|
|
181
199
|
|
|
182
200
|
- Set `pointer-events: auto` on the root and each interactive element.
|
|
@@ -194,20 +212,30 @@ and do not expose a visual prop solely for that purpose.
|
|
|
194
212
|
|
|
195
213
|
## Default Visual Quality
|
|
196
214
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
215
|
+
Create a clear hierarchy with at least two techniques that fit the component:
|
|
216
|
+
a defined surface, border or soft shadow, type scale or weight, spacing, an
|
|
217
|
+
accent, or visible interaction states. Use these neutral defaults unless the
|
|
218
|
+
request or existing design provides better values:
|
|
219
|
+
|
|
220
|
+
- 16px or larger body text, 14px or larger labels, and 600–700 weight for titles
|
|
221
|
+
- 8–16px spacing inside controls and 16–32px spacing inside containers
|
|
222
|
+
- 8–12px corner radii for cards and controls; `50%` for circular media
|
|
223
|
+
- a subtle border or soft shadow when a card, panel, or control needs separation
|
|
224
|
+
- touch targets at least 44 by 44px and visible keyboard focus states
|
|
225
|
+
|
|
226
|
+
### Foreground and Background Ownership
|
|
227
|
+
|
|
228
|
+
If the component is a self-contained block (card, panel, banner, accordion item), give the root a background. If it is an inline control meant to blend in (link, ghost button, icon button), control may leave the root transparent instead.
|
|
229
|
+
|
|
230
|
+
- On a transparent root, don't hardcode text or icon colors; inherit them from the parent.
|
|
231
|
+
- Set the background and main text/icon color together on the same element. Any secondary text (captions, hints, icons) must still be readable against that same background.
|
|
232
|
+
- If an interactive state changes the background, set the foreground color in that state too. Don't assume a color inherited from a parent or from a previous state will still look right on the new background.
|
|
233
|
+
- In every default and interactive state, meet WCAG AA contrast: 4.5:1 for body text and 3:1 for large text and UI controls.
|
|
200
234
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
- clear hierarchy and visible focus states
|
|
205
|
-
- generous but consistent spacing
|
|
206
|
-
- transparent root backgrounds unless the design requires a surface
|
|
235
|
+
A neutral owned surface may use a light background with dark primary and
|
|
236
|
+
secondary foregrounds, plus one accessible accent. The exact colors are not a
|
|
237
|
+
contract; the contrast relationship is.
|
|
207
238
|
|
|
208
|
-
Avoid prescribing a brand palette in a generic component. Only when the prompt
|
|
209
|
-
explicitly requests branded or themed output, use its named brand tokens rather
|
|
210
|
-
than hardcoded generic color choices.
|
|
211
239
|
|
|
212
240
|
## Checklist
|
|
213
241
|
|
|
@@ -220,4 +248,9 @@ than hardcoded generic color choices.
|
|
|
220
248
|
- [ ] A sizing chain exists only on bounded growing axes.
|
|
221
249
|
- [ ] Layout is container-driven and uses logical inline properties.
|
|
222
250
|
- [ ] Static styling stays in CSS; custom properties exist only when needed.
|
|
251
|
+
- [ ] Every part that sets `font-size` also sets `font-family`, on the part that
|
|
252
|
+
should own the typography control.
|
|
223
253
|
- [ ] Interactive elements expose pointer events and accessible design states.
|
|
254
|
+
- [ ] Visual containers have deliberate hierarchy rather than bare scaffolding.
|
|
255
|
+
- [ ] Every explicit foreground has a known contrasting background; transparent
|
|
256
|
+
components inherit foregrounds from their host.
|