@wix/agent-skills 1.16.3 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +115 -12
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +1 -1
- package/skills/wix-app/references/BACKEND_API.md +18 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +6 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +10 -2
- package/skills/wix-app/references/DASHBOARD_PAGE.md +32 -70
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +145 -127
- package/skills/wix-app/references/SITE_PLUGIN.md +14 -2
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +74 -68
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +2 -2
- package/skills/wix-app/references/dashboard-page/COLLECTION_TOOLKIT.md +79 -0
- package/skills/wix-app/references/dashboard-page/ENTITY_PAGE_TOOLKIT.md +73 -0
- package/skills/wix-app/references/dashboard-page/PATTERNS_BUNDLE_READING.md +52 -0
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +184 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +182 -99
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +94 -49
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +16 -6
- package/skills/wix-app/references/editor-react-component/BROWSER-SUPPORT.md +56 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +275 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +35 -40
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +167 -445
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +56 -29
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +53 -158
- package/skills/wix-app/references/editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md +78 -0
- package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +42 -134
- package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +11 -3
- package/skills/wix-app/references/editor-react-component/PARTS.md +46 -24
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +63 -179
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +79 -163
- package/skills/wix-app/references/editor-react-component/SITE-CONTEXT-HOOKS.md +36 -21
- package/skills/wix-app/references/editor-react-component/SSR.md +30 -99
- package/skills/wix-base44-connector/SKILL.md +156 -50
- package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +78 -0
- package/skills/wix-base44-connector/scripts/utils.js +239 -45
- package/skills/wix-headless/entry/bootstrap.mjs +9 -2
- package/skills/wix-headless/entry/skill.md +1 -1
- package/skills/wix-headless/references/CAPABILITIES.md +9 -1
- package/skills/wix-headless/references/DESIGN.md +1 -0
- package/skills/wix-headless/references/DISCOVERY.md +2 -1
- package/skills/wix-headless/references/IMAGE_GENERATION.md +1 -0
- package/skills/wix-headless/references/SDK_HANDOFF.md +5 -2
- package/skills/wix-headless/references/SEED.md +2 -1
- package/skills/wix-headless/references/SETUP.md +1 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +2 -2
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +68 -31
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +26 -10
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +8 -8
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +10 -8
- package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +254 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +27 -24
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +13 -0
- package/skills/wix-headless/references/inline-recipes/setup-rentals.md +254 -0
- package/skills/wix-headless/references/managed/AUTHENTICATION.md +5 -0
- package/skills/wix-headless/references/non-astro.md +1 -1
- package/skills/wix-headless-fast/SKILL.md +166 -0
- package/skills/wix-headless-fast/entry/skill.md +99 -0
- package/skills/wix-headless-fast/install/deploy.mjs +433 -0
- package/skills/wix-headless-fast/install/fast-path.mjs +141 -0
- package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +137 -0
- package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +137 -0
- package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +113 -0
- package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +123 -0
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +70 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +99 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +76 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +62 -0
- package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +99 -0
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +24 -0
- package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +16156 -0
- package/skills/wix-headless-fast/references/blog/seed/SEED.md +72 -0
- package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +287 -0
- package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +129 -0
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +143 -0
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +119 -0
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +138 -0
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +54 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +206 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +96 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +70 -0
- package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +76 -0
- package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +22 -0
- package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +11962 -0
- package/skills/wix-headless-fast/references/bookings/seed/SEED.md +61 -0
- package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +302 -0
- package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +179 -0
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +83 -0
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +57 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +151 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +75 -0
- package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +11262 -0
- package/skills/wix-headless-fast/references/cms/seed/SEED.md +103 -0
- package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +324 -0
- package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +149 -0
- package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +66 -0
- package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +176 -0
- package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +118 -0
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +117 -0
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +59 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +136 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +128 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +61 -0
- package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +80 -0
- package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +21 -0
- package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +11884 -0
- package/skills/wix-headless-fast/references/events/seed/SEED.md +86 -0
- package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +276 -0
- package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +150 -0
- package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +317 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +269 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +231 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +135 -0
- package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +10593 -0
- package/skills/wix-headless-fast/references/forms/seed/SEED.md +108 -0
- package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +320 -0
- package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +63 -0
- package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +155 -0
- package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +66 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +88 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +53 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +122 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +50 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +10 -0
- package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +10329 -0
- package/skills/wix-headless-fast/references/members/seed/SEED.md +39 -0
- package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +94 -0
- package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +134 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +115 -0
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +59 -0
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +39 -0
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +58 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +165 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +10197 -0
- package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +78 -0
- package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +258 -0
- package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +133 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +58 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +126 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +37 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +39 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +75 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +45 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +30 -0
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +40 -0
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +11226 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +71 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +279 -0
- package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +165 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +142 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +155 -0
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +55 -0
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +43 -0
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +177 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +165 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +103 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +254 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +146 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +168 -0
- package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +12560 -0
- package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +81 -0
- package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +479 -0
- package/skills/wix-headless-fast/references/shared/CONTENT.md +22 -0
- package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +73 -0
- package/skills/wix-headless-fast/references/shared/DESIGN.md +26 -0
- package/skills/wix-headless-fast/references/shared/app/styles/global.css +52 -0
- package/skills/wix-headless-fast/references/shared/app/wix/config.ts +15 -0
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +27 -0
- package/skills/wix-headless-fast/references/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +76 -0
- package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +46 -0
- package/skills/wix-headless-fast/references/shared/seed/images.mjs +145 -0
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +149 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +121 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductCard.tsx +100 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductDetailView.tsx +130 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductGrid.tsx +48 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/ShopView.tsx +66 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/VariantPicker.tsx +103 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +48 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +140 -0
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +80 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +101 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +221 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +215 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +109 -0
- package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +46 -0
- package/skills/wix-headless-fast/references/storefront/app-astro/pages/products/[slug].astro +56 -0
- package/skills/wix-headless-fast/references/storefront/app-astro/pages/shop.astro +23 -0
- package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +12247 -0
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +85 -0
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +415 -0
- package/skills/wix-manage/SKILL.md +28 -2
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +20 -13
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +24 -11
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +5 -5
- package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +141 -0
- package/skills/wix-manage/references/google-business-profile/connect-google-business-profile.md +134 -0
- package/skills/wix-manage/references/google-business-profile/manage-google-business-profile-locations.md +182 -0
- package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +3 -0
- package/skills/wix-manage/references/seo/manage-seo-tags.md +315 -0
- package/skills/wix-manage/references/seo/manage-url-redirects.md +250 -0
- package/skills/wix-manage/references/sites/query-sites.md +72 -161
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +21 -6
- package/skills/wix-manage/references/stores/update-product-with-options.md +83 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +5 -6
- package/skills/wix-vibe-headless/SKILL.md +18 -4
- package/skills/wix-vibe-headless/install/deploy.cjs +12 -4
- package/skills/wix-vibe-headless/install/pin-agents-md.cjs +2 -1
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +16 -10
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +13 -8
- package/skills/wix-vibe-headless/platforms/base44.md +27 -62
- package/skills/wix-vibe-headless/platforms/generic.md +6 -3
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +45 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +67 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +128 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +5 -3
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +9 -8
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +250 -0
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +12 -5
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +41 -0
- package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.js +267 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +6 -3
- package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +470 -0
- package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +425 -0
- package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +187 -0
- package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +238 -0
- package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +108 -0
- package/skills/wix-vibe-headless/references/forms/seed/SEED.md +1762 -0
- package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +13 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +4 -1
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +23 -11
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +1 -1
- package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +29 -31
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +152 -92
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +37 -38
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +2 -2
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +15 -8
- package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +37 -0
- package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +35 -35
- package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +18 -6
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +30 -7
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +46 -10
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +0 -172
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +0 -143
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +0 -516
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +0 -225
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +0 -6
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +0 -95
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +0 -110
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +0 -51
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +0 -49
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +0 -92
- package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +0 -139
|
@@ -1,139 +1,222 @@
|
|
|
1
|
-
# Accessibility
|
|
1
|
+
# Accessibility Implementation and Review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this reference while authoring Editor React Component props and JSX and
|
|
4
|
+
after every JSX edit.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Contents
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
- [Implementation Contract](#implementation-contract)
|
|
9
|
+
- [Review Scope](#review-scope)
|
|
10
|
+
- [Automated Scanners](#automated-scanners)
|
|
11
|
+
- [Finding Triage](#finding-triage)
|
|
12
|
+
- [Manual Review](#manual-review)
|
|
13
|
+
- [Pre-Fix Checks for Non-Interactive Controls](#pre-fix-checks-for-non-interactive-controls)
|
|
14
|
+
- [Completion Criteria](#completion-criteria)
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
## Implementation Contract
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
- **ALL** accessibility attributes MUST come through the `a11y?: A11y` prop.
|
|
13
|
-
- The `A11y` type includes: `ariaLabel`, `ariaDescribedBy`, `ariaLabelledBy`, `role`, `ariaHidden`, `ariaLive`, and all other ARIA attributes.
|
|
14
|
-
- Users provide ARIA values through the `a11y` prop: `<Component a11y={{ ariaLabel: "..." }} />`
|
|
18
|
+
### Route ARIA Through `a11y`
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
Do not add individual public props such as `ariaLabel`, `ariaDescribedBy`, or
|
|
21
|
+
`role`. Use the platform `A11y` type and convert it at the semantic target.
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
```tsx
|
|
24
|
+
import type { A11y, Direction } from '@wix/editor-react-types';
|
|
25
|
+
import { convertA11yKeysToHtmlFormat } from '@wix/react-component-utils';
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
export type TabsProps = {
|
|
28
|
+
id?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
direction?: Direction;
|
|
31
|
+
a11y?: A11y;
|
|
32
|
+
};
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
<nav {...(a11y && convertA11yKeysToHtmlFormat(a11y))}>{tabs}</nav>;
|
|
35
|
+
```
|
|
23
36
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
Apply root accessibility to the elected root. If requirements assign
|
|
38
|
+
accessibility to a named inner part, route it through that part's
|
|
39
|
+
`elementProps.<name>.a11y` contract and convert it on the actual semantic
|
|
40
|
+
element.
|
|
27
41
|
|
|
28
|
-
|
|
42
|
+
### Provide Accessible Names
|
|
29
43
|
|
|
30
|
-
|
|
31
|
-
// User provides: <ComponentName a11y={{ ariaLabel: "Background music" }} />
|
|
32
|
-
// Component applies to root (using the a11y-to-HTML conversion utility):
|
|
33
|
-
{...(a11y && convertA11yKeysToHtmlFormat(a11y))}
|
|
44
|
+
Use this priority order:
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
1. Prefer visible text that already names the control.
|
|
47
|
+
2. Use user-configurable `a11y` when the name depends on site-owner content.
|
|
48
|
+
3. Use the project's translation mechanism or a `constants.ts` value only for a
|
|
49
|
+
stable system-owned label required by the component contract.
|
|
38
50
|
|
|
39
|
-
|
|
51
|
+
Never hardcode an `aria-label` string directly in JSX.
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
```tsx
|
|
54
|
+
// constants.ts
|
|
55
|
+
export const ARIA_LABELS = {
|
|
56
|
+
playButton: 'Play animation',
|
|
57
|
+
pauseButton: 'Pause animation',
|
|
58
|
+
} as const;
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
// component JSX
|
|
61
|
+
<button
|
|
62
|
+
aria-label={isPlaying ? ARIA_LABELS.pauseButton : ARIA_LABELS.playButton}
|
|
63
|
+
>
|
|
64
|
+
{isPlaying ? <PauseIcon /> : <PlayIcon />}
|
|
65
|
+
</button>;
|
|
66
|
+
```
|
|
52
67
|
|
|
53
|
-
|
|
68
|
+
Icon-only controls require an accessible name. Controls with visible text,
|
|
69
|
+
including an icon plus visible text, usually do not need another ARIA label.
|
|
54
70
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
### Preserve Semantic Ownership
|
|
72
|
+
|
|
73
|
+
- Put roles, labels, descriptions, keyboard handling, and focusability on the
|
|
74
|
+
element that owns the behavior, not on a layout wrapper.
|
|
75
|
+
- Prefer native elements over recreating their semantics with `role`.
|
|
76
|
+
- Hide decorative-only output with `aria-hidden="true"` when appropriate.
|
|
77
|
+
- Preserve heading, list, navigation, and landmark semantics through wrappers.
|
|
78
|
+
- Keep hidden or collapsed state consistent across visuals, focusability, and
|
|
79
|
+
the accessibility tree.
|
|
80
|
+
|
|
81
|
+
## Review Scope
|
|
82
|
+
|
|
83
|
+
Run this review after creating or editing JSX.
|
|
84
|
+
|
|
85
|
+
| Request | Scan and inspect |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| Specific file | That file and rendered wrappers or shared components it imports |
|
|
88
|
+
| A component name or "this component" | All hand-edited files in its component folder plus relevant shared imports |
|
|
89
|
+
| Full audit | Every component under `src/extensions/site/components/` plus relevant shared imports |
|
|
90
|
+
|
|
91
|
+
Exclude `*.generated.ts`; it is regenerated from JSX and CSS.
|
|
92
|
+
Imported shared components are inspection context, not automatic edit scope.
|
|
93
|
+
Report a confirmed shared-component issue instead of changing a broadly reused
|
|
94
|
+
primitive unless the requested fix requires that shared change and its impact is
|
|
95
|
+
understood.
|
|
96
|
+
|
|
97
|
+
## Automated Scanners
|
|
98
|
+
|
|
99
|
+
`<SKILL_ROOT>` is the absolute directory containing the active `SKILL.md`. Run
|
|
100
|
+
both commands from the consumer Wix package so dependencies resolve from that
|
|
101
|
+
project. Pass `.tsx` or `.jsx` paths relative to the current directory.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
node <SKILL_ROOT>/scripts/scan-a11y-eslint.cjs <file1> [file2] ...
|
|
105
|
+
node <SKILL_ROOT>/scripts/scan-a11y-code.cjs <file1> [file2] ...
|
|
60
106
|
```
|
|
61
107
|
|
|
62
|
-
|
|
108
|
+
Do not treat scanner startup failure as a clean result. The ESLint scanner
|
|
109
|
+
reports JSX accessibility rules. The semantic scanner follows imports up to
|
|
110
|
+
four levels and emits resolution evidence and confidence. Neither scanner
|
|
111
|
+
covers every Editor React Component contract, so complete the manual review
|
|
112
|
+
even when both return zero findings.
|
|
63
113
|
|
|
64
|
-
|
|
65
|
-
- User-provided labels take precedence when available
|
|
66
|
-
- Constants allow centralized management and potential future translation
|
|
114
|
+
## Finding Triage
|
|
67
115
|
|
|
68
|
-
|
|
116
|
+
For every finding:
|
|
69
117
|
|
|
70
|
-
|
|
118
|
+
1. Trace the rendered semantic element through local and shared components.
|
|
119
|
+
2. Deduplicate findings for the same issue and location; keep the finding with
|
|
120
|
+
stronger evidence.
|
|
121
|
+
3. Assign `confirmed`, `false-positive`, or `not-relevant`.
|
|
122
|
+
4. Fix only confirmed findings.
|
|
71
123
|
|
|
72
|
-
|
|
73
|
-
| --------------------- | ----------------- | ----------------------------------------- |
|
|
74
|
-
| Visible text only | ❌ No | `<Button>Play</Button>` |
|
|
75
|
-
| Icon component + text | ❌ No | `<Button><PlayIcon />Play</Button>` |
|
|
76
|
-
| Icon/emoji only | ✅ YES | `<Button>▶</Button>` |
|
|
77
|
-
| Image only | ✅ YES | `<Button><img src="play.png" /></Button>` |
|
|
78
|
-
| SVG only | ✅ YES | `<Button><svg>...</svg></Button>` |
|
|
124
|
+
Scanner output is a lead, not permission to edit blindly.
|
|
79
125
|
|
|
80
|
-
|
|
126
|
+
### Confidence and Action
|
|
81
127
|
|
|
82
|
-
|
|
128
|
+
| Confidence | Evidence | Action |
|
|
129
|
+
| --- | --- | --- |
|
|
130
|
+
| High | The rendered element and static props directly establish the issue. | Confirm and fix when the change is safe and local. |
|
|
131
|
+
| Medium | Props or partial component resolution strongly imply the semantics. | Inspect surrounding code, then confirm or discard. |
|
|
132
|
+
| Low | Heuristics or unresolved runtime spreads are the main evidence. | Trace further and fix only after confirmation. |
|
|
133
|
+
| Unknown | The semantic target cannot be resolved. | Leave unchanged and report the ambiguity when material. |
|
|
83
134
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
pauseButton: 'Pause audio',
|
|
89
|
-
} as const;
|
|
135
|
+
Confidence establishes whether a finding is real, not whether its fix is safe.
|
|
136
|
+
Apply confirmed local, behavior-preserving fixes. Leave a confirmed issue
|
|
137
|
+
unchanged only when product intent is unknowable or the fix requires risky,
|
|
138
|
+
non-local behavior changes.
|
|
90
139
|
|
|
91
|
-
|
|
92
|
-
<Button
|
|
93
|
-
aria-label={isPlaying ? ARIA_LABELS.pauseButton : ARIA_LABELS.playButton}
|
|
94
|
-
>
|
|
95
|
-
{isPlaying ? '⏸' : '▶'}
|
|
96
|
-
</Button>;
|
|
97
|
-
```
|
|
140
|
+
### Semantic Resolution Order
|
|
98
141
|
|
|
99
|
-
|
|
142
|
+
Resolve rendered behavior in this order:
|
|
100
143
|
|
|
101
|
-
|
|
144
|
+
1. Flagged JSX element and static props
|
|
145
|
+
2. Explicit polymorphic props such as `as="a"` or `component="button"`
|
|
146
|
+
3. Local component implementation
|
|
147
|
+
4. Installed package source or declarations
|
|
148
|
+
5. Prop evidence such as `href`, `to`, `src`, `alt`, and `role`
|
|
149
|
+
6. Component-name heuristics
|
|
102
150
|
|
|
103
|
-
|
|
151
|
+
Follow local imports to their rendered root. For package imports, inspect the
|
|
152
|
+
resolved package entry when available. Do not assign more confidence than the
|
|
153
|
+
evidence supports.
|
|
104
154
|
|
|
105
|
-
|
|
106
|
-
import type { Direction } from '@wix/editor-react-types';
|
|
155
|
+
## Manual Review
|
|
107
156
|
|
|
108
|
-
|
|
109
|
-
id?: string;
|
|
110
|
-
className?: string;
|
|
111
|
-
direction?: Direction;
|
|
112
|
-
ariaLabel?: string; // ❌ Individual ARIA prop
|
|
113
|
-
ariaDescribedBy?: string; // ❌ Individual ARIA prop
|
|
114
|
-
role?: string; // ❌ Individual ARIA prop
|
|
115
|
-
}
|
|
116
|
-
```
|
|
157
|
+
Verify all of the following after triaging scanner output.
|
|
117
158
|
|
|
118
|
-
|
|
159
|
+
### Semantic Targeting
|
|
119
160
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
161
|
+
- `a11y` is typed and converted on the correct semantic element.
|
|
162
|
+
- Wrappers and polymorphic components preserve their documented semantics.
|
|
163
|
+
- Configurable heading or tag choices reach the rendered element.
|
|
164
|
+
- Extension overrides preserve generated accessibility fields.
|
|
123
165
|
|
|
124
|
-
|
|
125
|
-
id?: string;
|
|
126
|
-
className?: string;
|
|
127
|
-
direction?: Direction;
|
|
128
|
-
a11y?: A11y; // ✅ All ARIA attributes through this prop
|
|
129
|
-
}
|
|
166
|
+
### Names and Visual Content
|
|
130
167
|
|
|
131
|
-
|
|
132
|
-
|
|
168
|
+
- Icon-only controls have configurable or stable system-owned names.
|
|
169
|
+
- Visually hidden text remains in the accessibility tree when needed.
|
|
170
|
+
- Meaningful images and icons are named; decorative repetitions are hidden.
|
|
171
|
+
- Accessibility strings are not hardcoded directly in JSX.
|
|
133
172
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
173
|
+
### Hidden Content and Focus
|
|
174
|
+
|
|
175
|
+
- Hidden or collapsed state agrees across visuals, focusability, and the
|
|
176
|
+
accessibility tree.
|
|
177
|
+
- Invisible content cannot receive focus unless the interaction requires it.
|
|
178
|
+
- Disabled and inert states behave consistently for keyboard and assistive
|
|
179
|
+
technology users.
|
|
180
|
+
|
|
181
|
+
### Interaction and Structure
|
|
182
|
+
|
|
183
|
+
- Interactive-looking elements use native semantics or complete role, focus,
|
|
184
|
+
and keyboard behavior.
|
|
185
|
+
- `onClick` on a non-interactive tag is checked, including conditional spreads.
|
|
186
|
+
- Nested interactive children and existing focus management are inspected
|
|
187
|
+
before semantics are added to a wrapper.
|
|
188
|
+
- Lists, headings, landmarks, tabs, menus, dialogs, and breadcrumbs keep their
|
|
189
|
+
intended structure.
|
|
190
|
+
- The root implements the direction contract, and every `ReactNode` slot
|
|
191
|
+
isolates nested content with `dir="ltr"`.
|
|
192
|
+
|
|
193
|
+
## Pre-Fix Checks for Non-Interactive Controls
|
|
194
|
+
|
|
195
|
+
Before adding `role="button"`, `tabIndex`, and keyboard handlers to a non-native
|
|
196
|
+
control, verify:
|
|
197
|
+
|
|
198
|
+
1. **Interactive children:** it cannot contain a link, button, input, or another
|
|
199
|
+
interactive component in the active branch.
|
|
200
|
+
2. **Focus ownership:** existing `tabIndex` or accessibility spreads have a
|
|
201
|
+
clear merge order and one authoritative source.
|
|
202
|
+
3. **Interaction condition:** the same condition gates pointer, focus, and
|
|
203
|
+
keyboard behavior and excludes disabled or editor-controlled states when
|
|
204
|
+
needed.
|
|
205
|
+
4. **Accessible-name scope:** the label intentionally names the component or
|
|
206
|
+
action and persists in every state where it is needed.
|
|
207
|
+
|
|
208
|
+
Prefer a native element when it preserves product behavior.
|
|
209
|
+
|
|
210
|
+
## Completion Criteria
|
|
211
|
+
|
|
212
|
+
The accessibility review is complete only when:
|
|
137
213
|
|
|
138
|
-
|
|
214
|
+
- both scanners start successfully;
|
|
215
|
+
- every finding is triaged;
|
|
216
|
+
- confirmed issues are fixed when safe;
|
|
217
|
+
- the manual review is complete; and
|
|
218
|
+
- both scanners are rerun on every changed `.tsx` or `.jsx` file.
|
|
139
219
|
|
|
220
|
+
Preserve visual and runtime behavior. Fix the semantic owner: root, named inner
|
|
221
|
+
part, shared primitive, or call site. Then return to the main workflow for the
|
|
222
|
+
Wix build, manifest generation, TypeScript check, and relevant project tests.
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
# Animated Components
|
|
1
|
+
# Animated Components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
animation
|
|
5
|
-
|
|
3
|
+
Use this reference when the component's primary content is a **playable
|
|
4
|
+
animation**—a Lottie/JSON animation, an animated GIF/SVG, a canvas/WebGL loop,
|
|
5
|
+
or a video-like surface.
|
|
6
6
|
|
|
7
|
-
Every such component
|
|
7
|
+
Every such component must ship an on-stage **play/pause button**.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Contents
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- [Apply When](#apply-when)
|
|
12
|
+
- [Required Contract](#required-contract)
|
|
13
|
+
- [Define Props](#1-define-props)
|
|
14
|
+
- [Manage Playback State](#2-manage-playback-state)
|
|
15
|
+
- [Add the Play/Pause Button](#3-add-the-playpause-button)
|
|
16
|
+
- [Suppress Autoplay in `component.preview.tsx`](#4-suppress-autoplay-in-componentpreviewtsx)
|
|
17
|
+
- [Checklist](#checklist)
|
|
18
|
+
|
|
19
|
+
## Apply When
|
|
12
20
|
|
|
13
21
|
Apply automatically — without being asked — whenever the component has an
|
|
14
22
|
`autoPlay` prop **or** its primary content is a **startable / loopable**
|
|
@@ -22,25 +30,28 @@ animation a visitor would reasonably want to start or stop:
|
|
|
22
30
|
|
|
23
31
|
**Key rule:** If the component accepts an `autoPlay` prop — even if the
|
|
24
32
|
underlying mechanism is a `setInterval` advancing an index rather than a media
|
|
25
|
-
player
|
|
33
|
+
player, it must expose a play/pause button so visitors can stop the
|
|
26
34
|
auto-advancing behavior. "Autoplay" is a behavior contract, not an
|
|
27
35
|
implementation detail.
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## What to add (checklist)
|
|
37
|
+
## Required Contract
|
|
32
38
|
|
|
33
|
-
1. **Props** — `autoPlay
|
|
39
|
+
1. **Props** — for a new component, use `autoPlay` when it can start
|
|
40
|
+
automatically, `loop` only when repeat behavior is supported, and
|
|
41
|
+
`pauseButtonVisibility` for the on-stage control. When editing, preserve
|
|
42
|
+
existing playback prop names and add only the missing safety contract.
|
|
34
43
|
2. **Playback state** — `isPlaying` + `handlePause` / `handleResume`
|
|
35
|
-
3. **Play/pause button** — overlay `<button>` with inline SVG icon
|
|
44
|
+
3. **Play/pause button** — overlay `<button>` with inline SVG icon and CSS
|
|
45
|
+
positioning; it must be a named part with `elementProps` wiring, a hover
|
|
46
|
+
design state, and a standalone `:focus-visible` keyboard indicator
|
|
36
47
|
4. **Modify `component.preview.tsx`** — suppress autoplay in editor design mode
|
|
37
48
|
5. **Respect `prefers-reduced-motion`** — suppress autoplay when the OS requests reduced motion
|
|
38
49
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## 1. Props
|
|
50
|
+
## 1. Define Props
|
|
42
51
|
|
|
43
|
-
Playback controls are
|
|
52
|
+
Playback controls are behavior props. `pauseButtonVisibility` is the documented
|
|
53
|
+
exception to the usual visual-visibility rule because editor preview must be
|
|
54
|
+
able to force the safety control visible.
|
|
44
55
|
|
|
45
56
|
```typescript
|
|
46
57
|
import type { A11y, Direction } from '@wix/editor-react-types';
|
|
@@ -59,12 +70,17 @@ export interface MyAnimationProps {
|
|
|
59
70
|
|
|
60
71
|
/** Show play/pause button. Default `'showOnHover'`. */
|
|
61
72
|
pauseButtonVisibility?: 'showAlways' | 'showOnHover';
|
|
73
|
+
|
|
74
|
+
elementProps?: {
|
|
75
|
+
playButton?: { className?: string };
|
|
76
|
+
};
|
|
62
77
|
}
|
|
63
78
|
```
|
|
64
79
|
|
|
65
|
-
|
|
80
|
+
The example shows a looping animation. Omit `loop` when the component does not
|
|
81
|
+
support repeat behavior; do not add it only to match the example.
|
|
66
82
|
|
|
67
|
-
## 2. Playback
|
|
83
|
+
## 2. Manage Playback State
|
|
68
84
|
|
|
69
85
|
Track play/pause state with `useState`. Initialize it from `autoPlay` and the OS reduced-motion preference — when the visitor has requested reduced motion, the animation starts paused:
|
|
70
86
|
|
|
@@ -97,9 +113,7 @@ const handleResume = () => setIsPlaying(true);
|
|
|
97
113
|
|
|
98
114
|
Pass `isPlaying` to the animation renderer and toggle between `handlePause` / `handleResume` on button click.
|
|
99
115
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
## 3. Play/pause button
|
|
116
|
+
## 3. Add the Play/Pause Button
|
|
103
117
|
|
|
104
118
|
Create play/pause icons that visually match the component's style. Use simple recognizable shapes — a triangle for play, two rectangles for pause — implemented as inline SVG so there is no external icon dependency. Size, stroke, and fill should feel native to the component's design.
|
|
105
119
|
|
|
@@ -126,31 +140,54 @@ Position the button absolutely so it overlays the content without pushing other
|
|
|
126
140
|
/* e.g. background: rgba(255, 255, 255, 1); */
|
|
127
141
|
}
|
|
128
142
|
|
|
129
|
-
/* Keyboard indicator only
|
|
130
|
-
|
|
143
|
+
/* Keyboard indicator only: focus is not an editor design state on a non-input
|
|
144
|
+
control unless editable focus styling was explicitly requested. */
|
|
131
145
|
.playButton:focus-visible {
|
|
132
146
|
outline: 2px solid currentColor;
|
|
133
147
|
outline-offset: 2px;
|
|
134
148
|
}
|
|
135
149
|
```
|
|
136
150
|
|
|
151
|
+
Define stable system-owned labels outside JSX:
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
// constants.ts
|
|
155
|
+
export const ARIA_LABELS = {
|
|
156
|
+
playButton: 'Play animation',
|
|
157
|
+
pauseButton: 'Pause animation',
|
|
158
|
+
} as const;
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Set the visibility data attribute on the existing elected root, preserving its
|
|
162
|
+
full root contract:
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
data-pause-button-visibility={pauseButtonVisibility ?? 'showOnHover'}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Wire the named part completely:
|
|
169
|
+
|
|
137
170
|
```tsx
|
|
138
|
-
{/* ✅ Named part: play/pause is always a named part — site owners can style it independently */}
|
|
139
171
|
<button
|
|
140
172
|
type="button"
|
|
141
|
-
|
|
173
|
+
{...elementProps?.playButton}
|
|
174
|
+
className={classNames(
|
|
175
|
+
'my-animation-play-button',
|
|
176
|
+
styles.playButton,
|
|
177
|
+
elementProps?.playButton?.className,
|
|
178
|
+
)}
|
|
142
179
|
onClick={isPlaying ? handlePause : handleResume}
|
|
143
|
-
aria-label={
|
|
180
|
+
aria-label={
|
|
181
|
+
isPlaying ? ARIA_LABELS.pauseButton : ARIA_LABELS.playButton
|
|
182
|
+
}
|
|
144
183
|
>
|
|
145
184
|
{isPlaying ? <PauseIcon /> : <PlayIcon />}
|
|
146
185
|
</button>
|
|
147
186
|
```
|
|
148
187
|
|
|
149
188
|
```css
|
|
150
|
-
/*
|
|
151
|
-
|
|
152
|
-
The button itself is a named part (classNames('...-play-button', styles.playButton))
|
|
153
|
-
and must carry both a global class and design-state selectors (see above). */
|
|
189
|
+
/* Narrow behavior-only exception documented in CSS-GUIDELINES.md. Keep editable
|
|
190
|
+
appearance on .playButton and use this relationship only for visibility. */
|
|
154
191
|
|
|
155
192
|
/* showOnHover (default) */
|
|
156
193
|
.root[data-pause-button-visibility="showOnHover"] .playButton {
|
|
@@ -166,37 +203,45 @@ Position the button absolutely so it overlays the content without pushing other
|
|
|
166
203
|
/* showAlways — no extra CSS needed; button is visible by default */
|
|
167
204
|
```
|
|
168
205
|
|
|
169
|
-
|
|
206
|
+
## 4. Suppress Autoplay in `component.preview.tsx`
|
|
170
207
|
|
|
171
|
-
|
|
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.
|
|
172
211
|
|
|
173
|
-
|
|
212
|
+
### Edit the generated `component.preview.tsx`
|
|
174
213
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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.
|
|
178
219
|
|
|
179
220
|
```tsx
|
|
180
|
-
|
|
181
|
-
import MyComponent from './component';
|
|
182
|
-
import { useIsEditMode } from '@wix/react-component-utils';
|
|
183
|
-
|
|
184
|
-
export default function MyComponentPreview(
|
|
185
|
-
props: React.ComponentProps<typeof MyComponent>,
|
|
186
|
-
) {
|
|
221
|
+
const ComponentNamePreview: FC<ComponentProps<typeof Component>> = (props) => {
|
|
187
222
|
const isEditMode = useIsEditMode();
|
|
188
|
-
|
|
189
223
|
return (
|
|
190
|
-
<
|
|
224
|
+
<Component
|
|
191
225
|
{...props}
|
|
192
226
|
autoPlay={isEditMode ? false : props.autoPlay}
|
|
193
227
|
pauseButtonVisibility={isEditMode ? 'showAlways' : props.pauseButtonVisibility}
|
|
194
228
|
/>
|
|
195
229
|
);
|
|
196
|
-
}
|
|
230
|
+
};
|
|
197
231
|
```
|
|
198
232
|
|
|
199
|
-
In editor design mode (`isEditMode` is `true`) → `autoPlay` is forced to `false` and `pauseButtonVisibility` is forced to `'showAlways'` so the site owner can always see and interact with the button.
|
|
233
|
+
In editor design mode (`isEditMode` is `true`) → `autoPlay` is forced to `false` and `pauseButtonVisibility` is forced to `'showAlways'` so the site owner can always see and interact with the button.
|
|
200
234
|
In preview mode (`isEditMode` is `false`) → both use the user's configured values.
|
|
201
235
|
|
|
202
|
-
|
|
236
|
+
## Checklist
|
|
237
|
+
|
|
238
|
+
- [ ] Autoplaying or loopable primary content has an on-stage play/pause control.
|
|
239
|
+
- [ ] Autoplay and pause-control props use the documented contract; `loop` is
|
|
240
|
+
present only when repeat behavior is supported.
|
|
241
|
+
- [ ] Reduced motion starts paused and never restarts playback automatically.
|
|
242
|
+
- [ ] The play/pause button is a fully wired named part with a stable accessible name.
|
|
243
|
+
- [ ] Hover has a paired editor design state; `:focus-visible` remains a
|
|
244
|
+
standalone keyboard indicator.
|
|
245
|
+
- [ ] Hover-only visibility changes behavior, not the button's editable styling surface.
|
|
246
|
+
- [ ] The preview exports the adapter with synchronized fallback metadata and
|
|
247
|
+
disables autoplay in design mode.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# Branded / Themed Components
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
**
|
|
3
|
+
Use this reference only when the prompt explicitly requests a **branded**,
|
|
4
|
+
**themed**, or **brand-aware** component. Do not infer this requirement from a
|
|
5
|
+
generic request for polished styling.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## Rules
|
|
7
8
|
|
|
8
9
|
Import theme tokens from `@wix/react-component-schema/theme-variables.module.css`
|
|
9
10
|
using CSS Modules `@value`, then consume with `var()`.
|
|
@@ -24,6 +25,15 @@ using CSS Modules `@value`, then consume with `var()`.
|
|
|
24
25
|
|
|
25
26
|
**Body:** `wst-paragraph-1..3-font` / `wst-paragraph-1..3-color`
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
- Do not use `var(--wst-*)` directly; import the `@value` alias first.
|
|
29
|
+
- Do not pass a fallback as `var()`'s second argument
|
|
30
|
+
- Do not use `@import`; CSS Modules resolves theme aliases through `@value`.
|
|
31
|
+
- Do not use `wst-base-1-color` for text. Prefer heading/paragraph color tokens,
|
|
32
|
+
or `wst-base-2-color` when a base contrast color is required.
|
|
33
|
+
|
|
34
|
+
## Checklist
|
|
35
|
+
|
|
36
|
+
- [ ] Theme values are imported from `theme-variables.module.css` with `@value`.
|
|
37
|
+
- [ ] Imported aliases are consumed through `var()`.
|
|
38
|
+
- [ ] Typography uses heading/paragraph font and color token pairs.
|
|
39
|
+
- [ ] Text colors remain legible on the selected background token.
|
|
@@ -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.
|