@wix/agent-skills 1.0.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/LICENSE +21 -0
- package/README.md +111 -0
- package/package.json +29 -0
- package/skills/wix-app/SKILL.md +344 -0
- package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
- package/skills/wix-app/references/APP_VALIDATION.md +171 -0
- package/skills/wix-app/references/BACKEND_API.md +233 -0
- package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
- package/skills/wix-app/references/CODE_QUALITY.md +33 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
- package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
- package/skills/wix-app/references/DOCUMENTATION.md +42 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
- package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
- package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
- package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
- package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
- package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
- package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
- package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
- package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
- package/skills/wix-design-system/SKILL.md +129 -0
- package/skills/wix-design-system/references/file-structure.md +56 -0
- package/skills/wix-design-system/scripts/wds.cjs +531 -0
- package/skills/wix-headless/SKILL.md +418 -0
- package/skills/wix-headless/references/DISCOVERY.md +332 -0
- package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
- package/skills/wix-headless/references/SETUP.md +154 -0
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
- package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
- package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
- package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
- package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
- package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
- package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
- package/skills/wix-headless/references/commands/install-app.md +42 -0
- package/skills/wix-headless/references/commands/known-apps.json +5 -0
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
- package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
- package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
- package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
- package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
- package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
- package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
- package/skills/wix-headless/references/shared/STYLING.md +117 -0
- package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
- package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
- package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
- package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
- package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
- package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
- package/skills/wix-headless/references/verticals/_schema.json +160 -0
- package/skills/wix-headless/references/verticals/_schema.md +185 -0
- package/skills/wix-headless/references/verticals/blog.md +125 -0
- package/skills/wix-headless/references/verticals/cms.md +121 -0
- package/skills/wix-headless/references/verticals/ecom.md +96 -0
- package/skills/wix-headless/references/verticals/forms.md +106 -0
- package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
- package/skills/wix-headless/references/verticals/stores.md +167 -0
- package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
- package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
- package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
- package/skills/wix-headless/scripts/preview.sh +45 -0
- package/skills/wix-headless/scripts/release.sh +73 -0
- package/skills/wix-headless/scripts/scaffold.sh +53 -0
- package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
- package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
- package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
- package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
- package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
- package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
- package/skills/wix-headless/templates/ecom/cart.astro +13 -0
- package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
- package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
- package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
- package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
- package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
- package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
- package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
- package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
- package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
- package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
- package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
- package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
- package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
- package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
- package/skills/wix-headless/templates/stores/categories.ts +155 -0
- package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
- package/skills/wix-headless/templates/stores/components-stores.css +295 -0
- package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
- package/skills/wix-headless/templates/stores/products/index.astro +101 -0
- package/skills/wix-manage/SKILL.md +280 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
- package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
- package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
- package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
- package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
- package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
- package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
- package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
- package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
- package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
- package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
- package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
- package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
- package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
- package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
- package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
- package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
- package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
- package/skills/wix-manage/references/events/list-events.md +203 -0
- package/skills/wix-manage/references/forms/create-form.md +260 -0
- package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
- package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
- package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
- package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
- package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
- package/skills/wix-manage/references/sites/query-sites.md +125 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
- package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
- package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
|
|
2
|
+
# Wix Dashboard Menu Plugin Builder
|
|
3
|
+
|
|
4
|
+
Creates dashboard menu plugin extensions for Wix CLI applications. Dashboard menu plugins are menu items that integrate into predefined **menu slots** on dashboard pages managed by Wix first-party business apps (Wix Stores, Wix Bookings, Wix Blog, Wix eCommerce, Wix Events, Wix CRM, Wix Restaurants).
|
|
5
|
+
|
|
6
|
+
When clicked, a dashboard menu plugin either **navigates to a dashboard page** or **opens a dashboard modal**.
|
|
7
|
+
|
|
8
|
+
Dashboard menu plugins are configuration-only extensions — they do NOT have a React component file.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Quick Start Checklist
|
|
12
|
+
|
|
13
|
+
Follow these steps in order when creating a dashboard menu plugin:
|
|
14
|
+
|
|
15
|
+
1. [ ] Identify the target menu slot ID — see [Slot Lookup Table](#slot-lookup-table) below, then read only the relevant vertical file
|
|
16
|
+
2. [ ] Create plugin folder: `src/extensions/dashboard/menu-plugins/<plugin-name>/`
|
|
17
|
+
3. [ ] Create `<plugin-name>.extension.ts` with `extensions.dashboardMenuPlugin()` and unique UUID
|
|
18
|
+
4. [ ] Configure the `action` field to either navigate to a dashboard page or open a modal
|
|
19
|
+
5. [ ] Update `src/extensions.ts` to import and use the new extension
|
|
20
|
+
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
Dashboard menu plugins operate as **click-to-action** menu items. They:
|
|
24
|
+
|
|
25
|
+
1. Appear as labeled items with an icon in a menu slot on a Wix app's dashboard page
|
|
26
|
+
2. When clicked, perform one of two actions:
|
|
27
|
+
- **Navigate to a dashboard page** — redirects to a specified dashboard page
|
|
28
|
+
- **Open a dashboard modal** — displays a specified dashboard modal
|
|
29
|
+
|
|
30
|
+
## Files and Code Structure
|
|
31
|
+
|
|
32
|
+
Dashboard menu plugins live under `src/extensions/dashboard/menu-plugins/`. Each plugin has its own folder containing a single file.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
src/extensions/dashboard/menu-plugins/
|
|
36
|
+
└── <plugin-name>/
|
|
37
|
+
└── <plugin-name>.extension.ts # Builder configuration
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **Note:** This is the default folder structure created by the CLI. You can move the file to any location within the `src/` folder and update the references in your `extension.ts` file.
|
|
41
|
+
|
|
42
|
+
## Plugin Builder Configuration
|
|
43
|
+
|
|
44
|
+
### File: `<plugin-name>.extension.ts`
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { extensions } from "@wix/astro/builders";
|
|
48
|
+
|
|
49
|
+
export const dashboardmenupluginMyMenuPlugin = extensions.dashboardMenuPlugin({
|
|
50
|
+
id: "{{GENERATE_UUID}}",
|
|
51
|
+
title: "My Menu Plugin",
|
|
52
|
+
extends: "<MENU_SLOT_ID>",
|
|
53
|
+
iconKey: "Sparkles",
|
|
54
|
+
action: {
|
|
55
|
+
navigateToPage: {
|
|
56
|
+
pageId: "<DASHBOARD_PAGE_ID>",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**CRITICAL: UUID Generation**
|
|
63
|
+
|
|
64
|
+
The `id` must be a unique, static UUID v4 string. Generate a fresh UUID for each extension — do NOT use `randomUUID()` or copy UUIDs from examples. Replace `{{GENERATE_UUID}}` with a freshly generated UUID like `"a1b2c3d4-e5f6-7890-abcd-ef1234567890"`.
|
|
65
|
+
|
|
66
|
+
### Builder Fields
|
|
67
|
+
|
|
68
|
+
| Field | Type | Description |
|
|
69
|
+
|-------|------|-------------|
|
|
70
|
+
| `id` | string | Unique plugin ID (GUID). Must be unique across all extensions in the project. |
|
|
71
|
+
| `title` | string | Text displayed for the menu item. |
|
|
72
|
+
| `extends` | string | Menu slot ID where the extension integrates. See [Slot Lookup Table](#slot-lookup-table). |
|
|
73
|
+
| `iconKey` | string | Icon name from Wix Design System appearing next to the title. |
|
|
74
|
+
| `action` | object | Navigation configuration determining behavior when clicked. |
|
|
75
|
+
|
|
76
|
+
### The `extends` Field
|
|
77
|
+
|
|
78
|
+
The `extends` field specifies which dashboard menu slot hosts your menu plugin. Each Wix business app exposes menu slots on its dashboard pages. You must provide the exact slot ID.
|
|
79
|
+
|
|
80
|
+
**Important:** Some slots with the same ID appear on different pages within the dashboard. If you create a menu plugin for a slot that exists on multiple pages, the menu plugin is displayed on all of those pages.
|
|
81
|
+
|
|
82
|
+
For the complete list of available menu slot IDs, see the [Slot Lookup Table](#slot-lookup-table) below. Read only the vertical file that matches the user's request.
|
|
83
|
+
|
|
84
|
+
### The `action` Field
|
|
85
|
+
|
|
86
|
+
The `action` field determines what happens when the user clicks the menu item. You must configure exactly one of the following:
|
|
87
|
+
|
|
88
|
+
#### Option 1: Navigate to a Dashboard Page
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
action: {
|
|
92
|
+
navigateToPage: {
|
|
93
|
+
pageId: "<DASHBOARD_PAGE_ID>",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
| Field | Type | Description |
|
|
99
|
+
|-------|------|-------------|
|
|
100
|
+
| `action.navigateToPage` | object | Page navigation configuration object. |
|
|
101
|
+
| `action.navigateToPage.pageId` | string | The `id` of the target dashboard page extension. |
|
|
102
|
+
|
|
103
|
+
#### Option 2: Open a Dashboard Modal
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
action: {
|
|
107
|
+
openModal: {
|
|
108
|
+
componentId: "<DASHBOARD_MODAL_ID>",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
| Field | Type | Description |
|
|
114
|
+
|-------|------|-------------|
|
|
115
|
+
| `action.openModal` | object | Modal navigation configuration object. |
|
|
116
|
+
| `action.openModal.componentId` | string | The `id` of the target dashboard modal extension. |
|
|
117
|
+
|
|
118
|
+
### The `iconKey` Field
|
|
119
|
+
|
|
120
|
+
The `iconKey` must be a valid icon name from the Wix Design System icon set (`@wix/wix-ui-icons-common`). Use the `wix-design-system` skill to look up available icon names.
|
|
121
|
+
|
|
122
|
+
## Extension Registration
|
|
123
|
+
|
|
124
|
+
**Extension registration is MANDATORY and has TWO required steps.**
|
|
125
|
+
|
|
126
|
+
### Step 1: Create Plugin-Specific Extension File
|
|
127
|
+
|
|
128
|
+
Each dashboard menu plugin requires a `<plugin-name>.extension.ts` file in its folder. See [Plugin Builder Configuration](#plugin-builder-configuration) above.
|
|
129
|
+
|
|
130
|
+
### Step 2: Register in Main Extensions File
|
|
131
|
+
|
|
132
|
+
**CRITICAL:** After creating the plugin-specific extension file, you MUST read [Extension Registration reference](EXTENSION_REGISTRATION.md) and follow the "App Registration" section to update `src/extensions.ts`.
|
|
133
|
+
|
|
134
|
+
**Without completing Step 2, the dashboard menu plugin will not appear on the dashboard page.**
|
|
135
|
+
|
|
136
|
+
## Dashboard-Menu-Plugin-specific Conventions
|
|
137
|
+
|
|
138
|
+
- The `extends` field MUST contain a valid menu slot ID from a Wix business app — do NOT invent slot IDs.
|
|
139
|
+
- The `action.navigateToPage.pageId` MUST reference the `id` of an existing dashboard page extension in the project.
|
|
140
|
+
- The `action.openModal.componentId` MUST reference the `id` of an existing dashboard modal extension in the project.
|
|
141
|
+
- A dashboard menu plugin does NOT have a React component — it is configuration-only.
|
|
142
|
+
- Do NOT confuse dashboard menu plugins with dashboard plugins — they are different extension types.
|
|
143
|
+
|
|
144
|
+
## Slot Lookup Table
|
|
145
|
+
|
|
146
|
+
Identify which Wix app the user is targeting, then read **only** the corresponding reference file for slot IDs.
|
|
147
|
+
|
|
148
|
+
| Wix App | Keywords | Slot Reference |
|
|
149
|
+
|---------|----------|----------------|
|
|
150
|
+
| Wix Blog | blog, posts, categories, tags, drafts, scheduled | [blog-slots.md](dashboard-menu-plugin/blog-slots.md) |
|
|
151
|
+
| Wix Bookings | bookings, calendar, services, staff, booking list | [bookings-slots.md](dashboard-menu-plugin/bookings-slots.md) |
|
|
152
|
+
| Wix CRM | CRM, contacts | [crm-slots.md](dashboard-menu-plugin/crm-slots.md) |
|
|
153
|
+
| Wix eCommerce | ecommerce, orders, payment | [ecommerce-slots.md](dashboard-menu-plugin/ecommerce-slots.md) |
|
|
154
|
+
| Wix Events | events, guests, RSVP, ticketed | [events-slots.md](dashboard-menu-plugin/events-slots.md) |
|
|
155
|
+
| Wix Stores | stores, products, inventory, catalog | [stores-slots.md](dashboard-menu-plugin/stores-slots.md) |
|
|
156
|
+
| Wix Restaurants | restaurants, reservations, online orders, menus | [restaurants-slots.md](dashboard-menu-plugin/restaurants-slots.md) |
|
|
157
|
+
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
|
|
2
|
+
## Overview
|
|
3
|
+
|
|
4
|
+
Dashboard modals are popup dialogs triggered from dashboard pages or plugins. They consist of three files and use the Dashboard SDK for lifecycle control via `openModal()` and `closeModal()`.
|
|
5
|
+
|
|
6
|
+
## Quick Reference
|
|
7
|
+
|
|
8
|
+
| Task | Method | Example |
|
|
9
|
+
|------|--------|---------|
|
|
10
|
+
| Create modal | Create 3 files in `src/extensions/dashboard/modals/<folder>/` | See File Structure below |
|
|
11
|
+
| Open modal | `dashboard.openModal()` | `openModal({ modalId: "modal-id" })` |
|
|
12
|
+
| Pass data to modal | `params` in `openModal()` | `params: { userId: "123" }` |
|
|
13
|
+
| Read data in modal | `observeState()` | `dashboard.observeState((state) => { ... })` |
|
|
14
|
+
| Close modal | `dashboard.closeModal()` | `closeModal()` |
|
|
15
|
+
| Return data to parent | Pass data to `closeModal()` | `closeModal({ ... })` |
|
|
16
|
+
| Wait for modal close | `modalClosed` Promise | `const { modalClosed } = openModal(...);` |
|
|
17
|
+
|
|
18
|
+
## File Structure
|
|
19
|
+
|
|
20
|
+
Create **three files** in `src/extensions/dashboard/modals/<folder-name>/`:
|
|
21
|
+
|
|
22
|
+
1. **`extensions.ts`** - Builder configuration with modal ID, title, dimensions, component path
|
|
23
|
+
2. **`<modal-name>.tsx`** - React component rendering modal content
|
|
24
|
+
3. **`<modal-name>.config.ts`** - Configurable modal properties (title, width, height)
|
|
25
|
+
|
|
26
|
+
## Implementation
|
|
27
|
+
|
|
28
|
+
### Creating a Modal
|
|
29
|
+
|
|
30
|
+
Create the three required files:
|
|
31
|
+
|
|
32
|
+
**1. `extensions.ts`** - Modal builder configuration:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { extensions } from '@wix/astro/builders';
|
|
36
|
+
import config from './<modal-name>.config.ts';
|
|
37
|
+
|
|
38
|
+
export default extensions.dashboardModal({
|
|
39
|
+
id: "{{GENERATE_UUID}}",
|
|
40
|
+
title: config.title,
|
|
41
|
+
width: config.width,
|
|
42
|
+
height: config.height,
|
|
43
|
+
component: './extensions/dashboard/modals/<modal-name>/<modal-name>.tsx',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**CRITICAL: UUID Generation**
|
|
49
|
+
|
|
50
|
+
The `id` must be a unique, static UUID v4 string. Generate a fresh UUID for each extension - do NOT use `randomUUID()` or copy UUIDs from examples. Replace `{{GENERATE_UUID}}` with a freshly generated UUID like `"a1b2c3d4-e5f6-7890-abcd-ef1234567890"`.
|
|
51
|
+
|
|
52
|
+
Builder fields:
|
|
53
|
+
| Field | Type | Description |
|
|
54
|
+
|-------|------|-------------|
|
|
55
|
+
| id | string | Unique modal ID (GUID). Used with `openModal()` |
|
|
56
|
+
| title | string | Modal title shown in project dashboard |
|
|
57
|
+
| width | number | Initial width while loading |
|
|
58
|
+
| height | number | Initial height while loading |
|
|
59
|
+
| component | string | Path to the modal content `.tsx` file |
|
|
60
|
+
|
|
61
|
+
**2. `<modal-name>.tsx`** - Modal content component:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import type { FC } from 'react';
|
|
65
|
+
import { dashboard } from '@wix/dashboard';
|
|
66
|
+
import {
|
|
67
|
+
WixDesignSystemProvider,
|
|
68
|
+
Text,
|
|
69
|
+
Box,
|
|
70
|
+
CustomModalLayout,
|
|
71
|
+
} from '@wix/design-system';
|
|
72
|
+
import '@wix/design-system/styles.global.css';
|
|
73
|
+
import config from './<modal-name>.config.ts';
|
|
74
|
+
|
|
75
|
+
const { width, height, title } = config;
|
|
76
|
+
|
|
77
|
+
// To open your modal, call `openModal` with your modal id.
|
|
78
|
+
// e.g.
|
|
79
|
+
// import { dashboard } from '@wix/dashboard';
|
|
80
|
+
// function MyComponent() {
|
|
81
|
+
// return <button onClick={() => dashboard.openModal({ modalId: '8ef4d434-9c80-44f5-a3f5-6f15f3a34be7' })}>Open Modal</button>;
|
|
82
|
+
// }
|
|
83
|
+
const Modal: FC = () => {
|
|
84
|
+
return (
|
|
85
|
+
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
|
|
86
|
+
<CustomModalLayout
|
|
87
|
+
width={width}
|
|
88
|
+
maxHeight={height}
|
|
89
|
+
primaryButtonText="Save"
|
|
90
|
+
secondaryButtonText="Cancel"
|
|
91
|
+
primaryButtonOnClick={() => dashboard.closeModal()}
|
|
92
|
+
secondaryButtonOnClick={() => dashboard.closeModal()}
|
|
93
|
+
title={title}
|
|
94
|
+
subtitle="Edit this file to customize your modal"
|
|
95
|
+
content={
|
|
96
|
+
<Box direction="vertical" align="center">
|
|
97
|
+
<Text>Wix CLI Modal</Text>
|
|
98
|
+
</Box>
|
|
99
|
+
}
|
|
100
|
+
/>
|
|
101
|
+
</WixDesignSystemProvider>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default Modal;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**3. `<modal-name>.config.ts`** - Configurable properties:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
export default {
|
|
112
|
+
title: "My Modal",
|
|
113
|
+
width: 600,
|
|
114
|
+
height: 400,
|
|
115
|
+
};
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Then register in `src/extensions.ts`:
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { dashboardmodalYourModal } from './extensions/dashboard/modals/<modal-name>/extensions.ts';
|
|
122
|
+
|
|
123
|
+
export default app()
|
|
124
|
+
.use(dashboardmodalYourModal)
|
|
125
|
+
// ... other extensions
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Opening a Modal
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { dashboard } from "@wix/dashboard";
|
|
132
|
+
|
|
133
|
+
// Simple open
|
|
134
|
+
const result = await dashboard.openModal({
|
|
135
|
+
modalId: "your-modal-id", // From .extension.ts id field
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Pass data to modal via params
|
|
139
|
+
const result = await dashboard.openModal({
|
|
140
|
+
modalId: "your-modal-id",
|
|
141
|
+
params: {
|
|
142
|
+
userId: user.id,
|
|
143
|
+
itemData: complexObject, // Objects are passed directly, no encoding needed
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Get notified when the modal is closed
|
|
148
|
+
const { modalClosed } = dashboard.openModal({
|
|
149
|
+
modalId: "your-modal-id",
|
|
150
|
+
});
|
|
151
|
+
const result = await modalClosed; // Resolves with data from closeModal()
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Receiving Data in Modal
|
|
155
|
+
|
|
156
|
+
Use `observeState()` to access data passed via `params` in `openModal()`:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import { dashboard } from "@wix/dashboard";
|
|
160
|
+
import { useEffect, useState } from "react";
|
|
161
|
+
|
|
162
|
+
function MyModal() {
|
|
163
|
+
const [modalData, setModalData] = useState<{ userId?: string; itemData?: any }>({});
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
dashboard.observeState((state) => {
|
|
167
|
+
// Access custom data passed through openModal params
|
|
168
|
+
if (state.userId) {
|
|
169
|
+
setModalData({
|
|
170
|
+
userId: state.userId,
|
|
171
|
+
itemData: state.itemData,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}, []);
|
|
176
|
+
|
|
177
|
+
return <div>User ID: {modalData.userId}</div>;
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Closing Modal
|
|
182
|
+
|
|
183
|
+
Call `closeModal()` from within the modal extension to close it. Optionally pass data back to the opener.
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
import { dashboard } from "@wix/dashboard";
|
|
187
|
+
|
|
188
|
+
// Close without returning data
|
|
189
|
+
dashboard.closeModal();
|
|
190
|
+
|
|
191
|
+
// Close with custom return data
|
|
192
|
+
dashboard.closeModal({ saved: true, itemId: "123" });
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
| Parameter | Type | Description |
|
|
196
|
+
|-----------|------|-------------|
|
|
197
|
+
| closeData | Serializable (optional) | Data to pass back to the modal opener. Must be cloneable via [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). |
|
|
198
|
+
|
|
199
|
+
**Supported types:** strings, numbers, booleans, plain objects, arrays, Dates, Maps, Sets, ArrayBuffers.
|
|
200
|
+
**Not supported:** functions, DOM nodes, class instances with methods, Symbols, Promises.
|
|
201
|
+
|
|
202
|
+
**Returns:** `void`
|
|
203
|
+
|
|
204
|
+
### Customizing Modal
|
|
205
|
+
|
|
206
|
+
Edit `.config.ts` for organized settings:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
export default {
|
|
210
|
+
title: 'User Settings',
|
|
211
|
+
width: 600,
|
|
212
|
+
height: 500,
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Import in `.tsx`:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import config from './modal.config.ts';
|
|
220
|
+
|
|
221
|
+
export default function MyModal() {
|
|
222
|
+
return (
|
|
223
|
+
<CustomModalLayout
|
|
224
|
+
title={config.title}
|
|
225
|
+
// ... rest of component
|
|
226
|
+
/>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Common Mistakes
|
|
232
|
+
|
|
233
|
+
| Mistake | Fix |
|
|
234
|
+
|---------|-----|
|
|
235
|
+
| Can't find modal ID | Check `.extension.ts` file's `id` field |
|
|
236
|
+
| Forgetting to register in `extensions.ts` | Import and `.use()` the modal |
|
|
237
|
+
| Using `extensionId` instead of `modalId` | Use `modalId` in `openModal()` |
|
|
238
|
+
| Can't access params in modal | Use `dashboard.observeState()` to read passed data |
|
|
239
|
+
| Modal won't close | Use `dashboard.closeModal()` from `@wix/dashboard` |
|
|
240
|
+
|
|
241
|
+
## Real-World Example
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
// Dashboard Page: Opening edit modal
|
|
245
|
+
const handleEdit = async (item: Item) => {
|
|
246
|
+
dashboard.openModal({
|
|
247
|
+
modalId: "edit-item-modal-guid",
|
|
248
|
+
params: {
|
|
249
|
+
itemId: item._id,
|
|
250
|
+
item: item, // Objects passed directly via params
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// Modal: Receiving and saving data
|
|
256
|
+
export default function ItemEditModal() {
|
|
257
|
+
const [formData, setFormData] = useState<Item | null>(null);
|
|
258
|
+
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
dashboard.observeState((state) => {
|
|
261
|
+
if (state.item) {
|
|
262
|
+
setFormData(state.item);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}, []);
|
|
266
|
+
|
|
267
|
+
const handleSave = async () => {
|
|
268
|
+
// Save logic
|
|
269
|
+
dashboard.showToast({ message: "Saved!", type: "success" });
|
|
270
|
+
dashboard.closeModal();
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<CustomModalLayout
|
|
275
|
+
title="Edit Item"
|
|
276
|
+
primaryButtonText="Save"
|
|
277
|
+
onCloseButtonClick={() => dashboard.closeModal()}
|
|
278
|
+
primaryButtonOnClick={handleSave}
|
|
279
|
+
content={/* form fields */}
|
|
280
|
+
/>
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
```
|