@wix/agent-skills 1.15.0 → 1.16.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/README.md +5 -1
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +4 -1
- package/skills/wix-app/references/APP_TOOLS.md +134 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +1 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +0 -10
- package/skills/wix-app/references/DATA_COLLECTION.md +6 -4
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -7
- package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
- package/skills/wix-app/references/STORES_VERSIONING.md +9 -211
- package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +5 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +2 -2
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +172 -0
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +138 -0
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +172 -0
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +29 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
- package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +57 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +33 -2
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +5 -3
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +18 -1
- package/skills/wix-app/references/editor-react-component/PARTS.md +15 -2
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +4 -3
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +13 -9
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +4 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +3 -1
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +4 -0
- package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +54 -0
- package/skills/wix-app/references/stores/CATEGORIES.md +22 -0
- package/skills/wix-app/references/stores/GET_PRODUCT.md +99 -0
- package/skills/wix-app/references/stores/INVENTORY.md +37 -0
- package/skills/wix-app/references/stores/QUERY.md +119 -0
- package/skills/wix-app/references/stores/WRITE.md +55 -0
- package/skills/wix-docs/SKILL.md +35 -3
- package/skills/wix-headless/SKILL.md +9 -2
- package/skills/wix-headless/entry/bootstrap.mjs +2 -2
- package/skills/wix-headless/entry/skill.md +0 -2
- package/skills/wix-headless/references/CAPABILITIES.md +6 -4
- package/skills/wix-headless/references/CONTENT.md +36 -0
- package/skills/wix-headless/references/DESIGN.md +54 -0
- package/skills/wix-headless/references/DISCOVERY.md +25 -1
- package/skills/wix-headless/references/FEEDBACK.md +16 -5
- package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
- package/skills/wix-headless/references/SDK_HANDOFF.md +2 -0
- package/skills/wix-headless/references/SEED.md +3 -1
- package/skills/wix-headless/references/SETUP.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +42 -2
- package/skills/wix-headless/references/inline-recipes/setup-bookings.md +5 -1
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +1 -1
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +33 -8
- package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +3 -1
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +73 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +38 -2
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +20 -1
- package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +1 -1
- package/skills/wix-headless/references/managed/CONNECT.md +2 -2
- package/skills/wix-headless/references/managed/CREATE.md +15 -1
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +47 -0
- package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +8 -0
- package/skills/wix-headless/references/stripe/DEPLOYMENT.md +8 -0
- package/skills/wix-manage/SKILL.md +131 -12
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
- package/skills/wix-manage/references/analytics/query-site-analytics.md +66 -9
- package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +3 -0
- package/skills/wix-manage/references/blog/blog-dashboard-navigation.md +56 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +31 -6
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -1
- package/skills/wix-manage/references/bookings/bookings-dashboard-navigation.md +63 -0
- package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +6 -5
- package/skills/wix-manage/references/bookings/create-course-service.md +30 -5
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +85 -42
- package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +31 -3
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +287 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +33 -1
- package/skills/wix-manage/references/contacts/contacts-dashboard-navigation.md +46 -0
- package/skills/wix-manage/references/contacts/create-a-contact.md +82 -0
- package/skills/wix-manage/references/contacts/update-a-contact.md +119 -0
- package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +82 -0
- package/skills/wix-manage/references/dashboard-navigation/routes.json +1733 -0
- package/skills/wix-manage/references/domains/domains-dashboard-navigation.md +32 -0
- package/skills/wix-manage/references/ecommerce/ecom-pricing.md +4 -4
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-manage/references/ecommerce/gift-cards/ecom-gift-cards-goal-sell-gift-cards.md +338 -0
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-discount-rule.md +42 -78
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-bundle-and-save.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-stock-mover.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-upsell-boost.md +1 -1
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +90 -92
- package/skills/wix-manage/references/events/create-wix-event.md +176 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +174 -0
- package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/get-paid/get-paid-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +30 -7
- package/skills/wix-manage/references/google-ads/billing-and-payment.md +80 -0
- package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +212 -0
- package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +110 -0
- package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +25 -0
- package/skills/wix-manage/references/google-ads/install-and-create-account.md +155 -0
- package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +63 -0
- package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +155 -0
- package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +225 -144
- package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +19 -10
- package/skills/wix-manage/references/marketing/marketing-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +99 -1
- package/skills/wix-manage/references/pricing-plans/pricing-plans-dashboard-navigation.md +45 -0
- package/skills/wix-manage/references/restaurants/restaurants-dashboard-navigation.md +68 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +94 -125
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +48 -9
- package/skills/wix-manage/references/site-properties/site-properties-dashboard-navigation.md +31 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +52 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +2 -25
- package/skills/wix-manage/references/sites/site-import.md +243 -0
- package/skills/wix-manage/references/sites/sites-dashboard-navigation.md +29 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +17 -1
- package/skills/wix-manage/references/stores/create-product-from-image.md +8 -6
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +16 -10
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +26 -8
- package/skills/wix-manage/references/stores/stores-dashboard-navigation.md +65 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +39 -7
- package/skills/wix-replatform/.publish-manifest.json +8 -0
- package/skills/wix-replatform/SKILL.md +693 -0
- package/skills/wix-replatform/lib/artifact-freshness.js +215 -0
- package/skills/wix-replatform/lib/completion-report.js +200 -0
- package/skills/wix-replatform/lib/config-env.js +59 -0
- package/skills/wix-replatform/lib/execution-manifest.js +185 -0
- package/skills/wix-replatform/lib/execution-state.js +173 -0
- package/skills/wix-replatform/lib/import-recovery.js +313 -0
- package/skills/wix-replatform/lib/local-state.js +642 -0
- package/skills/wix-replatform/lib/orchestration-preflight.js +143 -0
- package/skills/wix-replatform/lib/orchestration-router.js +122 -0
- package/skills/wix-replatform/lib/orchestration-state.js +455 -0
- package/skills/wix-replatform/lib/progress-log.js +224 -0
- package/skills/wix-replatform/lib/progress-log.sh +140 -0
- package/skills/wix-replatform/lib/url-preservation-state.js +391 -0
- package/skills/wix-replatform/resources/rp-discovery/SKILL.md +184 -0
- package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +529 -0
- package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +316 -0
- package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +64 -0
- package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +1114 -0
- package/skills/wix-replatform/resources/rp-mapper/SKILL.md +430 -0
- package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +217 -0
- package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +148 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +378 -0
- package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +183 -0
- package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +478 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +136 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +310 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +1081 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +618 -0
- package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +949 -0
- package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +196 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +66 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +60 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +95 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +82 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +256 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +249 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +444 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +774 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +71 -0
- package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +632 -0
- package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +330 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +39 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +131 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +97 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +528 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +53 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +84 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +25 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +90 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +141 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +384 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +260 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +237 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +2219 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +31 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +100 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +107 -0
- package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +344 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +250 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1927 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +83 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +141 -0
- package/skills/wix-replatform/scripts/artifact-freshness.js +76 -0
- package/skills/wix-replatform/scripts/execution-manifest-validate.js +43 -0
- package/skills/wix-replatform/scripts/execution-state-prepare.js +128 -0
- package/skills/wix-replatform/scripts/orchestration-preflight.js +48 -0
- package/skills/wix-replatform/scripts/orchestration-route.js +46 -0
- package/skills/wix-replatform/scripts/orchestration-state.js +245 -0
- package/skills/wix-vibe-headless/SKILL.md +54 -25
- package/skills/wix-vibe-headless/install/deploy.cjs +95 -0
- package/skills/wix-vibe-headless/install/pin-agents-md.cjs +34 -0
- package/skills/wix-vibe-headless/platforms/README.md +26 -0
- package/skills/wix-vibe-headless/platforms/base44.md +177 -0
- package/skills/wix-vibe-headless/platforms/generic.md +122 -0
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +230 -119
- package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +25 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +35 -0
- package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +38 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +40 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +54 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +65 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +50 -0
- package/skills/wix-vibe-headless/references/blog/seed/SEED.md +103 -0
- package/skills/wix-vibe-headless/references/blog/seed/seed-blog.js +270 -0
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +260 -145
- package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +65 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +47 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +126 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +108 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +58 -0
- package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +95 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +94 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +89 -0
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-checkout.js → app/rest/wix-bookings-checkout.js} +1 -1
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-services.js → app/rest/wix-bookings-services.js} +90 -12
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +117 -0
- package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.js +333 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +169 -147
- package/skills/wix-vibe-headless/references/cms/app/collection.config.js +31 -0
- package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +18 -0
- package/skills/wix-vibe-headless/references/cms/{wix-cms.js → app/rest/wix-cms.js} +47 -2
- package/skills/wix-vibe-headless/references/cms/seed/SEED.md +145 -0
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +228 -131
- package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +23 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +29 -0
- package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +57 -0
- package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +78 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +27 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +54 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +40 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +81 -0
- package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +48 -0
- package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +36 -0
- package/skills/wix-vibe-headless/references/events/{wix-events-browse.js → app/rest/wix-events-browse.js} +3 -2
- package/skills/wix-vibe-headless/references/events/seed/SEED.md +107 -0
- package/skills/wix-vibe-headless/references/events/seed/seed-events.js +251 -0
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +276 -188
- package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +101 -0
- package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +33 -0
- package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +21 -0
- package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +29 -0
- package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +54 -0
- package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +77 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +36 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +32 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +35 -0
- package/skills/wix-vibe-headless/references/members/{wix-members-auth.js → app/rest/wix-members-auth.js} +6 -3
- package/skills/wix-vibe-headless/references/members/install/Register.jsx +22 -0
- package/skills/wix-vibe-headless/references/members/seed/SEED.md +22 -0
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +233 -104
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +31 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +29 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +35 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +25 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +60 -0
- package/skills/wix-vibe-headless/references/portfolio/{wix-portfolio.js → app/rest/wix-portfolio.js} +84 -55
- package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +94 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.js +236 -0
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +240 -117
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +48 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +16 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +25 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +53 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +86 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.js +251 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +248 -124
- package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +81 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +71 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +43 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +21 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +60 -0
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +63 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +32 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +73 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +28 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +102 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +180 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.js +452 -0
- package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +56 -0
- package/skills/wix-vibe-headless/references/shared/{wix-client.js → app/rest/wix-client.js} +6 -8
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +6 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +263 -148
- package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +20 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +150 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +167 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +51 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +54 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +119 -0
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +71 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +109 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +98 -0
- package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +27 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +139 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/Shop.jsx +75 -0
- package/skills/wix-vibe-headless/references/storefront/{wix-store-cart.js → app/rest/wix-store-cart.js} +1 -1
- package/skills/wix-vibe-headless/references/storefront/{wix-store-catalog.js → app/rest/wix-store-catalog.js} +25 -2
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +111 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +299 -0
- /package/skills/wix-vibe-headless/references/blog/{wix-blog.js → app/rest/wix-blog.js} +0 -0
- /package/skills/wix-vibe-headless/references/events/{wix-events-registration.js → app/rest/wix-events-registration.js} +0 -0
- /package/skills/wix-vibe-headless/references/pricing-plans/{wix-pricing-plans.js → app/rest/wix-pricing-plans.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-menu.js → app/rest/wix-restaurants-menu.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-ordering.js → app/rest/wix-restaurants-ordering.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-reservations.js → app/rest/wix-restaurants-reservations.js} +0 -0
|
@@ -1,154 +1,176 @@
|
|
|
1
|
+
# Wix CMS — client utils (you build the UI)
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
Unlike the other verticals, CMS ships **no UI**. A CMS is schema-driven — every collection is
|
|
4
|
+
different — so there are no meaningful "list/detail" components to hand you. You **build the UI
|
|
5
|
+
yourself** (list, detail, home, forms) in your own framework and design tokens, calling the shipped
|
|
6
|
+
**utils**. Everything talks to Wix directly over the public `WIX_CLIENT_ID` (anonymous visitor token)
|
|
7
|
+
using the official Wix Data endpoints — never hand-build a Wix Data URL, never mock items.
|
|
3
8
|
|
|
4
|
-
|
|
9
|
+
## What ships (utils only)
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
tutorials, recipes, team members, listings, FAQs, etc.) on a site.
|
|
14
|
-
- Replacing placeholder/mock content with live Wix Data items.
|
|
15
|
-
- Adding list pages, detail pages, category/tag filtering, or free-text search over an
|
|
16
|
-
existing Wix data collection.
|
|
17
|
-
- Wiring a public form (contact, RSVP, review, signup) that writes a row into a collection.
|
|
11
|
+
| file | what it is |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `rest/wix-cms.js` | Wix Data helpers over the official endpoints: `queryDataItems`, `getDataItem`, `getDataItemBy`, `countDataItems`, `insertDataItem`, `updateDataItem`, `removeDataItem`. |
|
|
14
|
+
| `lib/wixImage.js` | `wixImage(uri)` — converts a `wix:image://…` media field into a renderable URL (passes `https://` / `//` through). |
|
|
15
|
+
| `collection.config.js` | Optional one-file mapping: `COLLECTION_ID` (your collection's **name**, not a GUID) + `FIELDS` (map `title`/`image`/`summary`/`body`/`date`/`slug` to your field keys). Keeps field mapping in one place; skip it and pass field keys inline if you prefer. |
|
|
16
|
+
| `wix-config.js` *(shared)* | Set `WIX_CLIENT_ID` + `WIX_METASITE_ID` here (the one place both ids live). |
|
|
17
|
+
| `WixManageBanner` *(shared)* | Dev-only manage banner — mount it in your Layout (see the platform doc's "Done" step). |
|
|
18
18
|
|
|
19
19
|
## Prerequisites
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
20
|
+
- A Wix **data collection** as the read target, created + seeded separately (see **Seeding**) — it may
|
|
21
|
+
be empty at build time, so render an honest empty state until items land. This skill does **not**
|
|
22
|
+
provision collections.
|
|
23
|
+
- **Collection permissions** must grant the action you perform to the visitor: **read** (Show content
|
|
24
|
+
→ *Everyone*) for listing/detail; **insert** only if you add a public form or member submissions;
|
|
25
|
+
update/delete are author/admin-only and **403 for a visitor**. The owner sets these in the dashboard
|
|
26
|
+
(CMS → collection → Permissions) — a separate Wix step, out of scope. A 403 before it's set is
|
|
27
|
+
expected: flag it and continue.
|
|
28
|
+
|
|
29
|
+
## Build the UI from the utils
|
|
30
|
+
Generate whatever the app needs — a list/grid, a detail page, a home page, a submit form — with your
|
|
31
|
+
framework, your router, and your design tokens. Wire the data with the helpers below (the shapes are
|
|
32
|
+
the bug-prone part). Mount the shared `WixManageBanner` (preview-only) in your Layout. Route conventions
|
|
33
|
+
are yours (e.g. a list path + `/item/:slugOrId` detail).
|
|
34
|
+
|
|
35
|
+
## Data shapes (load-bearing — keep this wiring)
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
import { queryDataItems, getDataItem, getDataItemBy, countDataItems, insertDataItem } from "@/rest/wix-cms";
|
|
39
|
+
import { wixImage } from "@/lib/wixImage";
|
|
40
|
+
|
|
41
|
+
// LIST — queryDataItems resolves to { items, nextCursor } (NOT a bare array). Each item is the flat
|
|
42
|
+
// `data` payload and always carries `_id`. Pass nextCursor back as `cursor` for the next page;
|
|
43
|
+
// set filter/sort on the FIRST request only (cursor follow-ups reuse them — pass only the cursor).
|
|
44
|
+
const { items, nextCursor } = await queryDataItems("Recipes", {
|
|
45
|
+
sort: [{ fieldName: "publishDate", order: "DESC" }], // array of { fieldName, order } — NOT { field: -1 }
|
|
46
|
+
filter: { publishDate: { $lte: { "$date": new Date().toISOString() } } }, // dates wrap as { "$date": ISO }
|
|
47
|
+
limit: 24,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// DETAIL — by `_id` (getDataItem) or a slug field (getDataItemBy); returns null on miss →
|
|
51
|
+
// show a not-found state, never invent an item.
|
|
52
|
+
const one = await getDataItemBy("Recipes", "slug", slugFromUrl);
|
|
53
|
+
|
|
54
|
+
// FILTER/SEARCH — operators: $eq $ne $gt $gte $lt $lte $in $nin $startsWith $exists $hasSome $hasAll,
|
|
55
|
+
// combined with $and/$or/$not. Simple text search: { title: { $startsWith: term } }.
|
|
56
|
+
|
|
57
|
+
// MULTI_REFERENCE fields are NOT inline — pass includeReferences: [{ field: "ingredients", limit: 10 }]
|
|
58
|
+
// to queryDataItems, then read item.<field>.
|
|
59
|
+
|
|
60
|
+
// IMAGES — a media field comes back as a `wix:image://…` URI the browser can't render. Convert every
|
|
61
|
+
// image with wixImage() before <img src>: <img src={wixImage(item.cover)} />. Never render one raw.
|
|
62
|
+
|
|
63
|
+
// DATES — date/datetime fields (and _createdDate/_updatedDate) come back WRAPPED: { "$date": ISO }.
|
|
64
|
+
// Read through the wrapper — handing the object to `new Date()` yields an Invalid Date, which reaches
|
|
65
|
+
// the page as the text "Invalid Date":
|
|
66
|
+
const when = new Date(item.publishDate?.$date ?? item.publishDate);
|
|
67
|
+
// Write one back in the same shape, { "$date": iso }. A FILTER accepts either that or a plain ISO string.
|
|
68
|
+
|
|
69
|
+
// PUBLIC FORM — insertDataItem("Reviews", { name, email, message }); needs Insert = "Anyone" (or members).
|
|
70
|
+
// Resolves to the flat inserted `data` payload (with _id); throws on failure — never fake success.
|
|
71
|
+
|
|
72
|
+
// OWNED RECORDS ("my items") — insert from the CLIENT while the member is logged in, so Wix stamps
|
|
73
|
+
// `_owner` with THEIR id. (An insert carrying a connector/backend token stamps the app instead, and
|
|
74
|
+
// "my items" then reads back empty.)
|
|
75
|
+
const { member } = useMember(); // from the members vertical (@/context/MemberContext)
|
|
76
|
+
await insertDataItem("Drawings", { title }); // member token in play → _owner = that member
|
|
77
|
+
const { items: mine } = await queryDataItems("Drawings", { filter: { _owner: member.id } });
|
|
78
|
+
// The member id lives at `member.id`: row fields carry a leading underscore (_id, _owner, _createdDate)
|
|
79
|
+
// while the member object uses plain `id`. Give the filter a real value — `member._id` evaluates to
|
|
80
|
+
// undefined, JSON.stringify drops it, and the query would match every row (or none), so the helpers
|
|
81
|
+
// throw first. For rows that must stay private, seed `read: SITE_MEMBER_AUTHOR` and skip the filter:
|
|
82
|
+
// the server scopes each read to its caller, and that keeps working when `member` is null (see below).
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Owned records (CMS × Wix members)
|
|
86
|
+
Runnable recipe: see **OWNED RECORDS** in the code block above. Requires the **members** vertical (it
|
|
87
|
+
supplies `useMember()`); the collection needs **Insert** for members. Always insert **client-side while
|
|
88
|
+
the member is logged in** — a backend/connector-token insert stamps `_owner` with the *app*, so "my
|
|
89
|
+
items" comes back empty forever.
|
|
90
|
+
|
|
91
|
+
**Decide which of these you're building — the choice is a collection permission, set at seed time:**
|
|
92
|
+
|
|
93
|
+
| goal | seed the collection with | how you read "mine" |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| public list + a personal *view* of it (e.g. a public gallery plus "my submissions") | `read: ANYONE` | `filter: { _owner: member.id }` — a **view** filter: it selects what to show, while every row stays readable by anyone |
|
|
96
|
+
| rows only their owner may ever see | `read: SITE_MEMBER_AUTHOR` (the **member-private** preset in `seed/SEED.md`) | query with **no filter** — the server scopes every read to the caller |
|
|
97
|
+
|
|
98
|
+
Reach for `SITE_MEMBER_AUTHOR` whenever the data is genuinely per-member: the server enforces it, and it
|
|
99
|
+
holds up when `useMember().member` is `null` — which is the state a logged-in member is in whenever the
|
|
100
|
+
Members Area app is absent (see the members vertical's "Identity vs. profile"), where a client-side id is
|
|
101
|
+
unavailable. For a public list **and** private rows, use **two collections** — permissions are per-collection.
|
|
102
|
+
|
|
103
|
+
## Images in a collection
|
|
104
|
+
Reading one goes through `wixImage()` (see the code block). Writing one has two shapes, because
|
|
105
|
+
**uploading to Wix Media takes a Manage-scope credential**: `generate-file-upload-url` and
|
|
106
|
+
`import-file` each require `SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER`, which a member or visitor token
|
|
107
|
+
never carries — a client-side upload answers **403 with an HTML body**. Pick by how the image is used:
|
|
108
|
+
|
|
109
|
+
| shape | field type | reach for it when |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| **data URL in the item** — `canvas.toDataURL()`, or any base64 string, written straight into the row | `TEXT` | small images: canvases, signatures, thumbnails, prototypes. An item caps at **500 KB** and base64 adds about a third, so keep the source under ~350 KB. Wix's own visitor-upload tutorial takes this route. |
|
|
112
|
+
| **real Wix Media asset** — a backend route uploads with an elevated credential and returns the CDN URL for the client to store | `IMAGE` | production images: CDN delivery, `wixImage()` transforms, reuse across the site, anything past that size cap |
|
|
113
|
+
|
|
114
|
+
**On base44 the elevated route is a backend function** — it holds the credential the client lacks:
|
|
115
|
+
```js
|
|
116
|
+
const { accessToken } = await base44.asServiceRole.connectors.getConnection("wix"); // admin-level
|
|
117
|
+
// → POST /site-media/v1/files/generate-upload-url, PUT the bytes to it, return the file URL
|
|
118
|
+
```
|
|
119
|
+
That's the same Wix connector the seed step uses, and it's the supported way to reach a Manage-scope
|
|
120
|
+
API at runtime — a different thing from the Base44 solution kits the build rules exclude. Keep the
|
|
121
|
+
asset on Wix: `base44.integrations.Core.UploadFile` parks the file on Base44 instead, which splits the
|
|
122
|
+
source of truth away from the site.
|
|
123
|
+
|
|
124
|
+
**Authorize that function against the Wix member**, using the member token the client sends.
|
|
125
|
+
`base44.auth.me()` resolves the *Base44* account — you, the builder — so a function gated on it turns
|
|
126
|
+
real visitors away, while a `test_backend_function` run passes on your own token and reads as working.
|
|
127
|
+
Validate the mime type and the size there as well.
|
|
128
|
+
|
|
129
|
+
- Tutorial, data URL + elevated route: https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/feature-guides/upload-images-to-cms.md
|
|
130
|
+
- Generate File Upload Url: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/generate-file-upload-url.md
|
|
131
|
+
- Import File: https://dev.wix.com/docs/api-reference/assets/media/media-manager/files/import-file.md
|
|
132
|
+
|
|
133
|
+
## Hard rules
|
|
134
|
+
- Set `WIX_CLIENT_ID` (in `wix-config`) — not the placeholder.
|
|
135
|
+
- Read/write **only** through the `wix-cms.js` helpers (official Wix Data endpoints) — never hand-build a URL.
|
|
136
|
+
- `queryDataItems` → `{ items, nextCursor }` (destructure, iterate `.items`); `sort` is `[{ fieldName, order }]`; date comparands wrap as `{ "$date": ISO }`.
|
|
137
|
+
- Read date fields through the wrapper — `new Date(v?.$date ?? v)`. Dates arrive as `{ "$date": ISO }` (including `_createdDate` / `_updatedDate`), and `new Date(object)` puts the text "Invalid Date" on the page. See RETRIEVAL SHAPES in `rest/wix-cms.js` for the field types that need a converter.
|
|
138
|
+
- Convert `wix:image://` URIs via `wixImage()` before `<img src>`.
|
|
139
|
+
- Upload images from a backend route holding an elevated credential, and keep a member-submitted image under the 500 KB item cap when storing it as a data URL — a client-side Wix Media upload answers 403 (see **Images in a collection**).
|
|
140
|
+
- Owner field is `_owner` (Wix Data v2), not `_ownerId`; the member id lives at `member.id`, so "my items" → `{ filter: { _owner: member.id } }` (see above).
|
|
141
|
+
- **Give every filter key a defined value** — add the key only once you hold one: `...(memberId ? { _owner: memberId } : {})`. `JSON.stringify` drops `undefined`, so an undefined comparand would match every row (`{ _owner: undefined }`) or none (`{ _owner: { $eq: undefined } }`) with no error from the server; the helpers throw so it surfaces at the call site.
|
|
142
|
+
- **Let the query do the scoping** (a `filter`, or `read: SITE_MEMBER_AUTHOR` for privacy) so the server returns exactly the rows to show. A wrong result means the filter or the permission needs fixing — a client-side `.filter()` over rows the browser already holds only hides the symptom.
|
|
143
|
+
- `updateDataItem` **replaces** the whole item — fetch + merge first (or use Patch Data Item).
|
|
144
|
+
- Render live Wix data or an honest empty state — never mock items or invent fields not in the collection.
|
|
145
|
+
- Treat a 403 as a permissions setup step (tell the user which permission to grant), not a code bug.
|
|
146
|
+
|
|
147
|
+
## Fallback — beyond the helpers
|
|
148
|
+
Need something the helpers don't cover? Call it yourself with `wixApiRequest`, but look up the exact
|
|
149
|
+
endpoint/method/body in the official Wix reference first (or use the `wix-docs` skill) — never guess.
|
|
150
|
+
- Data Items API: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items.md
|
|
151
|
+
- Partial update (Patch): https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/patch-data-item.md
|
|
152
|
+
- Upsert by id (Save): https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/save-data-item.md
|
|
153
|
+
- Free-text search: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/search-data-items.md
|
|
154
|
+
- Aggregations: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/aggregate-data-items.md
|
|
155
|
+
- Distinct values (filter menus): https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-distinct-values.md
|
|
156
|
+
- Referenced items: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-referenced-data-items.md
|
|
157
|
+
- Collection schema / field keys: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/get-data-collection.md
|
|
158
|
+
- Member-gated / user-generated content → the **members** vertical (`references/members/INSTRUCTIONS.md`).
|
|
159
|
+
|
|
160
|
+
## Seeding
|
|
161
|
+
Seed the collection per `seed/SEED.md` — the Wix Data v2 REST API with curl examples (create collection
|
|
162
|
+
+ permissions, bulk-insert, verify, references, images). Needs an elevated credential; separate from
|
|
163
|
+
this build, run in parallel.
|
|
134
164
|
|
|
135
165
|
## Point the user to their dashboard
|
|
136
|
-
|
|
137
|
-
- **Collections & items** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-cms`
|
|
138
|
-
- **Permissions** —
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- [ ]
|
|
144
|
-
- [ ]
|
|
145
|
-
- [ ]
|
|
146
|
-
- [ ]
|
|
147
|
-
not-found state on miss — no invented item
|
|
148
|
-
- [ ] Filter/sort produce the expected subset (operators match the field types)
|
|
149
|
-
- [ ] Public form `insertDataItem` succeeds only when Insert is "Anyone"; on a 403 the user
|
|
150
|
-
is told to grant the permission — no fake success
|
|
151
|
-
- [ ] Update is treated as a full replace (fetch + merge), so no fields are silently dropped
|
|
152
|
-
- [ ] Empty state shown when `countDataItems` is 0
|
|
153
|
-
- [ ] No mock data anywhere; no hand-built Wix Data URLs
|
|
154
|
-
- [ ] Told the user at least once that they can continue setting up their content in the dashboard and provided deep links.
|
|
166
|
+
Substitute the site's `metaSiteId`:
|
|
167
|
+
- **Collections & items** — `https://manage.wix.com/dashboard/{metaSiteId}/wix-cms` → Create Collection, then add items.
|
|
168
|
+
- **Permissions** — same CMS area → open the collection → More Actions → Permissions & Privacy. Read anonymously → **Show content: Everyone**; public/member form → **Collect content: Everyone/Members**. Update/Delete stay admin-only.
|
|
169
|
+
|
|
170
|
+
## Verify
|
|
171
|
+
- [ ] `WIX_CLIENT_ID` set (not the placeholder); collection name + field keys correct (from the seed plan).
|
|
172
|
+
- [ ] List renders live items (`{ items, nextCursor }` destructured); pagination works; empty collection → honest empty state (no mock items).
|
|
173
|
+
- [ ] Detail resolves by slug or `_id`, with a not-found state on miss.
|
|
174
|
+
- [ ] Image fields render via `wixImage()` (no raw `wix:image://`).
|
|
175
|
+
- [ ] Any 403 surfaced to the user as a permissions step, with the dashboard deep links.
|
|
176
|
+
- [ ] Built "my items"? Signed in as **two different members** and confirmed each one sees their own rows and only those. Use two accounts: an owner filter can fail silently in either direction — every row, or zero rows — and both look plausible from a single account.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// collection.config.js — THE data surface. This is where you point the shipped list + detail at
|
|
2
|
+
// YOUR Wix CMS collection and map its field keys to the roles the UI renders. Edit this file; do
|
|
3
|
+
// NOT edit the components. It is the data-side equivalent of the design tokens in `index.css`: one
|
|
4
|
+
// place, and the whole client follows.
|
|
5
|
+
//
|
|
6
|
+
// The item shape is USER-DEFINED — the field keys below are the ones from your own seed / design
|
|
7
|
+
// plan for this collection. Carry that plan forward as the canonical list; don't guess keys or
|
|
8
|
+
// reverse-engineer them from a single fetched row.
|
|
9
|
+
|
|
10
|
+
// The collection NAME from your Wix dashboard (CMS → Content Manager), e.g. "Recipes", "Posts".
|
|
11
|
+
// NOT a GUID — the name is the id in Wix Data.
|
|
12
|
+
export const COLLECTION_ID = "<YOUR-COLLECTION>";
|
|
13
|
+
|
|
14
|
+
// Map your collection's field keys → the roles the shipped UI renders. Any role you set to null is
|
|
15
|
+
// skipped (the UI just omits it). `title` is the only required role.
|
|
16
|
+
export const FIELDS = {
|
|
17
|
+
title: "title", // required — card heading + detail heading
|
|
18
|
+
image: "image", // media field (wix:image:// or https URL) — null if the collection has none
|
|
19
|
+
summary: "description", // short text shown on the card
|
|
20
|
+
body: "content", // long HTML body shown on the detail page (rendered as HTML)
|
|
21
|
+
date: "publishDate", // ISO date field shown as meta + used for the default sort
|
|
22
|
+
slug: "slug", // human-readable field for detail URLs; null → routes fall back to _id
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Default list sort — an array of { fieldName, order: "ASC"|"DESC" } (Wix syntax, NOT Mongo
|
|
26
|
+
// { field: -1 }). null → collection/insertion order. Uses FIELDS.date when set.
|
|
27
|
+
export const SORT = FIELDS.date ? [{ fieldName: FIELDS.date, order: "DESC" }] : null;
|
|
28
|
+
|
|
29
|
+
// Route key for an item: the slug value when a slug field is mapped, else the item's `_id`.
|
|
30
|
+
// Both the card link and the detail route read this — one definition, so they can't drift.
|
|
31
|
+
export const itemKey = (item) => (FIELDS.slug && item?.[FIELDS.slug]) || item?._id;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// wixImage — turn a Wix CMS image field value into a URL a browser can render.
|
|
2
|
+
// CMS media fields come back in two shapes and only ONE renders directly in <img src>:
|
|
3
|
+
// • a plain `https://static.wixstatic.com/...` (or protocol-relative `//...`) URL → usable as-is
|
|
4
|
+
// • a Wix media URI `wix:image://v1/<mediaId>/<filename>#originWidth=…&originHeight=…` → NOT
|
|
5
|
+
// renderable by the browser; the `<mediaId>` segment maps to a static.wixstatic.com/media/ URL.
|
|
6
|
+
// Merchant-uploaded images (via the dashboard) are the `wix:image://` form; images your seed step
|
|
7
|
+
// wrote are usually already `https://`. This converts both so the shipped UI never shows a broken
|
|
8
|
+
// image. Returns null for an empty/unknown value (the UI shows a token surface instead).
|
|
9
|
+
export function wixImage(value) {
|
|
10
|
+
if (!value || typeof value !== "string") return null;
|
|
11
|
+
if (value.startsWith("//")) return `https:${value}`;
|
|
12
|
+
if (value.startsWith("http")) return value;
|
|
13
|
+
if (value.startsWith("wix:image://")) {
|
|
14
|
+
const mediaId = value.slice("wix:image://v1/".length).split("/")[0];
|
|
15
|
+
return mediaId ? `https://static.wixstatic.com/media/${mediaId}` : null;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
@@ -12,10 +12,21 @@ import { wixApiRequest } from "./wix-client.js";
|
|
|
12
12
|
*
|
|
13
13
|
* Data Item — every read helper returns the item's `data` payload:
|
|
14
14
|
* _id {string} — GUID (route key, itemId for get/update/remove),
|
|
15
|
-
* _createdDate, _updatedDate
|
|
16
|
-
*
|
|
15
|
+
* _createdDate, _updatedDate — dates, wrapped (see RETRIEVAL SHAPES below),
|
|
16
|
+
* _owner {string} — id of the member who created the row,
|
|
17
|
+
* ...fields — collection field values keyed by field key
|
|
17
18
|
* Full reference: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/data-item-object.md
|
|
18
19
|
*
|
|
20
|
+
* RETRIEVAL SHAPES — three field types arrive in a form the UI reads through a converter. Convert on
|
|
21
|
+
* read; the rest (text, number, boolean, url) come back as plain values:
|
|
22
|
+
* date / datetime → { "$date": "2026-05-05T00:00:00.000Z" }. Read it as
|
|
23
|
+
* `new Date(v?.$date ?? v)` — handing the object itself to `new Date()` produces
|
|
24
|
+
* an Invalid Date, which reaches the page as the text "Invalid Date". Applies to
|
|
25
|
+
* your own date fields AND to _createdDate / _updatedDate. Send it back the same
|
|
26
|
+
* way, `{ "$date": iso }`; a query FILTER accepts either that or a plain ISO string.
|
|
27
|
+
* image (media) → `wix:image://v1/...`. Convert with `wixImage()` from `@/lib/wixImage`.
|
|
28
|
+
* MULTI_REFERENCE → present once you pass `includeReferences` to queryDataItems; read `item.<field>`.
|
|
29
|
+
*
|
|
19
30
|
* FILTERS & SORT (Wix API Query Language):
|
|
20
31
|
* filter: { field: value } for equality; { field: { $op: value } } for operators:
|
|
21
32
|
* $eq $ne $gt $gte $lt $lte $in $nin $startsWith $exists $isEmpty $hasSome $hasAll
|
|
@@ -24,6 +35,38 @@ import { wixApiRequest } from "./wix-client.js";
|
|
|
24
35
|
* Full reference: https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md
|
|
25
36
|
*/
|
|
26
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Guard: reject `undefined` values inside a filter.
|
|
40
|
+
*
|
|
41
|
+
* `JSON.stringify` DELETES undefined values, so a missing or mistyped variable doesn't error —
|
|
42
|
+
* it silently changes what the query matches, and the server can't flag it either because the
|
|
43
|
+
* key never arrives:
|
|
44
|
+
* { _owner: undefined } → {} → matches EVERY item
|
|
45
|
+
* { _owner: { $eq: undefined } } → { "_owner": {} } → matches NO item
|
|
46
|
+
* The bad value is still visible here, before serialization, so fail loudly instead.
|
|
47
|
+
*
|
|
48
|
+
* The classic slip: every CMS data-item field is underscore-prefixed (`_id`, `_owner`,
|
|
49
|
+
* `_createdDate`), but a Wix MEMBER (a different API) exposes `member.id` — so `member._id`
|
|
50
|
+
* reads naturally, is `undefined`, and turns "my items" into "everyone's items".
|
|
51
|
+
*/
|
|
52
|
+
function assertDefinedFilterValues(filter, path = "filter") {
|
|
53
|
+
if (!filter || typeof filter !== "object") return;
|
|
54
|
+
for (const [key, value] of Object.entries(filter)) {
|
|
55
|
+
const at = Array.isArray(filter) ? `${path}[${key}]` : `${path}.${key}`;
|
|
56
|
+
if (value === undefined) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
`wix-cms: ${at} is undefined. JSON.stringify drops undefined, so this query would ` +
|
|
59
|
+
`silently match every item (or none) instead of filtering. Pass a real value, or omit ` +
|
|
60
|
+
`the key entirely — e.g. \`...(memberId ? { _owner: memberId } : {})\`. ` +
|
|
61
|
+
`Note: Wix members expose \`member.id\`, not \`member._id\`.`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (value && typeof value === "object" && !(value instanceof Date)) {
|
|
65
|
+
assertDefinedFilterValues(value, at);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
27
70
|
/**
|
|
28
71
|
* Query one page of items from a collection.
|
|
29
72
|
* Reference: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/query-data-items.md
|
|
@@ -44,6 +87,7 @@ import { wixApiRequest } from "./wix-client.js";
|
|
|
44
87
|
* @returns {Promise<{ items: object[], nextCursor: string|null }>} items are `data` payloads (each includes `_id`).
|
|
45
88
|
*/
|
|
46
89
|
export async function queryDataItems(dataCollectionId, { filter, sort, limit = 100, cursor, fields, includeReferences } = {}) {
|
|
90
|
+
assertDefinedFilterValues(filter);
|
|
47
91
|
const query = {
|
|
48
92
|
...(cursor
|
|
49
93
|
? {}
|
|
@@ -115,6 +159,7 @@ export async function getDataItemBy(dataCollectionId, fieldKey, value) {
|
|
|
115
159
|
* @returns {Promise<number>}
|
|
116
160
|
*/
|
|
117
161
|
export async function countDataItems(dataCollectionId, filter) {
|
|
162
|
+
assertDefinedFilterValues(filter);
|
|
118
163
|
const res = await wixApiRequest("/wix-data/v2/items/count", {
|
|
119
164
|
method: "POST",
|
|
120
165
|
body: { dataCollectionId, ...(filter ? { filter } : {}) },
|