@wix/agent-skills 1.20.1 → 1.22.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 +71 -113
- package/skills/wix-app/references/APP_TOOLS.md +2 -1
- package/skills/wix-app/references/BACKEND_EVENT.md +3 -3
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +41 -152
- package/skills/wix-app/references/DASHBOARD_MODAL.md +4 -4
- package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
- package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
- package/skills/wix-app/references/SDK_MODULE_MAP.md +44 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +36 -190
- package/skills/wix-app/references/app-tools/TOOLS.md +3 -1
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +21 -0
- package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +17 -0
- package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
- package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +4 -18
- package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
- package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
- package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +1 -1
- package/skills/wix-headless-fast/SKILL.md +144 -221
- package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
- package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +15 -15
- package/skills/wix-headless-fast/guides/existing-site.md +76 -0
- package/skills/wix-headless-fast/guides/reference-mode.md +97 -0
- package/skills/wix-headless-fast/install/AGENTS.md +35 -0
- package/skills/wix-headless-fast/install/agents-md.mjs +39 -0
- package/skills/wix-headless-fast/install/attach.mjs +161 -86
- package/skills/wix-headless-fast/install/deploy.mjs +21 -60
- package/skills/wix-headless-fast/install/lock.mjs +55 -0
- package/skills/wix-headless-fast/install/setup.mjs +259 -0
- package/skills/wix-headless-fast/install/templates.mjs +168 -0
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-coupon.md +10 -19
- package/skills/wix-manage/references/events/create-wix-event.md +5 -1
- package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
- package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
- package/skills/wix-headless-fast/install/fast-path.mjs +0 -181
- package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -301
- package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
- package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
- package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
- package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
- package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
- package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
- package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
- package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
- package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
- package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
- package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
- package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
- package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -275
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
- package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
- package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
- package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
- package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
- package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
- package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
- package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
- package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
- package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -353
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
- package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
- package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
- package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
- package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
- package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
- package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
- package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
- package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
- package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -305
- package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
- package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
- package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
- package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
- package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
- package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
- package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
- package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
- package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
- package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
- package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
- package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
- package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
- package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
- package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
- package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
- package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
- package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -338
- package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
- package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
- package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
- package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
- package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
- package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
- package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
- package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
- package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -314
- package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
- package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
- package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
- package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
- package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
- package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
- package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
- package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
- package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
- package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
- package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
- package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
- package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
- package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
- package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
- package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
- package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
- package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
- package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
- package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
- package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -313
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
- package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
- package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
- package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
- package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
- package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
- package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -258
- package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -294
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
- package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
- package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
- package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
- package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
- package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
- package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
- package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -358
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
- package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
- package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
- package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
- package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
- package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
- package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
- package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
- package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
- package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -479
- package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
- package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
- package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
- package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
- package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
- package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
- package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
- package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
- package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
- package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
- package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
- package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
- package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
- package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -608
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -309
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -167
- package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
- package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
- package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
- package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -124
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -525
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Entity → SDK Module Map
|
|
2
|
+
|
|
3
|
+
Data owned by an existing Wix business app is read and written through that app's SDK module — NEVER modeled as a new CMS Data Collection (see the [SDK-First Rule](../SKILL.md#sdk-first-rule-existing-wix-app-data-is-never-cms) in `SKILL.md`). A custom collection for such data starts empty and stays disconnected from the real records (e.g., a "refunds dashboard" built on CMS shows an empty state while refunded orders exist in Wix eCommerce).
|
|
4
|
+
|
|
5
|
+
**Entity → SDK module map** (find the entity the user mentioned, use that package):
|
|
6
|
+
|
|
7
|
+
| Entity | SDK package |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| orders / carts / checkout / refund records / fulfillments | `@wix/ecom` — orders live here regardless of vertical |
|
|
10
|
+
| products / inventory / catalog | `@wix/stores` — ⚠️ V1/V3 check, see [STORES_VERSIONING.md](STORES_VERSIONING.md) |
|
|
11
|
+
| payments / refunds / disputes | `@wix/payments` |
|
|
12
|
+
| invoices / payment links / receipts | `@wix/get-paid` |
|
|
13
|
+
| gift cards | `@wix/gift-vouchers` |
|
|
14
|
+
| coupons | `@wix/marketing` |
|
|
15
|
+
| pricing plans / subscriptions | `@wix/pricing-plans` |
|
|
16
|
+
| bookings / services / staff / time slots | `@wix/bookings` |
|
|
17
|
+
| calendar events / schedules | `@wix/calendar` |
|
|
18
|
+
| table reservations | `@wix/table-reservations` |
|
|
19
|
+
| restaurant menus / online orders | `@wix/restaurants` |
|
|
20
|
+
| blog posts | `@wix/blog` |
|
|
21
|
+
| site events / tickets / RSVPs | `@wix/events` |
|
|
22
|
+
| reviews | `@wix/reviews` |
|
|
23
|
+
| comments | `@wix/comments` |
|
|
24
|
+
| groups | `@wix/groups` |
|
|
25
|
+
| online programs | `@wix/online-programs` |
|
|
26
|
+
| donations | `@wix/donations` |
|
|
27
|
+
| portfolio | `@wix/portfolio` |
|
|
28
|
+
| media files | `@wix/media` |
|
|
29
|
+
| contacts / labels / tasks | `@wix/crm` |
|
|
30
|
+
| members | `@wix/members` |
|
|
31
|
+
| inbox conversations | `@wix/inbox` |
|
|
32
|
+
| forms / form submissions | `@wix/forms` |
|
|
33
|
+
| loyalty points / rewards | `@wix/loyalty` |
|
|
34
|
+
| email marketing | `@wix/email-marketing` |
|
|
35
|
+
| notifications | `@wix/notifications` |
|
|
36
|
+
| analytics | `@wix/analytics-data` |
|
|
37
|
+
| automations | `@wix/automations` |
|
|
38
|
+
| SEO tags / redirects | `@wix/seo` |
|
|
39
|
+
| site search | `@wix/search` |
|
|
40
|
+
| secrets | `@wix/secrets` |
|
|
41
|
+
| locations / site properties | `@wix/business-tools` |
|
|
42
|
+
| app instances | `@wix/app-management` |
|
|
43
|
+
|
|
44
|
+
If the entity isn't listed or you're unsure, run `SearchWixSDKDocumentation` for it — **never conclude CMS with zero MCP calls**. CMS is only for data your app itself introduces (configuration, rules, app-specific records) that no Wix app manages.
|
|
@@ -5,7 +5,7 @@ Site plugins are custom elements that integrate into predefined **slots** within
|
|
|
5
5
|
|
|
6
6
|
## Scaffold
|
|
7
7
|
|
|
8
|
-
Use `wix generate --params` with `extensionType: SITE_PLUGIN`. `slotId` is `<componentId>:<slotId>` — the colon-joined widget component ID and slot ID. Run `wix schema generate --type SITE_PLUGIN` to list the available `slotId` values
|
|
8
|
+
Use `wix generate --params` with `extensionType: SITE_PLUGIN`. `slotId` is `<componentId>:<slotId>` — the colon-joined widget component ID and slot ID. Run `wix schema generate --type SITE_PLUGIN` to list the available `slotId` values. The CLI generates the folder, the plugin `.tsx`, the settings panel `.tsx`, the builder file, the UUID, the logo SVG, and the `src/extensions.ts` registration.
|
|
9
9
|
|
|
10
10
|
## Architecture
|
|
11
11
|
|
|
@@ -43,49 +43,21 @@ Site plugins use native `HTMLElement` custom elements:
|
|
|
43
43
|
```typescript
|
|
44
44
|
// my-site-plugin.tsx
|
|
45
45
|
class MyElement extends HTMLElement {
|
|
46
|
-
static get observedAttributes() {
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
constructor() {
|
|
51
|
-
super();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
connectedCallback() {
|
|
55
|
-
this.render();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
attributeChangedCallback() {
|
|
59
|
-
this.render();
|
|
60
|
-
}
|
|
46
|
+
static get observedAttributes() { return ['display-name']; }
|
|
47
|
+
connectedCallback() { this.render(); }
|
|
48
|
+
attributeChangedCallback() { this.render(); }
|
|
61
49
|
|
|
62
50
|
render() {
|
|
63
51
|
const displayName = this.getAttribute('display-name') || "Your Plugin's Title";
|
|
64
|
-
|
|
65
|
-
this.innerHTML = `
|
|
66
|
-
<div style="font-size: 16px; padding: 16px; border: 1px solid #ccc; border-radius: 8px; margin: 16px;">
|
|
67
|
-
<h2>${displayName}</h2>
|
|
68
|
-
<hr />
|
|
69
|
-
<p>
|
|
70
|
-
This is a Site Plugin generated by Wix CLI.<br />
|
|
71
|
-
Edit your element's code to change this text.
|
|
72
|
-
</p>
|
|
73
|
-
</div>
|
|
74
|
-
`;
|
|
52
|
+
this.innerHTML = `<div style="padding: 16px;"><h2>${displayName}</h2></div>`;
|
|
75
53
|
}
|
|
76
54
|
}
|
|
77
55
|
|
|
78
56
|
export default MyElement;
|
|
79
57
|
```
|
|
80
58
|
|
|
81
|
-
**Key Points
|
|
59
|
+
**Key Points** (beyond the structure already listed under [Architecture](#architecture)):
|
|
82
60
|
|
|
83
|
-
- Extend `HTMLElement` class directly
|
|
84
|
-
- Define `observedAttributes` static getter to list reactive attributes
|
|
85
|
-
- Attributes use **kebab-case** (e.g., `display-name`, `bg-color`)
|
|
86
|
-
- Implement `connectedCallback()` for initial render
|
|
87
|
-
- Implement `attributeChangedCallback()` to re-render when attributes change
|
|
88
|
-
- Use inline styles via template strings
|
|
89
61
|
- Use `this.getAttribute('attribute-name')` to read attribute values
|
|
90
62
|
- Wix handles `define()` for you — do NOT call `customElements.define()` in your code
|
|
91
63
|
|
|
@@ -93,30 +65,22 @@ export default MyElement;
|
|
|
93
65
|
|
|
94
66
|
```typescript
|
|
95
67
|
// my-site-plugin.panel.tsx
|
|
96
|
-
import
|
|
68
|
+
import { type FC, useState, useEffect, useCallback, type ChangeEvent } from 'react';
|
|
97
69
|
import { widget } from '@wix/editor';
|
|
98
|
-
import {
|
|
99
|
-
SidePanel,
|
|
100
|
-
WixDesignSystemProvider,
|
|
101
|
-
Input,
|
|
102
|
-
FormField,
|
|
103
|
-
} from '@wix/design-system';
|
|
70
|
+
import { SidePanel, WixDesignSystemProvider, Input, FormField } from '@wix/design-system';
|
|
104
71
|
import '@wix/design-system/styles.global.css';
|
|
105
72
|
|
|
106
73
|
const Panel: FC = () => {
|
|
107
|
-
const [displayName, setDisplayName] = useState
|
|
74
|
+
const [displayName, setDisplayName] = useState('');
|
|
108
75
|
|
|
109
76
|
useEffect(() => {
|
|
110
|
-
widget.getProp('display-name')
|
|
111
|
-
|
|
112
|
-
.catch(error => console.error('Failed to fetch display-name:', error));
|
|
113
|
-
}, [setDisplayName]);
|
|
77
|
+
widget.getProp('display-name').then(v => setDisplayName(v || "Your Plugin's Title"));
|
|
78
|
+
}, []);
|
|
114
79
|
|
|
115
|
-
const handleDisplayNameChange = useCallback((
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, [setDisplayName]);
|
|
80
|
+
const handleDisplayNameChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
|
81
|
+
setDisplayName(e.target.value);
|
|
82
|
+
widget.setProp('display-name', e.target.value);
|
|
83
|
+
}, []);
|
|
120
84
|
|
|
121
85
|
return (
|
|
122
86
|
<WixDesignSystemProvider>
|
|
@@ -124,12 +88,7 @@ const Panel: FC = () => {
|
|
|
124
88
|
<SidePanel.Content noPadding stretchVertically>
|
|
125
89
|
<SidePanel.Field>
|
|
126
90
|
<FormField label="Display Name">
|
|
127
|
-
<Input
|
|
128
|
-
type="text"
|
|
129
|
-
value={displayName}
|
|
130
|
-
onChange={handleDisplayNameChange}
|
|
131
|
-
aria-label="Display Name"
|
|
132
|
-
/>
|
|
91
|
+
<Input type="text" value={displayName} onChange={handleDisplayNameChange} aria-label="Display Name" />
|
|
133
92
|
</FormField>
|
|
134
93
|
</SidePanel.Field>
|
|
135
94
|
</SidePanel.Content>
|
|
@@ -141,13 +100,9 @@ const Panel: FC = () => {
|
|
|
141
100
|
export default Panel;
|
|
142
101
|
```
|
|
143
102
|
|
|
144
|
-
**Key Points
|
|
103
|
+
**Key Points** (beyond the structure already listed under [Architecture](#architecture)):
|
|
145
104
|
|
|
146
|
-
-
|
|
147
|
-
- Always update both local state AND widget prop in onChange handlers
|
|
148
|
-
- Widget properties are bound to custom element attributes — changes automatically update the corresponding attribute
|
|
149
|
-
- Wrap content in `WixDesignSystemProvider > SidePanel > SidePanel.Content`
|
|
150
|
-
- Use WDS components from `@wix/design-system`
|
|
105
|
+
- Always update both local state AND widget prop in the same onChange handler
|
|
151
106
|
- Import `@wix/design-system/styles.global.css` for styles
|
|
152
107
|
- Include `aria-label` for accessibility
|
|
153
108
|
|
|
@@ -160,28 +115,17 @@ Site plugin settings panels can use `inputs.selectColor()` and `inputs.selectFon
|
|
|
160
115
|
Opens the Wix color picker with theme colors, gradients, and more — **NOT** a basic HTML `<input type="color">`.
|
|
161
116
|
|
|
162
117
|
```typescript
|
|
163
|
-
import
|
|
118
|
+
import { type FC } from 'react';
|
|
164
119
|
import { inputs } from '@wix/editor';
|
|
165
120
|
import { FormField, Box, FillPreview, SidePanel } from '@wix/design-system';
|
|
166
121
|
|
|
167
|
-
interface ColorPickerFieldProps {
|
|
168
|
-
label: string;
|
|
169
|
-
value: string;
|
|
170
|
-
onChange: (value: string) => void;
|
|
171
|
-
}
|
|
122
|
+
interface ColorPickerFieldProps { label: string; value: string; onChange: (value: string) => void; }
|
|
172
123
|
|
|
173
|
-
export const ColorPickerField: FC<ColorPickerFieldProps> = ({
|
|
174
|
-
label,
|
|
175
|
-
value,
|
|
176
|
-
onChange,
|
|
177
|
-
}) => (
|
|
124
|
+
export const ColorPickerField: FC<ColorPickerFieldProps> = ({ label, value, onChange }) => (
|
|
178
125
|
<SidePanel.Field>
|
|
179
126
|
<FormField label={label}>
|
|
180
127
|
<Box width="30px" height="30px">
|
|
181
|
-
<FillPreview
|
|
182
|
-
fill={value}
|
|
183
|
-
onClick={() => inputs.selectColor(value, { onChange: (val) => { if (val) onChange(val); } })}
|
|
184
|
-
/>
|
|
128
|
+
<FillPreview fill={value} onClick={() => inputs.selectColor(value, { onChange: (val) => val && onChange(val) })} />
|
|
185
129
|
</Box>
|
|
186
130
|
</FormField>
|
|
187
131
|
</SidePanel.Field>
|
|
@@ -190,78 +134,21 @@ export const ColorPickerField: FC<ColorPickerFieldProps> = ({
|
|
|
190
134
|
|
|
191
135
|
### FontPickerField
|
|
192
136
|
|
|
193
|
-
Opens the Wix font picker
|
|
137
|
+
Opens the Wix font picker (family, size, bold, italic). Same shape as `ColorPickerField` above, with a `Button`+`Text` trigger instead of `FillPreview`, calling `inputs.selectFont(value, { onChange })` instead of `selectColor`. Value type: `{ font: string; textDecoration: string }`.
|
|
194
138
|
|
|
195
|
-
|
|
196
|
-
import React, { type FC } from 'react';
|
|
197
|
-
import { inputs } from '@wix/editor';
|
|
198
|
-
import { FormField, Button, Text, SidePanel } from '@wix/design-system';
|
|
199
|
-
|
|
200
|
-
interface FontValue {
|
|
201
|
-
font: string;
|
|
202
|
-
textDecoration: string;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
interface FontPickerFieldProps {
|
|
206
|
-
label: string;
|
|
207
|
-
value: FontValue;
|
|
208
|
-
onChange: (value: FontValue) => void;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export const FontPickerField: FC<FontPickerFieldProps> = ({
|
|
212
|
-
label,
|
|
213
|
-
value,
|
|
214
|
-
onChange,
|
|
215
|
-
}) => (
|
|
216
|
-
<SidePanel.Field>
|
|
217
|
-
<FormField label={label}>
|
|
218
|
-
<Button
|
|
219
|
-
size="small"
|
|
220
|
-
priority="secondary"
|
|
221
|
-
onClick={() => inputs.selectFont(value, { onChange: (val) => onChange({ font: val.font, textDecoration: val.textDecoration || "" }) })}
|
|
222
|
-
fullWidth
|
|
223
|
-
>
|
|
224
|
-
<Text size="small" ellipsis>Change Font</Text>
|
|
225
|
-
</Button>
|
|
226
|
-
</FormField>
|
|
227
|
-
</SidePanel.Field>
|
|
228
|
-
);
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**Important:**
|
|
232
|
-
- Always use `inputs.selectColor()` from `@wix/editor` with `FillPreview` — do NOT use `<Input type="color">`
|
|
233
|
-
- Always use `inputs.selectFont()` from `@wix/editor` with the callback pattern `inputs.selectFont(value, { onChange })`
|
|
234
|
-
- Import `inputs` from `@wix/editor` (not from `@wix/sdk`)
|
|
235
|
-
|
|
236
|
-
## Attribute Naming Convention
|
|
237
|
-
|
|
238
|
-
Site plugins use **kebab-case** consistently for HTML attributes:
|
|
239
|
-
|
|
240
|
-
| File | Convention | Example |
|
|
241
|
-
| --------------------------------- | ---------- | ---------------------------------- |
|
|
242
|
-
| `<plugin>.tsx` (getAttribute) | kebab-case | `this.getAttribute('display-name')` |
|
|
243
|
-
| `<plugin>.tsx` (observedAttributes) | kebab-case | `['display-name', 'bg-color']` |
|
|
244
|
-
| `<plugin>.panel.tsx` (widget API) | kebab-case | `widget.getProp('display-name')` |
|
|
139
|
+
**Important:** always go through `inputs` from `@wix/editor` (never `<Input type="color">`, never `@wix/sdk`) with the `{ onChange }` callback pattern shown above.
|
|
245
140
|
|
|
246
141
|
## References
|
|
247
142
|
|
|
248
143
|
| Topic | Reference |
|
|
249
144
|
| --- | --- |
|
|
250
145
|
| Complete Examples | [EXAMPLES.md](site-plugin/EXAMPLES.md) |
|
|
251
|
-
| Slots (App IDs, runtime APIs, design guidelines, multiple placements) | [SLOTS.md](site-plugin/SLOTS.md)
|
|
146
|
+
| Slots (App IDs, runtime APIs, design guidelines, multiple placements) | [SLOTS.md](site-plugin/SLOTS.md) |
|
|
252
147
|
| WDS Components | the `wix-design-system` skill |
|
|
253
148
|
|
|
254
149
|
## Available Slots
|
|
255
150
|
|
|
256
|
-
Site plugins integrate into predefined slots
|
|
257
|
-
|
|
258
|
-
- **appDefinitionId**: The ID of the Wix app (e.g., Stores, Bookings)
|
|
259
|
-
- **widgetId**: The ID of the page containing the slot
|
|
260
|
-
- **slotId**: The specific slot identifier
|
|
261
|
-
|
|
262
|
-
Common placement areas include product pages (Wix Stores), checkout and side cart (Wix eCommerce), booking pages (Wix Bookings), service pages, event pages, and blog post pages.
|
|
263
|
-
|
|
264
|
-
For App Definition IDs, per-slot runtime APIs, design guidelines, and placement constraints, see [SLOTS.md](site-plugin/SLOTS.md). Run `wix schema generate --type SITE_PLUGIN` for the authoritative `slotId` enum.
|
|
151
|
+
Site plugins integrate into predefined slots — product pages (Wix Stores), checkout and side cart (Wix eCommerce), booking pages (Wix Bookings), service pages, event pages, and blog post pages. See [SLOTS.md](site-plugin/SLOTS.md) for the App Definition IDs, per-slot runtime APIs, and design guidelines.
|
|
265
152
|
|
|
266
153
|
## Checkout Plugins
|
|
267
154
|
|
|
@@ -269,52 +156,27 @@ If you are building a plugin for the **checkout page**, it may not support autom
|
|
|
269
156
|
|
|
270
157
|
## Examples
|
|
271
158
|
|
|
272
|
-
For complete examples with all three required files (plugin component, settings panel, extension configuration), see [EXAMPLES.md](site-plugin/EXAMPLES.md).
|
|
273
|
-
|
|
274
|
-
**Example use cases:**
|
|
275
|
-
|
|
276
|
-
- **Best Seller Badge** - Customizable badge on product pages with text and color settings
|
|
277
|
-
- **Booking Confirmation** - Custom confirmation message for booking pages
|
|
278
|
-
- **Product Reviews Summary** - Star rating and review count display
|
|
279
|
-
- **Data-Driven Plugin** - Plugin with Wix Data API integration and editor environment handling
|
|
159
|
+
For complete examples with all three required files (plugin component, settings panel, extension configuration) — including a product-page badge, a booking confirmation message, a review-count display, and a Wix Data-driven plugin — see [EXAMPLES.md](site-plugin/EXAMPLES.md).
|
|
280
160
|
|
|
281
161
|
## Best Practices
|
|
282
162
|
|
|
283
163
|
### Implementation Guidelines
|
|
284
164
|
|
|
285
|
-
- **
|
|
286
|
-
- **
|
|
287
|
-
- **Do not call `define()`** - Wix handles `customElements.define()` for you automatically
|
|
288
|
-
- **Validate all input** - Check required props are present
|
|
289
|
-
- **Follow naming conventions** - kebab-case for all attributes and widget API
|
|
290
|
-
- **Keep plugins focused** - Each plugin should do one thing well
|
|
291
|
-
- **Test in multiple slots** - If supporting multiple placements, test each one
|
|
292
|
-
- **Support both Stores versions** - Include placements for both old and new Wix Stores product pages for maximum compatibility
|
|
165
|
+
- **Handle the editor environment** - show placeholders when in editor mode for data-dependent plugins (see [Editor Sandboxing](#editor-sandboxing) below)
|
|
166
|
+
- **Support both Stores versions** - include placements for both old and new Wix Stores product pages for maximum compatibility
|
|
293
167
|
|
|
294
168
|
### Editor Sandboxing
|
|
295
169
|
|
|
296
|
-
Site plugins are sandboxed when rendered in the editor
|
|
297
|
-
|
|
298
|
-
**Restricted APIs in the editor:**
|
|
299
|
-
- `localStorage` and `sessionStorage` (Web Storage API)
|
|
300
|
-
- `document.cookie` (Cookie Store API)
|
|
301
|
-
- IndexedDB API
|
|
302
|
-
- Cache API
|
|
170
|
+
Site plugins are sandboxed when rendered in the editor — treated as if from a different domain, which blocks `localStorage`/`sessionStorage`, `document.cookie`, IndexedDB, and the Cache API.
|
|
303
171
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
Use the `viewMode()` function from `@wix/site-window` to check the current mode before accessing restricted APIs:
|
|
172
|
+
Check the mode with `viewMode()` from `@wix/site-window` before touching any of those. That package isn't part of the CLI's default scaffolded `package.json` — install it first (`npm install @wix/site-window`), or the build fails with `Rollup failed to resolve import "@wix/site-window"`:
|
|
307
173
|
|
|
308
174
|
```typescript
|
|
309
175
|
import { window as wixWindow } from '@wix/site-window';
|
|
310
176
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (viewMode === 'Site') {
|
|
177
|
+
if ((await wixWindow.viewMode()) === 'Site') {
|
|
314
178
|
const item = localStorage.getItem('myKey');
|
|
315
|
-
} else
|
|
316
|
-
// Mock storage or modify API usage for editor mode
|
|
317
|
-
}
|
|
179
|
+
} // else: mock storage or skip, in editor mode
|
|
318
180
|
```
|
|
319
181
|
|
|
320
182
|
### Using Wix SDK Modules in Site Plugins
|
|
@@ -322,33 +184,23 @@ if (viewMode === 'Site') {
|
|
|
322
184
|
Site plugins can import and use Wix SDK modules directly — you do NOT need `createClient()`. The Wix runtime provides the client context automatically.
|
|
323
185
|
|
|
324
186
|
```typescript
|
|
325
|
-
// ✅ CORRECT —
|
|
187
|
+
// ✅ CORRECT — import directly, no createClient needed
|
|
326
188
|
import { items } from "@wix/data";
|
|
327
|
-
import { currentCartV2 } from "@wix/ecom";
|
|
328
|
-
import { products } from "@wix/stores";
|
|
329
189
|
|
|
330
190
|
class MyPlugin extends HTMLElement {
|
|
331
191
|
async loadData() {
|
|
332
|
-
// Call SDK methods directly — no createClient needed
|
|
333
192
|
const result = await items.query("MyCollection").find();
|
|
334
|
-
const { cart } = await currentCartV2.getCurrentCart();
|
|
335
|
-
const productList = await products.queryProducts().limit(10).find();
|
|
336
193
|
}
|
|
337
194
|
}
|
|
338
195
|
```
|
|
339
196
|
|
|
340
|
-
|
|
341
|
-
// ❌ WRONG — Do NOT use createClient in site plugins
|
|
342
|
-
import { createClient } from "@wix/sdk";
|
|
343
|
-
const wixClient = createClient({ modules: { items, products } });
|
|
344
|
-
await wixClient.items.query(...); // Wrong — API surface differs through client
|
|
345
|
-
```
|
|
197
|
+
The same applies to any other Wix SDK module (`@wix/ecom`, `@wix/stores`, etc. — see the table below for three specific calls). Do **not** wrap them in `createClient({ modules: {...} })` from `@wix/sdk` — that API surface differs from the direct-import one shown above, and site plugins don't need it.
|
|
346
198
|
|
|
347
199
|
### Identity of SDK Calls in Site Plugins
|
|
348
200
|
|
|
349
201
|
A plugin runs as the **site visitor or member**, never as the app — see [Identity and Elevation Requirement](../SKILL.md#identity-and-elevation-requirement) before routing any SDK call out to a backend endpoint.
|
|
350
202
|
|
|
351
|
-
|
|
203
|
+
Each of these three calls is correct to call directly, exactly as written, and each for a different reason:
|
|
352
204
|
|
|
353
205
|
| Call | Why it works directly |
|
|
354
206
|
| --- | --- |
|
|
@@ -356,9 +208,3 @@ The three calls above are correct exactly as written, and each for a different r
|
|
|
356
208
|
| `currentCartV2.getCurrentCart()` | Resolves the cart from the caller's session. Elevating it would return the app's cart, not the visitor's |
|
|
357
209
|
| `products.queryProducts()` | Catalog base fields are public. `MERCHANT_DATA` and non-visible products are withheld unless the app holds `SCOPE.STORES.PRODUCT_READ_ADMIN` — don't request them from a plugin |
|
|
358
210
|
|
|
359
|
-
### Performance Considerations
|
|
360
|
-
|
|
361
|
-
- Keep bundle size small - plugins load on user-facing pages
|
|
362
|
-
- Avoid heavy computations on initial render
|
|
363
|
-
- Lazy load data when possible
|
|
364
|
-
- Use efficient re-rendering patterns
|
|
@@ -25,6 +25,7 @@ export default extensions.appTools({
|
|
|
25
25
|
tools: [
|
|
26
26
|
{
|
|
27
27
|
methodName: 'get-order-status',
|
|
28
|
+
displayName: 'Get Order Status',
|
|
28
29
|
description: 'Returns the current fulfillment status, shipping carrier, and tracking number for a customer order. Use this tool when a collaborator or customer asks where their order is, whether it has shipped, when it will arrive, or needs a tracking number. Requires a valid orderId.',
|
|
29
30
|
requestSchema: {
|
|
30
31
|
type: 'object',
|
|
@@ -52,9 +53,10 @@ export default extensions.appTools({
|
|
|
52
53
|
| --- | --- | --- | --- |
|
|
53
54
|
| `methodName` | `string` | Yes | Unique word identifying the tool. Used to route calls in the service plugin handler. 1–30 characters. |
|
|
54
55
|
| `description` | `string` | Yes | Natural-language description the AI assistant uses to decide when to invoke this tool. Write it like a prompt: state what the tool does, list the user intents or trigger phrases that should activate it, and describe what it returns. A narrow one-liner reduces relevance matching — prefer 2–4 sentences covering intent, triggers, and output. 10–1000 characters. |
|
|
56
|
+
| `displayName` | `string` | No | Human-readable name for the tool, shown in AI agent UIs. 2–50 characters. The CLI's generated stub always fills this in — keep it when you replace the stub tool. |
|
|
55
57
|
| `requestSchema` | `Record<string, any>` | No | JSON Schema describing the tool's request payload. The AI assistant uses this for context — it is NOT validated by Wix at call time. |
|
|
56
58
|
| `responseSchema` | `Record<string, any>` | No | JSON Schema describing the tool's response payload. |
|
|
57
|
-
| `activated` | `boolean` |
|
|
59
|
+
| `activated` | `boolean` | No | Only tools with `activated: true` are called by the AI assistant. **Defaults to `false` if omitted** — there's no build-time or generate-time error for leaving it out, so a forgotten `activated` silently produces a tool the assistant will never call. Always set it explicitly. |
|
|
58
60
|
|
|
59
61
|
## Important Constraints
|
|
60
62
|
|
|
@@ -32,3 +32,24 @@ Wrap each picker in the standard `<SidePanel.Field><FormField label={label}>…<
|
|
|
32
32
|
</Button>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
## Date & Time Fields
|
|
36
|
+
|
|
37
|
+
Use WDS `DatePicker` and `TimeInput` directly (no `@wix/editor` picker dialog involved) — but their `onChange` shapes differ, verified against the installed package's own types:
|
|
38
|
+
|
|
39
|
+
| Field | Value type | `onChange` signature |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `DatePicker` | `Date` | `(date: Date) => void` — receives the date directly |
|
|
42
|
+
| `TimeInput` | `Date \| null` | `({ date }: { date: Date \| null }) => void` — receives a **destructured object**, not the date directly |
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { FormField, DatePicker, TimeInput } from '@wix/design-system';
|
|
46
|
+
|
|
47
|
+
<FormField label="Target date">
|
|
48
|
+
<DatePicker value={targetDate} onChange={(date) => onDateChange(date)} />
|
|
49
|
+
</FormField>
|
|
50
|
+
|
|
51
|
+
<FormField label="Target time">
|
|
52
|
+
<TimeInput value={targetTime} onChange={({ date }) => onTimeChange(date)} />
|
|
53
|
+
</FormField>
|
|
54
|
+
```
|
|
55
|
+
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Finding the real SDK shape behind a dashboard page
|
|
2
|
+
|
|
3
|
+
> **Scope.** [DRAFT_TEMPLATE.md](DRAFT_TEMPLATE.md) gives you the page. This file is the other half:
|
|
4
|
+
> locating the method and the *field names* for the data it lists. Read it before Step 3's MCP
|
|
5
|
+
> discovery — the installed package answers most of it faster and more accurately than a doc search,
|
|
6
|
+
> because it is the version your code will compile against.
|
|
7
|
+
|
|
8
|
+
## Where the types actually live
|
|
9
|
+
|
|
10
|
+
A Wix vertical package such as `@wix/ecom` is a thin re-export barrel. `build/es/index.d.mts` is a
|
|
11
|
+
list of namespaces (`orders`, `orderTransactions`, `currentCart`, …), each re-exported from its own
|
|
12
|
+
generated package:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
node_modules/@wix/ecom/build/es/index.d.mts # namespace list only, ~90 lines
|
|
16
|
+
node_modules/@wix/auto_sdk_ecom_orders/build/es/
|
|
17
|
+
index.d.mts # the callable functions
|
|
18
|
+
index.typings.d.mts # request/response types
|
|
19
|
+
ecom-v1-order-orders.universal-<hash>.d.mts # the domain entities
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Three consequences worth knowing before you start grepping:
|
|
23
|
+
|
|
24
|
+
1. **The directory name is not the namespace name.** Namespaces are camelCase, package directories
|
|
25
|
+
are kebab-case — `extendedBookings` lives in `auto_sdk_bookings_extended-bookings`, not
|
|
26
|
+
`auto_sdk_bookings_extendedBookings`. Don't derive one from the other; list them:
|
|
27
|
+
`ls node_modules/@wix | grep <vertical>`.
|
|
28
|
+
2. **The entity is not always in `index.typings.d.mts`.** `Order`, `Refund`, `Service` live in the
|
|
29
|
+
hashed `*.universal-*.d.mts` when the package has one. The hash changes between versions, so glob
|
|
30
|
+
for it, never hard-code it, and fall back to `index.typings.d.mts` when no universal file exists.
|
|
31
|
+
3. **Never `cat` *or plain-`grep`* the barrel's export block.** These files end with a single
|
|
32
|
+
several-hundred-KB `export { … as a, … as b }` line, so `grep -n "queryServices" index.d.mts`
|
|
33
|
+
prints that whole line. Anchor to the declarations instead —
|
|
34
|
+
`grep -oE "^declare (const|function) [a-zA-Z]+"` — or pipe any barrel grep through `cut -c1-200`.
|
|
35
|
+
|
|
36
|
+
## Confirming a method
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
E=node_modules/@wix/auto_sdk_ecom_order-transactions/build/es
|
|
40
|
+
grep -oE "^declare function [a-zA-Z]+" $E/index.d.mts
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Prefer this to recall: `listTransactionsForMultipleOrders(orderIds: string[])` and
|
|
44
|
+
`listTransactionsForSingleOrder` differ by exactly the shape a collection page needs, and only one
|
|
45
|
+
of them avoids an N+1 across the visible page.
|
|
46
|
+
|
|
47
|
+
## Confirming a field — the part that ships bugs
|
|
48
|
+
|
|
49
|
+
Once you have the entity, read the declaration for **every field you map into a column**, not just
|
|
50
|
+
the uncertain ones. Two failure modes recur:
|
|
51
|
+
|
|
52
|
+
**Deprecated fields still compile.** On `RegularPaymentDetails`, `paymentMethod` carries
|
|
53
|
+
`@deprecated Use paymentMethodName.buyerLanguageName instead` — the deprecated one is a bare code,
|
|
54
|
+
the replacement is the localised name a person expects to read. Grep before you map:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
grep -B4 "paymentMethod?:" $E/index.typings.d.mts # shows the @deprecated banner above it
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
A column bound to a deprecated field renders something plausible and wrong, which is the hardest
|
|
61
|
+
kind of defect to catch in review.
|
|
62
|
+
|
|
63
|
+
**Aggregates hide one level down.** Money on a refund is not on the refund — it is
|
|
64
|
+
`refund.summary.refunded.amount` (`AggregatedRefundSummary`, with `pendingRefund`, `failedRefundAmount`
|
|
65
|
+
and `requestedRefund` beside it), while per-transaction status is
|
|
66
|
+
`refund.transactions[].refundStatus`. Summing the wrong one silently under-reports.
|
|
67
|
+
|
|
68
|
+
**A generic-sounding field is not the related entity.** Treat `.title`, `.name` and `.summary` as
|
|
69
|
+
unverified until you read the declaration: an `Extended*` / `*WithDetails` shape exists precisely to
|
|
70
|
+
attach the real related entity, and a summary field on the base item is not a substitute. A column
|
|
71
|
+
must show what its header promises.
|
|
72
|
+
|
|
73
|
+
**A mapper must cover every shape the response returns.** Responses often carry a oneof — Bookings'
|
|
74
|
+
`bookedEntity` is `slot` for an appointment, `schedule` for a class — and a mapper reading one
|
|
75
|
+
variant renders blank cells for the other while passing `tsc`.
|
|
76
|
+
|
|
77
|
+
## Joining two sources for one row
|
|
78
|
+
|
|
79
|
+
A collection page usually needs one query plus one batch lookup, never a lookup per row:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const { orders: found } = await orders.searchOrders({ filter, sort, cursorPaging: { limit, cursor } });
|
|
83
|
+
const ids = found.map((o) => o._id).filter((id): id is string => Boolean(id));
|
|
84
|
+
const { orderTransactions: txns } = await orderTransactions.listTransactionsForMultipleOrders(ids);
|
|
85
|
+
const byId = new Map(txns.map((t) => [t.orderId, t]));
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Build the `Map` once and index it in the row mapper. Guard the empty case before the second call —
|
|
89
|
+
a batch endpoint given `[]` is a wasted round trip at best.
|
|
90
|
+
|
|
91
|
+
## Filter syntax
|
|
92
|
+
|
|
93
|
+
`searchOrders` takes a `CursorSearch`: `{ cursorPaging, filter, sort }`, where `filter` is a
|
|
94
|
+
Mongo-shaped `Record<string, any>` — `{ paymentStatus: { $in: [...] } }`,
|
|
95
|
+
`{ _createdDate: { $gte, $lte } }`, `{ number: { $startsWith } }`. Enum values come from the
|
|
96
|
+
declaration, not from memory: order payment status is `FULLY_REFUNDED` / `PARTIALLY_REFUNDED` /
|
|
97
|
+
`PAID` / `NOT_PAID` / `PENDING` / `PARTIALLY_PAID` / `PENDING_MERCHANT` / `CANCELED` / `DECLINED` /
|
|
98
|
+
`UNSPECIFIED`.
|
|
99
|
+
|
|
100
|
+
## The SDK is not the REST API
|
|
101
|
+
|
|
102
|
+
Docs search returns REST pages, and a dashboard page calls the **SDK**. Append `?apiView=SDK` to the
|
|
103
|
+
URL of whatever page you landed on and read that view — it answers two of the four differences
|
|
104
|
+
before you write a line.
|
|
105
|
+
|
|
106
|
+
**1 and 2 — namespace and id naming. The SDK view states both.** It prints the package and namespace
|
|
107
|
+
outright (`SDK Package: @wix/members`, `SDK Namespace: customFields`), and uses `_id` in its own
|
|
108
|
+
parameter list. Infer either from the REST page and you get them wrong: REST paths say `services/v2`,
|
|
109
|
+
so `servicesV2` looks right, and the SDK exports `services`; REST responses show `"id"`, and the SDK
|
|
110
|
+
type declares `_id` — same for `_createdDate` / `_updatedDate`. Offline, the barrel is the fallback
|
|
111
|
+
for the namespace list:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
grep -oE "as [a-zA-Z_]+" node_modules/@wix/<pkg>/build/es/index.d.mts | sed 's/as //' | sort -u
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The next two are codegen artifacts that no docs page mentions — read them off the declaration.
|
|
118
|
+
|
|
119
|
+
**3. Don't derive types from `ReturnType`.** Most SDK functions are overloaded — a direct call
|
|
120
|
+
and an `httpClient` form — so `Awaited<ReturnType<typeof ns.method>>['items'][number]` resolves
|
|
121
|
+
against the wrong overload and fails. Import the entity type the package exports instead:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
type Row = <namespace>.<Entity>; // e.g. extendedBookings.ExtendedBooking — not ReturnType<typeof …>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**4. Paging metadata carries no `hasNext`.** `PagingMetadataV2` is `count`, `offset`, `total`,
|
|
128
|
+
`tooManyToCount`, `cursors` — nothing else, in every generated package. Whether another page exists
|
|
129
|
+
is knowable only from `pagingMetadata.cursors.next`. What the collection wants you to *return* is a
|
|
130
|
+
separate question — see [TABLE_STATE.md](TABLE_STATE.md#query-and-result-shapes).
|
|
131
|
+
|
|
132
|
+
## Two things to settle before you write the page
|
|
133
|
+
|
|
134
|
+
**Is the package even installed?** A vertical's SDK is not a default dependency. `@wix/bookings`,
|
|
135
|
+
`@wix/ecom` and the rest have to be present before the import resolves:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
node -e "const p=require('./package.json');console.log(!!({...p.dependencies,...p.devDependencies})['@wix/<pkg>'])"
|
|
139
|
+
npm install @wix/<pkg> # if false
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Does the app hold the scope?** This is the one that produces a page which builds, mounts, renders
|
|
143
|
+
its shell, and shows nothing — the hardest failure to read, because an empty table looks like empty
|
|
144
|
+
data. Reads of a vertical's data need that vertical's permission scope, granted in **Dev Center →
|
|
145
|
+
Permissions**; it cannot be declared in the repo, and the app's install consent screen names what it
|
|
146
|
+
actually has.
|
|
147
|
+
|
|
148
|
+
**Don't guess the scope name — the method's own docs page prints it.** In SDK view every method
|
|
149
|
+
carries `Method Permissions` and `Method Permissions Scopes IDs`, for example
|
|
150
|
+
`Manage Members: SCOPE.DC-MEMBERS.MANAGE-MEMBERS`. Look it up for the exact method you are calling,
|
|
151
|
+
assume it is missing on a fresh app, and report it under
|
|
152
|
+
[Manual Steps Required](../../SKILL.md#-manual-steps-required) by name. Wiring `errorState` on the
|
|
153
|
+
table (the draft template does) is what turns this from silent skeletons into a message you can read.
|
|
154
|
+
|
|
155
|
+
## A second vertical is a second scope
|
|
156
|
+
|
|
157
|
+
The two checks above are easy to run once, at Step 3, for the vertical the page is obviously about —
|
|
158
|
+
and then to skip for the *next* one, because by then you are deep in Step 4b adding a detail column
|
|
159
|
+
or resolving a search term. That second package needs the same two things, and it fails differently:
|
|
160
|
+
the page already worked, so the regression looks like something you broke in the UI.
|
|
161
|
+
|
|
162
|
+
A measured run added `@wix/crm` mid-implementation to resolve a client-name search. The app held
|
|
163
|
+
Bookings scopes and not `SCOPE.DC-CONTACTS.READ-CONTACTS`, the contacts call answered 403, and
|
|
164
|
+
because the search awaited it unconditionally, a page that had been loading fine stopped loading at
|
|
165
|
+
all.
|
|
166
|
+
|
|
167
|
+
**Run the package-and-scope check for every `@wix/*` import you add, whenever you add it** — and
|
|
168
|
+
then decide what its failure should cost:
|
|
169
|
+
|
|
170
|
+
- **Primary source** — the rows themselves. Its failure is the page's failure; `errorState` reports it.
|
|
171
|
+
- **Secondary source** — an enrichment lookup, a filter's option list, a term resolved to ids. Its
|
|
172
|
+
failure must cost only that feature. Wrap the call, fall back to the empty result, and say so in
|
|
173
|
+
the UI (`TableTopNotification` is the patterns component for it) rather than degrading silently.
|
|
174
|
+
|
|
175
|
+
Ask which one you are adding before you write the `await`. An unwrapped secondary call is a page
|
|
176
|
+
whose availability is the *intersection* of every scope it touches.
|
|
177
|
+
|
|
178
|
+
## Querying and paging
|
|
179
|
+
|
|
180
|
+
Filter field paths, WQL's one-operator-per-field rule, and the two cursor-paging traps are in
|
|
181
|
+
[QUERY_AND_PAGING.md](QUERY_AND_PAGING.md). Read it before writing `fetchData` — every rule there
|
|
182
|
+
was a shipped bug first.
|