@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
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// Wix Forms submissions (@wix/forms `submissions`) — build the submission from the visitor's
|
|
2
|
+
// values, upload any attachments, create it, and turn a rejection into per-control messages.
|
|
3
|
+
// Copy as-is; extend by adding functions.
|
|
4
|
+
//
|
|
5
|
+
// ⚠️ The visitor token creates the submission, despite the spec. `CreateSubmission` is listed
|
|
6
|
+
// under the owner scope `SCOPE.DC-FORMS.MANAGE-SUBMISSIONS` and returns 200 on an anonymous
|
|
7
|
+
// visitor: Wix grants implicit visitor access so a published site can submit its own forms.
|
|
8
|
+
// Reaching for a backend here is the most common wrong turn on this vertical.
|
|
9
|
+
//
|
|
10
|
+
// ⚠️ SUBMISSIONS ARE WRITE-ONLY FROM A VISITOR. Reading them back genuinely requires the owner
|
|
11
|
+
// scope and 403s. The resolved create IS the confirmation — show a thank-you; the entry appears
|
|
12
|
+
// in the owner's dashboard. A site that must LIST what visitors submitted needs `cms` instead.
|
|
13
|
+
//
|
|
14
|
+
// docs: https://dev.wix.com/docs/sdk/business-solutions/forms/submissions/create-submission.md
|
|
15
|
+
// docs: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/about-submission-values.md
|
|
16
|
+
import { submissions as submissionsModule } from "@wix/forms";
|
|
17
|
+
import { wixModule } from "../sdk";
|
|
18
|
+
import type { FormFieldDto, FormValues, SubmissionDto } from "./types";
|
|
19
|
+
|
|
20
|
+
const submissions = wixModule(submissionsModule);
|
|
21
|
+
|
|
22
|
+
type Raw = Record<string, any>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Statuses that mean the submission EXISTS — show the thank-you for all three. `CONFIRMED` is
|
|
26
|
+
* recorded, `PENDING` is created but not recorded yet, `PAYMENT_WAITING` is created on a form
|
|
27
|
+
* that also collects payment. Treating one as a failure invites the visitor to submit again,
|
|
28
|
+
* which costs the owner duplicate entries for a submission that already exists.
|
|
29
|
+
*
|
|
30
|
+
* An allowlist rather than a catch-all, so a status added to the enum later cannot silently
|
|
31
|
+
* render a thank-you for something that is not a submission.
|
|
32
|
+
*/
|
|
33
|
+
export const SUBMITTED_OK = new Set(["CONFIRMED", "PENDING", "PAYMENT_WAITING"]);
|
|
34
|
+
|
|
35
|
+
/** Strip visitor-added formatting from a phone number — submit this, not the raw control text. */
|
|
36
|
+
export const normalizePhone = (v: unknown): string => String(v ?? "").replace(/[\s()\-.]/g, "");
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Upload one File and return the value to submit for its field.
|
|
40
|
+
*
|
|
41
|
+
* ⚠️ The submission value IS the generated upload URL — not the CDN URL the upload responds
|
|
42
|
+
* with, and not a file id. Get the URL, PUT the bytes to it, then send that same URL as the
|
|
43
|
+
* field's value.
|
|
44
|
+
*
|
|
45
|
+
* The PUT goes to a pre-signed host with plain `fetch`, never through the SDK: adding the
|
|
46
|
+
* visitor's Authorization header to a pre-signed URL turns a working upload into a 400.
|
|
47
|
+
*/
|
|
48
|
+
export async function uploadFile(formId: string, file: File): Promise<string> {
|
|
49
|
+
// A browser leaves `type` empty for extensions it does not recognize; the generic type keeps
|
|
50
|
+
// the upload-URL call valid (Media Manager rejects a mime type that contradicts the extension).
|
|
51
|
+
const mimeType = file.type || "application/octet-stream";
|
|
52
|
+
const res = (await submissions.getMediaUploadUrl(formId, file.name, mimeType)) as Raw;
|
|
53
|
+
const uploadUrl: string | undefined = res?.uploadUrl ?? res?.url;
|
|
54
|
+
if (!uploadUrl) throw new Error(`forms: no upload URL for "${file.name}".`);
|
|
55
|
+
const put = await fetch(`${uploadUrl}?filename=${encodeURIComponent(file.name)}`, {
|
|
56
|
+
method: "PUT",
|
|
57
|
+
headers: { "Content-Type": mimeType },
|
|
58
|
+
body: file,
|
|
59
|
+
});
|
|
60
|
+
if (!put.ok) {
|
|
61
|
+
// Media Manager's own codes land here: FILE_SIZE_OVER_LIMIT, UNSUPPORTED_FILE_FORMAT,
|
|
62
|
+
// MISMATCH_MIME_TYPE, ZERO_FILE_SIZE, SITE_QUOTA_EXCEEDED.
|
|
63
|
+
throw new Error(`forms: could not upload "${file.name}" (${put.status}). Check its size and type.`);
|
|
64
|
+
}
|
|
65
|
+
return uploadUrl;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Upload every File sitting in the form's values and return a copy with each file field
|
|
70
|
+
* replaced by its uploaded URL(s). Values already holding URLs (a retry after the server
|
|
71
|
+
* rejected some OTHER field) are kept as they are, so a retry never re-uploads.
|
|
72
|
+
*/
|
|
73
|
+
export async function uploadFiles(
|
|
74
|
+
formId: string,
|
|
75
|
+
fields: FormFieldDto[],
|
|
76
|
+
values: FormValues,
|
|
77
|
+
): Promise<FormValues> {
|
|
78
|
+
const next: FormValues = { ...values };
|
|
79
|
+
for (const field of fields) {
|
|
80
|
+
if (field.control !== "file" && field.control !== "signature") continue;
|
|
81
|
+
const picked = ([] as unknown[]).concat(values[field.target] ?? []);
|
|
82
|
+
const done: string[] = [];
|
|
83
|
+
// Sequential on purpose: a visitor's uplink is the bottleneck, and a failed file should
|
|
84
|
+
// stop the submit rather than race more uploads it will throw away.
|
|
85
|
+
for (const item of picked) {
|
|
86
|
+
if (typeof item === "string" && item) done.push(item);
|
|
87
|
+
else if (typeof File !== "undefined" && item instanceof File) done.push(await uploadFile(formId, item));
|
|
88
|
+
}
|
|
89
|
+
next[field.target] = done;
|
|
90
|
+
}
|
|
91
|
+
return next;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Turn the visitor's values into the map `createSubmission` expects, keyed by each field's
|
|
96
|
+
* `target` — the same key the controls are bound to, so the keys come out right by
|
|
97
|
+
* construction with no hand-maintained list to drift.
|
|
98
|
+
*
|
|
99
|
+
* Walks the FIELDS, not the values object: a stray key can never reach the API, and a field
|
|
100
|
+
* the owner just added shows up the moment the schema does.
|
|
101
|
+
*
|
|
102
|
+
* Three value shapes: a flat value (text/choice/date), an ARRAY (multi-choice, several files),
|
|
103
|
+
* an OBJECT (an address, keyed by subfield — the shape behind `address/city` error paths). An
|
|
104
|
+
* empty optional field is OMITTED rather than sent as "": the server validates what it is given.
|
|
105
|
+
*/
|
|
106
|
+
export function toSubmissionValues(fields: FormFieldDto[], values: FormValues): Record<string, unknown> {
|
|
107
|
+
const filled = (v: unknown) => v !== undefined && v !== null && String(v).trim() !== "";
|
|
108
|
+
const out: Record<string, unknown> = {};
|
|
109
|
+
|
|
110
|
+
for (const field of fields) {
|
|
111
|
+
const raw = values?.[field.target];
|
|
112
|
+
|
|
113
|
+
if (field.control === "address") {
|
|
114
|
+
const parts: Record<string, string> = {};
|
|
115
|
+
const held = (raw ?? {}) as Record<string, unknown>;
|
|
116
|
+
for (const { sub } of field.addressParts) {
|
|
117
|
+
if (filled(held[sub])) parts[sub] = String(held[sub]).trim();
|
|
118
|
+
}
|
|
119
|
+
if (Object.keys(parts).length) out[field.target] = parts;
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (field.control === "file" || field.control === "signature") {
|
|
124
|
+
// Whatever `uploadFiles` produced. A stray File that never went through the upload is
|
|
125
|
+
// dropped rather than sent, since it would 400 the whole form.
|
|
126
|
+
const urls = ([] as unknown[]).concat(raw ?? []).filter((v): v is string => typeof v === "string" && !!v);
|
|
127
|
+
if (urls.length) out[field.target] = urls.length === 1 ? urls[0] : urls;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (field.inputType === "ARRAY") {
|
|
132
|
+
const picked = (Array.isArray(raw) ? raw : []).filter(filled);
|
|
133
|
+
if (picked.length) out[field.target] = picked;
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (field.control === "checkbox") {
|
|
138
|
+
// A consent checkbox submits a boolean. Unchecked AND optional is omitted; unchecked and
|
|
139
|
+
// required fails validation before it gets here.
|
|
140
|
+
if (raw === true) out[field.target] = true;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (!filled(raw)) continue;
|
|
145
|
+
const value = typeof raw === "string" ? raw.trim() : raw;
|
|
146
|
+
out[field.target] =
|
|
147
|
+
field.control === "number" || field.control === "rating" ? Number(value) :
|
|
148
|
+
field.control === "phone" ? normalizePhone(value) :
|
|
149
|
+
value;
|
|
150
|
+
}
|
|
151
|
+
return out;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Create the submission. This is the write — and the only confirmation there is.
|
|
156
|
+
*
|
|
157
|
+
* ⚠️ Let a rejection throw. `submissionErrors` below turns it into per-control messages; a
|
|
158
|
+
* `.catch` that swallows it costs the visitor the reason their form would not send.
|
|
159
|
+
*/
|
|
160
|
+
export async function createSubmission(
|
|
161
|
+
formId: string,
|
|
162
|
+
values: Record<string, unknown>,
|
|
163
|
+
): Promise<SubmissionDto> {
|
|
164
|
+
const created = (await submissions.createSubmission({ formId, submissions: values })) as Raw;
|
|
165
|
+
const submission = created?.submission ?? created;
|
|
166
|
+
const id: string | undefined = submission?._id ?? submission?.id;
|
|
167
|
+
if (!id) throw new Error("forms: submission failed (nothing returned).");
|
|
168
|
+
const status: string = submission.status ?? "";
|
|
169
|
+
if (!SUBMITTED_OK.has(status)) {
|
|
170
|
+
throw new Error(
|
|
171
|
+
`forms: submission status is "${status}" — not one of the statuses that mean the submission ` +
|
|
172
|
+
`was created (${[...SUBMITTED_OK].join(", ")}), so do not show a success state.`,
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
return { id, status };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Pull per-field violations out of a failed create, keyed by input NAME so each message lands
|
|
180
|
+
* on its own control. `errorPath` is the field's `target`, or a nested path like
|
|
181
|
+
* `address/subdivision` — exactly how the controls are named, so it maps straight across.
|
|
182
|
+
*
|
|
183
|
+
* The documented entries arrive under `details.validationError.fieldViolations[]`, each with
|
|
184
|
+
* its own nested `data.errors[]` — two levels deeper than the docs' shape. This flattens that.
|
|
185
|
+
*
|
|
186
|
+
* ⚠️ Two rejections here are SEED bugs, not frontend bugs — fix them in `seed/SEED.md`, never
|
|
187
|
+
* by mangling the key or the value:
|
|
188
|
+
* • UNKNOWN_VALUE_ERROR on a key that IS in the schema → the field was seeded with no
|
|
189
|
+
* `validation` block, and that block is what registers the target as an accepted value.
|
|
190
|
+
* • NOT_ALLOWED_VALUE_ERROR on a choice field → the seed's `options[].value` and its
|
|
191
|
+
* validation enum disagree; the two declarations must match.
|
|
192
|
+
*/
|
|
193
|
+
export function submissionErrors(err: unknown, fields: FormFieldDto[]): Record<string, string> {
|
|
194
|
+
const body = (err as Raw)?.details ?? (err as Raw)?.body?.details ?? {};
|
|
195
|
+
const violations: Raw[] = body?.validationError?.fieldViolations ?? [];
|
|
196
|
+
const byTarget = new Map(fields.map((f) => [f.target, f]));
|
|
197
|
+
const out: Record<string, string> = {};
|
|
198
|
+
|
|
199
|
+
for (const entry of violations.flatMap((v) => v.data?.errors ?? [v])) {
|
|
200
|
+
const path: string | undefined = entry?.errorPath;
|
|
201
|
+
if (!path) continue;
|
|
202
|
+
const field = byTarget.get(path.split("/")[0]);
|
|
203
|
+
if (!field) continue;
|
|
204
|
+
// Wix's own errorMessage is the validator's internal wording — debug only.
|
|
205
|
+
console.debug("forms: server violation", path, entry.errorType, entry.errorMessage);
|
|
206
|
+
out[path] = messageFor(entry.errorType, field);
|
|
207
|
+
}
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** errorType → visitor-facing copy, written from the field's own schema. */
|
|
212
|
+
function messageFor(errorType: string, f: FormFieldDto): string {
|
|
213
|
+
const v = f.validation;
|
|
214
|
+
switch (errorType) {
|
|
215
|
+
case "REQUIRED_VALUE_ERROR": return `${f.label} is required.`;
|
|
216
|
+
case "MIN_LENGTH_ERROR": return `${f.label} must be at least ${v.minLength} characters.`;
|
|
217
|
+
case "MAX_LENGTH_ERROR": return `${f.label} must be at most ${v.maxLength} characters.`;
|
|
218
|
+
case "MIN_VALUE_ERROR": return `${f.label} must be ${v.minimum ?? "higher"} or more.`;
|
|
219
|
+
case "MAX_VALUE_ERROR": return `${f.label} must be ${v.maximum ?? "lower"} or less.`;
|
|
220
|
+
case "PATTERN_ERROR": return `${f.label} is not in the expected format.`;
|
|
221
|
+
case "NOT_ALLOWED_VALUE_ERROR": return `Choose one of the listed options for ${f.label}.`;
|
|
222
|
+
case "FORMAT_ERROR":
|
|
223
|
+
return v.format === "EMAIL" ? "Enter a valid email address."
|
|
224
|
+
: v.format === "PHONE" ? "Use international format, starting with +."
|
|
225
|
+
: v.format === "URL" ? "Enter a full URL starting with https://"
|
|
226
|
+
: `Please check ${f.label}.`;
|
|
227
|
+
// The enum grows: MIN/MAX_ITEMS_ERROR and DISABLED_FORM_ERROR are reachable without being
|
|
228
|
+
// listed, so an unmapped type degrades to safe copy rather than showing nothing.
|
|
229
|
+
default: return `Please check ${f.label}.`;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// Forms DTOs — the serializable shapes every hook and page consumes. A form is schema-driven
|
|
2
|
+
// (the owner picks the fields in their dashboard), so a FormDto is a LIST of fields rather
|
|
3
|
+
// than a fixed interface: render by mapping `form.fields`, never by naming fields in code.
|
|
4
|
+
//
|
|
5
|
+
// Why a DTO at all, when the schema IS the model: the raw `Form` nests a field's settings two
|
|
6
|
+
// levels deep under blocks named after its own enums
|
|
7
|
+
// (`inputOptions.stringOptions.dropdownOptions.label`), carries Date objects and Ricos
|
|
8
|
+
// rich-content labels that are not island-serializable, and spreads display ORDER across
|
|
9
|
+
// `steps[].layout` rather than `formFields[]`. FormFieldDto is that resolved once, in the data
|
|
10
|
+
// layer, into flat keys — the same rule every other vertical here follows.
|
|
11
|
+
//
|
|
12
|
+
// It is a FLATTENING, not a subset: every setting a renderer needs is carried through. When a
|
|
13
|
+
// field kind needs something not listed here, add the key — never reach past the DTO into the
|
|
14
|
+
// raw form.
|
|
15
|
+
|
|
16
|
+
/** What the visitor types into. Drives which control your component renders. */
|
|
17
|
+
export type FormControl =
|
|
18
|
+
| "text"
|
|
19
|
+
| "textarea"
|
|
20
|
+
| "number"
|
|
21
|
+
| "rating"
|
|
22
|
+
| "email"
|
|
23
|
+
| "phone"
|
|
24
|
+
| "url"
|
|
25
|
+
| "date"
|
|
26
|
+
| "time"
|
|
27
|
+
| "datetime"
|
|
28
|
+
| "select"
|
|
29
|
+
| "radio"
|
|
30
|
+
| "checkbox"
|
|
31
|
+
| "checkboxGroup"
|
|
32
|
+
| "tags"
|
|
33
|
+
| "address"
|
|
34
|
+
| "file"
|
|
35
|
+
| "signature"
|
|
36
|
+
| "payment"
|
|
37
|
+
/** A bookings slot picker embedded in a form — needs the `bookings` vertical, not an <input>. */
|
|
38
|
+
| "appointment"
|
|
39
|
+
| "unknown";
|
|
40
|
+
|
|
41
|
+
/** One choice in a select / radio / checkbox group. */
|
|
42
|
+
export interface FormChoice {
|
|
43
|
+
value: string;
|
|
44
|
+
/** The owner's wording, falling back to `value` so a choice is never blank. */
|
|
45
|
+
label: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** One subfield of an ADDRESS field — its own control, its own error key (`target/sub`). */
|
|
49
|
+
export interface FormAddressPart {
|
|
50
|
+
/** `addressLine`, `city`, `postalCode`, `country`, … — also the key inside the submitted object. */
|
|
51
|
+
sub: string;
|
|
52
|
+
/** "Postal code" — humanized from `sub`; the schema carries no label for a subfield. */
|
|
53
|
+
label: string;
|
|
54
|
+
required: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The schema's own rules, resolved onto the field. Undefined means the owner set no rule. */
|
|
58
|
+
export interface FormValidation {
|
|
59
|
+
/** EMAIL | PHONE | URL | DATE — drives both the control type and the format check. */
|
|
60
|
+
format?: string;
|
|
61
|
+
minLength?: number;
|
|
62
|
+
maxLength?: number;
|
|
63
|
+
/** A regex SOURCE string, not a RegExp — compile it at the call site. */
|
|
64
|
+
pattern?: string;
|
|
65
|
+
/** NUMBER / rating bounds. */
|
|
66
|
+
minimum?: number;
|
|
67
|
+
maximum?: number;
|
|
68
|
+
/** WIX_FILE: how many files this field accepts. */
|
|
69
|
+
fileLimit?: number;
|
|
70
|
+
/** Multi-choice bounds, when the owner set them. */
|
|
71
|
+
minItems?: number;
|
|
72
|
+
maxItems?: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* One visible input, flattened. `target` is the field's immutable storage key — the input's
|
|
77
|
+
* `name`, the key in `values`, the key in the submission, and the root of the server's error
|
|
78
|
+
* paths. Everything is keyed by it, so nothing has to be matched by label or index.
|
|
79
|
+
*/
|
|
80
|
+
export interface FormFieldDto {
|
|
81
|
+
target: string;
|
|
82
|
+
/** The owner's label. Never empty — falls back to `target`. Always a string (a consent
|
|
83
|
+
* checkbox labels itself with rich content upstream; that is flattened to its plain text). */
|
|
84
|
+
label: string;
|
|
85
|
+
control: FormControl;
|
|
86
|
+
required: boolean;
|
|
87
|
+
placeholder?: string;
|
|
88
|
+
/** Help text shown under the control, when the owner wrote one. */
|
|
89
|
+
description?: string;
|
|
90
|
+
/** The owner's prefill: "" / [] / {} when unset, so the control is controlled from render one. */
|
|
91
|
+
defaultValue: string | number | boolean | string[] | Record<string, string>;
|
|
92
|
+
/** select / radio / checkboxGroup / tags — empty for every other control. */
|
|
93
|
+
choices: FormChoice[];
|
|
94
|
+
/** address only — empty for every other control. */
|
|
95
|
+
addressParts: FormAddressPart[];
|
|
96
|
+
validation: FormValidation;
|
|
97
|
+
/** phone only: the country whose example to show ("US", "GB", …). */
|
|
98
|
+
phoneCountry?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The field's kind as the owner picked it — TEXT_AREA, IMAGE_CHOICE, CONTACTS_EMAIL, … Several
|
|
101
|
+
* kinds share one component (short and long answer are both TEXT_INPUT; image choice and multi
|
|
102
|
+
* choice are both CHECKBOX_GROUP), so this is what separates them when `control` cannot.
|
|
103
|
+
*/
|
|
104
|
+
identifier: string;
|
|
105
|
+
/** The raw `inputType` / `componentType`, for the rare branch the flattening does not cover. */
|
|
106
|
+
inputType: string;
|
|
107
|
+
componentType: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** One form, ready to render. */
|
|
111
|
+
export interface FormDto {
|
|
112
|
+
id: string;
|
|
113
|
+
/** The owner's form name — an internal label, not necessarily page copy. */
|
|
114
|
+
name: string;
|
|
115
|
+
/** Every visible input, in the order the owner laid out (across steps, in step order). */
|
|
116
|
+
fields: FormFieldDto[];
|
|
117
|
+
/** The owner's submit-button wording, or "" when they left the default. */
|
|
118
|
+
submitText: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** `target` → the visitor's current value. Arrays for multi-choice, objects for an address. */
|
|
122
|
+
export type FormValues = Record<string, unknown>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* `target` (or `target/sub`) → a visitor-facing message. The key is the control's `name`, so a
|
|
126
|
+
* message lands on its own control with no mapping table.
|
|
127
|
+
*/
|
|
128
|
+
export type FormErrors = Record<string, string>;
|
|
129
|
+
|
|
130
|
+
/** A created submission. There is nothing to read back — this IS the confirmation. */
|
|
131
|
+
export interface SubmissionDto {
|
|
132
|
+
id: string;
|
|
133
|
+
/** CONFIRMED | PENDING | PAYMENT_WAITING — all three mean the submission exists. */
|
|
134
|
+
status: string;
|
|
135
|
+
}
|