@wix/agent-skills 1.6.0 → 1.7.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 +2 -2
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +49 -42
- package/skills/wix-app/references/BACKEND_EVENT.md +10 -65
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +101 -406
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +14 -111
- package/skills/wix-app/references/DASHBOARD_MODAL.md +56 -205
- package/skills/wix-app/references/DASHBOARD_PAGE.md +19 -98
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +6 -108
- package/skills/wix-app/references/DATA_COLLECTION.md +113 -198
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
- package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
- package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
- package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
- package/skills/wix-headless/SKILL.md +111 -389
- package/skills/wix-headless/references/BUILD.md +307 -0
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +115 -0
- package/skills/wix-headless/references/DISCOVERY.md +237 -112
- package/skills/wix-headless/references/PLAN.md +82 -0
- package/skills/wix-headless/references/SEED.md +205 -0
- package/skills/wix-headless/references/SETUP.md +140 -134
- package/skills/wix-headless/references/astro/COMPOSE.md +142 -0
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +1 -1
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
- package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +6 -4
- package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +5 -5
- package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +5 -5
- package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +5 -5
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +331 -0
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +1 -1
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +1 -1
- package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +3 -3
- package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +13 -13
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +1 -1
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +1 -1
- package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +1 -1
- package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
- package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +4 -4
- package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
- package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +5 -3
- package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +3 -3
- package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
- package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
- package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
- package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
- package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
- package/skills/wix-headless/references/astro/templates/global.css +286 -0
- package/skills/wix-headless/references/astro/templates/index.astro +56 -0
- package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
- package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +10 -11
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +31 -230
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +13 -8
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +38 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +10 -10
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +11 -11
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +47 -50
- package/skills/wix-headless/references/seed-recipes.md +49 -0
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +110 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
- package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +17 -17
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +20 -29
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +1 -1
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +25 -16
- package/skills/wix-headless/references/shared/STYLING.md +47 -10
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +25 -25
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -17
- package/skills/wix-headless/references/verticals/_schema.json +31 -117
- package/skills/wix-headless/references/verticals/_schema.md +60 -150
- package/skills/wix-headless/references/verticals/blog.md +5 -99
- package/skills/wix-headless/references/verticals/cms.md +9 -100
- package/skills/wix-headless/references/verticals/ecom.md +5 -76
- package/skills/wix-headless/references/verticals/forms.md +5 -85
- package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
- package/skills/wix-headless/references/verticals/stores.md +10 -144
- package/skills/wix-headless/scripts/check-manifest.mjs +5 -5
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +29 -23
- package/skills/wix-headless/scripts/init-site-json.mjs +59 -21
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
- package/skills/wix-headless/scripts/preview.sh +3 -3
- package/skills/wix-headless/scripts/release.sh +4 -4
- package/skills/wix-headless/scripts/scaffold.sh +75 -20
- package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
- package/skills/wix-manage/SKILL.md +4 -8
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +2 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
- package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
- package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
- package/skills/wix-manage/references/forms/create-form.md +2 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +2 -0
- package/skills/wix-app/references/custom-element-widget/default-thumbnail.png +0 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
- package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
- package/skills/wix-headless/references/commands/install-app.md +0 -42
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
- package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
- package/skills/wix-manage/references/events/list-events.md +0 -203
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
|
@@ -2,344 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
This reference documents components and patterns specific to widget settings panels. For general WDS component documentation (FormField, Input, Dropdown, Checkbox, ToggleSwitch, DatePicker, Box, etc.), use the the `wix-design-system` skill.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Layout
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
SidePanel,
|
|
10
|
-
FormField,
|
|
11
|
-
Input,
|
|
12
|
-
Dropdown,
|
|
13
|
-
Checkbox,
|
|
14
|
-
ToggleSwitch,
|
|
15
|
-
DatePicker,
|
|
16
|
-
TimeInput,
|
|
17
|
-
Box,
|
|
18
|
-
WixDesignSystemProvider,
|
|
19
|
-
} from "@wix/design-system";
|
|
20
|
-
import "@wix/design-system/styles.global.css";
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## SidePanel Components
|
|
7
|
+
The scaffolded `<name>.panel.tsx` already wraps everything in `SidePanel > Header > Content > Footer`. Wrap each `FormField` in `SidePanel.Field`. For component-level props (`SidePanel`, `SidePanel.Header`/`Content`/`Field`/`Footer`, `SectionHelper`), use the wix-design-system skill.
|
|
24
8
|
|
|
25
|
-
|
|
9
|
+
## Color & Font Picker Fields
|
|
26
10
|
|
|
27
|
-
|
|
11
|
+
Use the Wix Editor's native picker dialogs via `inputs.selectColor()` and `inputs.selectFont()` from `@wix/editor`. Both follow the same callback shape: `inputs.selectX(value, { onChange })`. Do NOT use `<input type="color">`, async/await, or a readOnly text Input — those don't integrate with the Editor picker dialogs.
|
|
28
12
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{/* Form fields */}
|
|
34
|
-
</SidePanel.Content>
|
|
35
|
-
</SidePanel>
|
|
36
|
-
```
|
|
13
|
+
| Picker | API | Preview / trigger | Value type |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| Color | `inputs.selectColor(value, { onChange })` | `FillPreview` (WDS) | `string` (CSS color) |
|
|
16
|
+
| Font | `inputs.selectFont(value, { onChange })` | `Button` (WDS) | `{ font: string; textDecoration: string }` |
|
|
37
17
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- `width`: Panel width (default: "300")
|
|
41
|
-
- `height`: Panel height (default: "100vh")
|
|
42
|
-
|
|
43
|
-
### SidePanel.Header
|
|
44
|
-
|
|
45
|
-
Header section with title.
|
|
18
|
+
Wrap each picker in the standard `<SidePanel.Field><FormField label={label}>…</FormField></SidePanel.Field>`. The picker handlers themselves:
|
|
46
19
|
|
|
47
20
|
```typescript
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- `title`: Header title text
|
|
54
|
-
|
|
55
|
-
### SidePanel.Content
|
|
56
|
-
|
|
57
|
-
Content area for form fields.
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
<SidePanel.Content noPadding stretchVertically>
|
|
61
|
-
{/* Form content */}
|
|
62
|
-
</SidePanel.Content>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**Props:**
|
|
66
|
-
|
|
67
|
-
- `noPadding`: Remove default padding
|
|
68
|
-
- `stretchVertically`: Stretch to fill available height
|
|
69
|
-
|
|
70
|
-
### SidePanel.Field
|
|
71
|
-
|
|
72
|
-
Wrapper for individual form fields. Use this to wrap each `FormField`.
|
|
73
|
-
|
|
74
|
-
```typescript
|
|
75
|
-
<SidePanel.Field>
|
|
76
|
-
<FormField label="Title">
|
|
77
|
-
<Input value={title} onChange={handleChange} />
|
|
78
|
-
</FormField>
|
|
79
|
-
</SidePanel.Field>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Widget API Integration Patterns
|
|
83
|
-
|
|
84
|
-
### TimeInput with widget.setProp
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
const parseTimeValue = (timeString: string): Date => {
|
|
88
|
-
const [hours, minutes] = timeString.split(':');
|
|
89
|
-
const date = new Date();
|
|
90
|
-
date.setHours(parseInt(hours, 10), parseInt(minutes, 10), 0, 0);
|
|
91
|
-
return date;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
<TimeInput
|
|
95
|
-
value={parseTimeValue(targetTime)}
|
|
96
|
-
onChange={({ date }) => {
|
|
97
|
-
const hours = String(date.getHours()).padStart(2, '0');
|
|
98
|
-
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
99
|
-
const newTime = `${hours}:${minutes}`;
|
|
100
|
-
setTargetTime(newTime);
|
|
101
|
-
widget.setProp("target-time", newTime);
|
|
102
|
-
}}
|
|
21
|
+
// Color
|
|
22
|
+
<FillPreview
|
|
23
|
+
fill={value}
|
|
24
|
+
onClick={() => inputs.selectColor(value, { onChange: (val) => { if (val) onChange(val); } })}
|
|
103
25
|
/>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Custom Components
|
|
107
|
-
|
|
108
|
-
### ColorPickerField
|
|
109
|
-
|
|
110
|
-
Custom component for color selection using `inputs.selectColor()` from `@wix/editor`. This opens the Wix color picker dialog with theme colors, gradients, and more — **NOT** a basic HTML `<input type="color">`.
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
import React, { type FC } from 'react';
|
|
114
|
-
import { inputs } from '@wix/editor';
|
|
115
|
-
import { FormField, Box, FillPreview, SidePanel } from '@wix/design-system';
|
|
116
|
-
|
|
117
|
-
interface ColorPickerFieldProps {
|
|
118
|
-
label: string;
|
|
119
|
-
value: string;
|
|
120
|
-
onChange: (value: string) => void;
|
|
121
|
-
}
|
|
122
26
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<FormField label={label}>
|
|
130
|
-
<Box width="30px" height="30px">
|
|
131
|
-
<FillPreview
|
|
132
|
-
fill={value}
|
|
133
|
-
onClick={() => inputs.selectColor(value, { onChange: (val) => { if (val) onChange(val); } })}
|
|
134
|
-
/>
|
|
135
|
-
</Box>
|
|
136
|
-
</FormField>
|
|
137
|
-
</SidePanel.Field>
|
|
138
|
-
);
|
|
27
|
+
// Font
|
|
28
|
+
<Button onClick={() => inputs.selectFont(value, {
|
|
29
|
+
onChange: (val) => onChange({ font: val.font, textDecoration: val.textDecoration || '' }),
|
|
30
|
+
})}>
|
|
31
|
+
Change Font
|
|
32
|
+
</Button>
|
|
139
33
|
```
|
|
140
34
|
|
|
141
|
-
**Important:** Always use `inputs.selectColor()` from `@wix/editor` with the `FillPreview` WDS component. Do NOT use `<Input type="color">` — it produces a basic browser color picker that doesn't match the Wix Editor UX.
|
|
142
|
-
|
|
143
|
-
### FontPickerField
|
|
144
|
-
|
|
145
|
-
Custom component for font selection using `inputs.selectFont()` from `@wix/editor`. This opens the Wix font picker dialog with font family, size, bold, italic, and other typography features.
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
import React, { type FC } from 'react';
|
|
149
|
-
import { inputs } from '@wix/editor';
|
|
150
|
-
import { FormField, Button, Text, SidePanel } from '@wix/design-system';
|
|
151
|
-
|
|
152
|
-
interface FontValue {
|
|
153
|
-
font: string;
|
|
154
|
-
textDecoration: string;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
interface FontPickerFieldProps {
|
|
158
|
-
label: string;
|
|
159
|
-
value: FontValue;
|
|
160
|
-
onChange: (value: FontValue) => void;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export const FontPickerField: FC<FontPickerFieldProps> = ({
|
|
164
|
-
label,
|
|
165
|
-
value,
|
|
166
|
-
onChange,
|
|
167
|
-
}) => (
|
|
168
|
-
<SidePanel.Field>
|
|
169
|
-
<FormField label={label}>
|
|
170
|
-
<Button
|
|
171
|
-
size="small"
|
|
172
|
-
priority="secondary"
|
|
173
|
-
onClick={() => inputs.selectFont(value, { onChange: (val) => onChange({ font: val.font, textDecoration: val.textDecoration || "" }) })}
|
|
174
|
-
fullWidth
|
|
175
|
-
>
|
|
176
|
-
<Text size="small" ellipsis>Change Font</Text>
|
|
177
|
-
</Button>
|
|
178
|
-
</FormField>
|
|
179
|
-
</SidePanel.Field>
|
|
180
|
-
);
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
**Important:** Always use `inputs.selectFont()` from `@wix/editor` with the callback pattern `inputs.selectFont(value, { onChange })`. Do NOT use an async/await pattern or a readOnly text Input — the callback pattern integrates directly with the Wix Editor font picker dialog.
|
|
184
|
-
|
|
185
|
-
## Complete Example
|
|
186
|
-
|
|
187
|
-
```typescript
|
|
188
|
-
import React, { type FC, useState, useEffect, useCallback } from "react";
|
|
189
|
-
import { widget } from "@wix/editor";
|
|
190
|
-
import {
|
|
191
|
-
SidePanel,
|
|
192
|
-
WixDesignSystemProvider,
|
|
193
|
-
Input,
|
|
194
|
-
FormField,
|
|
195
|
-
TimeInput,
|
|
196
|
-
Box,
|
|
197
|
-
} from "@wix/design-system";
|
|
198
|
-
import "@wix/design-system/styles.global.css";
|
|
199
|
-
import { ColorPickerField } from "./components/ColorPickerField";
|
|
200
|
-
import { FontPickerField } from "./components/FontPickerField";
|
|
201
|
-
import { parseTimeValue } from "./utils";
|
|
202
|
-
|
|
203
|
-
const DEFAULT_BG_COLOR = "#0a0e27";
|
|
204
|
-
const DEFAULT_TEXT_COLOR = "#00ff88";
|
|
205
|
-
const DEFAULT_TEXT_FONT = "";
|
|
206
|
-
const DEFAULT_TEXT_DECORATION = "";
|
|
207
|
-
|
|
208
|
-
const Panel: FC = () => {
|
|
209
|
-
const [title, setTitle] = useState<string>("Countdown");
|
|
210
|
-
const [targetDate, setTargetDate] = useState<string>("");
|
|
211
|
-
const [targetTime, setTargetTime] = useState<string>("00:00");
|
|
212
|
-
const [bgColor, setBgColor] = useState<string>(DEFAULT_BG_COLOR);
|
|
213
|
-
const [textColor, setTextColor] = useState<string>(DEFAULT_TEXT_COLOR);
|
|
214
|
-
const [font, setFont] = useState({ font: DEFAULT_TEXT_FONT, textDecoration: DEFAULT_TEXT_DECORATION });
|
|
215
|
-
|
|
216
|
-
useEffect(() => {
|
|
217
|
-
Promise.all([
|
|
218
|
-
widget.getProp("title"),
|
|
219
|
-
widget.getProp("target-date"),
|
|
220
|
-
widget.getProp("target-time"),
|
|
221
|
-
widget.getProp("bg-color"),
|
|
222
|
-
widget.getProp("text-color"),
|
|
223
|
-
widget.getProp("font"),
|
|
224
|
-
])
|
|
225
|
-
.then(([titleVal, dateVal, timeVal, bgColorVal, textColorVal, fontString]) => {
|
|
226
|
-
setTitle(titleVal || "Countdown");
|
|
227
|
-
setTargetDate(dateVal || "");
|
|
228
|
-
setTargetTime(timeVal || "00:00");
|
|
229
|
-
setBgColor(bgColorVal || DEFAULT_BG_COLOR);
|
|
230
|
-
setTextColor(textColorVal || DEFAULT_TEXT_COLOR);
|
|
231
|
-
setFont(JSON.parse(fontString || "{}"));
|
|
232
|
-
})
|
|
233
|
-
.catch((error) => console.error("Failed to fetch widget properties:", error));
|
|
234
|
-
}, []);
|
|
235
|
-
|
|
236
|
-
const handleTitleChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
237
|
-
const newTitle = event.target.value;
|
|
238
|
-
setTitle(newTitle);
|
|
239
|
-
widget.setProp("title", newTitle);
|
|
240
|
-
}, []);
|
|
241
|
-
|
|
242
|
-
const handleDateChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
243
|
-
const newDate = event.target.value;
|
|
244
|
-
setTargetDate(newDate);
|
|
245
|
-
widget.setProp("target-date", newDate);
|
|
246
|
-
}, []);
|
|
247
|
-
|
|
248
|
-
const handleTimeChange = useCallback(({ date }: { date: Date }) => {
|
|
249
|
-
if (date) {
|
|
250
|
-
const hours = String(date.getHours()).padStart(2, '0');
|
|
251
|
-
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
252
|
-
const newTime = `${hours}:${minutes}`;
|
|
253
|
-
setTargetTime(newTime);
|
|
254
|
-
widget.setProp("target-time", newTime);
|
|
255
|
-
}
|
|
256
|
-
}, []);
|
|
257
|
-
|
|
258
|
-
const handleBgColorChange = (value: string) => {
|
|
259
|
-
setBgColor(value);
|
|
260
|
-
widget.setProp("bg-color", value);
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
const handleTextColorChange = (value: string) => {
|
|
264
|
-
setTextColor(value);
|
|
265
|
-
widget.setProp("text-color", value);
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
const handleFontChange = (value: { font: string; textDecoration: string }) => {
|
|
269
|
-
setFont(value);
|
|
270
|
-
widget.setProp("font", JSON.stringify(value));
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<WixDesignSystemProvider>
|
|
275
|
-
<SidePanel width="300" height="100vh">
|
|
276
|
-
<SidePanel.Header title="Countdown Settings" />
|
|
277
|
-
<SidePanel.Content noPadding stretchVertically>
|
|
278
|
-
<Box direction="vertical" gap="24px">
|
|
279
|
-
<SidePanel.Field>
|
|
280
|
-
<FormField label="Title" required>
|
|
281
|
-
<Input
|
|
282
|
-
type="text"
|
|
283
|
-
value={title}
|
|
284
|
-
onChange={handleTitleChange}
|
|
285
|
-
placeholder="Enter countdown title"
|
|
286
|
-
/>
|
|
287
|
-
</FormField>
|
|
288
|
-
</SidePanel.Field>
|
|
289
|
-
|
|
290
|
-
<SidePanel.Field>
|
|
291
|
-
<FormField label="Target Date" required>
|
|
292
|
-
<Input
|
|
293
|
-
type="date"
|
|
294
|
-
value={targetDate}
|
|
295
|
-
onChange={handleDateChange}
|
|
296
|
-
/>
|
|
297
|
-
</FormField>
|
|
298
|
-
</SidePanel.Field>
|
|
299
|
-
|
|
300
|
-
<SidePanel.Field>
|
|
301
|
-
<FormField label="Target Time" required>
|
|
302
|
-
<TimeInput
|
|
303
|
-
value={parseTimeValue(targetTime)}
|
|
304
|
-
onChange={handleTimeChange}
|
|
305
|
-
/>
|
|
306
|
-
</FormField>
|
|
307
|
-
</SidePanel.Field>
|
|
308
|
-
|
|
309
|
-
<ColorPickerField
|
|
310
|
-
label="Background Color"
|
|
311
|
-
value={bgColor}
|
|
312
|
-
onChange={handleBgColorChange}
|
|
313
|
-
/>
|
|
314
|
-
|
|
315
|
-
<ColorPickerField
|
|
316
|
-
label="Text Color"
|
|
317
|
-
value={textColor}
|
|
318
|
-
onChange={handleTextColorChange}
|
|
319
|
-
/>
|
|
320
|
-
|
|
321
|
-
<FontPickerField
|
|
322
|
-
label="Text Font"
|
|
323
|
-
value={font}
|
|
324
|
-
onChange={handleFontChange}
|
|
325
|
-
/>
|
|
326
|
-
</Box>
|
|
327
|
-
</SidePanel.Content>
|
|
328
|
-
</SidePanel>
|
|
329
|
-
</WixDesignSystemProvider>
|
|
330
|
-
);
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
export default Panel;
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
## Notes
|
|
337
|
-
|
|
338
|
-
- Always import `@wix/design-system/styles.global.css` for proper styling
|
|
339
|
-
- Use `SidePanel.Field` to wrap each `FormField`
|
|
340
|
-
- Update both local state AND `widget.setProp()` in onChange handlers
|
|
341
|
-
- Prop names in `widget.getProp()` and `widget.setProp()` use kebab-case
|
|
342
|
-
- For color selection, use `inputs.selectColor()` from `@wix/editor` with `FillPreview` — do NOT use `<Input type="color">`
|
|
343
|
-
- For font selection, use `inputs.selectFont()` from `@wix/editor` with a `Button` — do NOT use a text Input
|
|
344
|
-
- Both `inputs.selectColor()` and `inputs.selectFont()` use the callback pattern: `inputs.selectColor(value, { onChange })` and `inputs.selectFont(value, { onChange })`
|
|
345
|
-
- Font values are stored as JSON strings via `widget.setProp("font", JSON.stringify(value))` and parsed back with `JSON.parse()`
|
|
@@ -44,15 +44,3 @@
|
|
|
44
44
|
- **Use case:** Add custom payment options to the collect payment button menu.
|
|
45
45
|
|
|
46
46
|
> **Note:** This slot also appears on the Wix eCommerce Order Page.
|
|
47
|
-
|
|
48
|
-
### Booking List Page
|
|
49
|
-
|
|
50
|
-
**Booking More Actions Menu — Slot ID:** `38fbe11f-6bc6-4df7-a742-e3e169a16cef`
|
|
51
|
-
|
|
52
|
-
- **Dashboard path:** Booking Calendar > Booking List
|
|
53
|
-
- **Use case:** Add actions for individual bookings.
|
|
54
|
-
|
|
55
|
-
**Booking List Bulk Actions More Actions Menu — Slot ID:** `f1ab2ce9-a790-4e3e-a0f7-fae4da37a668`
|
|
56
|
-
|
|
57
|
-
- **Dashboard path:** Booking Calendar > Booking List (when items are selected)
|
|
58
|
-
- **Use case:** Add bulk actions for multiple selected bookings.
|
|
@@ -15,3 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
- **Dashboard path:** Sales > Orders
|
|
17
17
|
- **Use case:** Add actions for individual orders in the orders list.
|
|
18
|
+
|
|
19
|
+
### Edit Draft Order Page
|
|
20
|
+
|
|
21
|
+
**Draft Order Fee — Slot ID:** `057f1726-f0b3-40ef-8903-1bd104e18369`
|
|
22
|
+
|
|
23
|
+
- **Dashboard path:** Sales > Orders > Order > More Actions > Edit Order
|
|
24
|
+
- **Use case:** Add a menu item to the edit-order screen — typically used to open a modal that adds or adjusts custom order fees.
|
|
@@ -7,21 +7,9 @@
|
|
|
7
7
|
- **Dashboard path:** Table Reservations
|
|
8
8
|
- **Use case:** Add global actions to the table reservations page's more actions menu.
|
|
9
9
|
|
|
10
|
-
**Reservation Item More Actions Menu — Slot ID:** `f51f609d-950f-448a-a5e7-f01d31a7978d`
|
|
11
|
-
|
|
12
|
-
- **Dashboard path:** Table Reservations
|
|
13
|
-
- **Use case:** Add actions for individual reservations.
|
|
14
|
-
|
|
15
10
|
### Online Orders Page
|
|
16
11
|
|
|
17
12
|
**Order Card More Actions Menu — Slot ID:** `d6b9230e-7388-4b5a-bb50-86afe3e344b2`
|
|
18
13
|
|
|
19
14
|
- **Dashboard path:** Online Orders
|
|
20
15
|
- **Use case:** Add actions for individual online orders.
|
|
21
|
-
|
|
22
|
-
### Restaurant Menus Page
|
|
23
|
-
|
|
24
|
-
**Menus Main More Actions Menu — Slot ID:** `e2a7ffb0-5e9c-4eda-bc0c-14724ff3e407`
|
|
25
|
-
|
|
26
|
-
- **Dashboard path:** Restaurant Menus
|
|
27
|
-
- **Use case:** Add global actions to the restaurant menus page's more actions menu.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Dashboard Plugin Slots Reference
|
|
2
2
|
|
|
3
|
-
Slots are UI placeholders on dashboard pages of Wix first-party business apps. Each slot has a unique ID
|
|
3
|
+
Slots are UI placeholders on dashboard pages of Wix first-party business apps. Each slot has a unique ID passed as the `extendsSlotId` scaffold param (written as `extends` in the generated `.extension.ts` file).
|
|
4
|
+
|
|
5
|
+
> **Authoritative slot list**: run `wix schema generate --type DASHBOARD_PLUGIN` for the live, complete `extendsSlotId` enum (each `anyOf` entry has the slot's human-readable title). This file documents per-slot parameters, dashboard paths, and use cases — content the schema does not carry.
|
|
4
6
|
|
|
5
7
|
**Key behaviors:**
|
|
6
8
|
- Some slots with the same ID appear on different pages. A plugin targeting such a slot is displayed on all pages containing it.
|
|
@@ -161,20 +163,6 @@ Slots are UI placeholders on dashboard pages of Wix first-party business apps. E
|
|
|
161
163
|
|
|
162
164
|
> **Note:** This slot also appears on the Wix Bookings Calendar Page.
|
|
163
165
|
|
|
164
|
-
### Edit Order Page — Additional Fees
|
|
165
|
-
|
|
166
|
-
**Slot ID:** `057f1726-f0b3-40ef-8903-1bd104e18369`
|
|
167
|
-
|
|
168
|
-
- **Dashboard path:** Sales > Orders > Order > More Actions > Edit Order
|
|
169
|
-
- **Location:** Right side of page, in the "Order summary" card
|
|
170
|
-
- **Parameters:**
|
|
171
|
-
| Name | Type | Description |
|
|
172
|
-
|------|------|-------------|
|
|
173
|
-
| `draftOrderId` | String | ID of the order being edited |
|
|
174
|
-
| `onDraftOrderUpdate()` | `() => Promise<void>` | Callback that notifies the host page about a draft order update, prompting a UI refresh |
|
|
175
|
-
- **Multi-plugin:** Vertical, newest at bottom
|
|
176
|
-
- **Use case:** Manage custom fees for orders — add or remove order fees according to custom business logic.
|
|
177
|
-
|
|
178
166
|
---
|
|
179
167
|
|
|
180
168
|
## Wix Events
|
|
@@ -2,27 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
The Additional Fees SPI
|
|
6
|
-
|
|
7
|
-
## Import
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
import { additionalFees } from '@wix/ecom/service-plugins';
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Handler
|
|
14
|
-
|
|
15
|
-
| Handler | Description |
|
|
16
|
-
| --- | --- |
|
|
17
|
-
| `calculateAdditionalFees` | Calculate and return additional fees to apply to the order |
|
|
5
|
+
The Additional Fees SPI lets you add custom fees to orders during checkout (handling fees, rush delivery charges, global order fees, etc.). Implement the `calculateAdditionalFees` handler — it calculates and returns the fees to apply.
|
|
18
6
|
|
|
19
7
|
## Request and Response Schema
|
|
20
8
|
|
|
21
|
-
Before implementing, call `ReadFullDocsMethodSchema`
|
|
22
|
-
|
|
23
|
-
**MCP Tools to use:**
|
|
24
|
-
- `ReadFullDocsMethodSchema` - Full request/response schema with field names, types, and descriptions
|
|
25
|
-
- `ReadFullDocsArticle` - Full documentation with code examples (use if schema needs more context)
|
|
9
|
+
Before implementing, call `ReadFullDocsMethodSchema` on the docs URL to get the full request/response types.
|
|
26
10
|
|
|
27
11
|
| Handler | Docs URL |
|
|
28
12
|
| --- | --- |
|
|
@@ -2,29 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
The Staff Sorting Provider SPI
|
|
5
|
+
The Staff Sorting Provider SPI lets you implement custom staff assignment algorithms for Wix Bookings. When a booking slot has multiple available staff members, Wix calls your plugin to determine the priority order. Implement the `sortStaffMembers` handler — it returns the available staff members reordered by priority.
|
|
6
6
|
|
|
7
7
|
**FQDN**: `wix.interfaces.resources.sorting.v1.staff_sorting_provider`
|
|
8
8
|
|
|
9
|
-
## Import
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
import { staffSorting } from "@wix/bookings/service-plugins";
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Handler
|
|
16
|
-
|
|
17
|
-
| Handler | Description |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
| `sortStaffMembers` | Sort available staff members by priority for a given booking slot |
|
|
20
|
-
|
|
21
9
|
## Request and Response Schema
|
|
22
10
|
|
|
23
|
-
Before implementing, call `ReadFullDocsMethodSchema`
|
|
24
|
-
|
|
25
|
-
**MCP Tools to use:**
|
|
26
|
-
- `ReadFullDocsMethodSchema` - Full request/response schema with field names, types, and descriptions
|
|
27
|
-
- `ReadFullDocsArticle` - Full documentation with code examples (use if schema needs more context)
|
|
11
|
+
Before implementing, call `ReadFullDocsMethodSchema` on the docs URL to get the full request/response types.
|
|
28
12
|
|
|
29
13
|
| Handler | Docs URL |
|
|
30
14
|
| --- | --- |
|
|
@@ -85,30 +69,6 @@ staffSorting.provideHandlers({
|
|
|
85
69
|
});
|
|
86
70
|
```
|
|
87
71
|
|
|
88
|
-
## Extension Registration
|
|
89
|
-
|
|
90
|
-
Register the staff sorting provider using the `bookingsStaffSortingProvider()` builder. This builder requires additional fields beyond the standard ones:
|
|
91
|
-
|
|
92
|
-
```typescript
|
|
93
|
-
import { extensions } from "@wix/astro/builders";
|
|
94
|
-
|
|
95
|
-
export const staffSorting = extensions.bookingsStaffSortingProvider({
|
|
96
|
-
id: "{{GENERATE_UUID}}",
|
|
97
|
-
name: "Workload Balanced Staff Assignment",
|
|
98
|
-
source: "./backend/service-plugins/bookings-staff-sorting/workload-balancer/plugin.ts",
|
|
99
|
-
methodName: "Workload Balancer",
|
|
100
|
-
methodDescription: "Balances workload by prioritizing staff with fewer recent bookings",
|
|
101
|
-
});
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Additional Builder Fields
|
|
105
|
-
|
|
106
|
-
| Field | Type | Required | Max Length | Description |
|
|
107
|
-
| --- | --- | --- | --- | --- |
|
|
108
|
-
| `methodName` | string | Yes | - | Display name for the sorting method |
|
|
109
|
-
| `methodDescription` | string | Yes | 100 chars | Description of the sorting algorithm (max 100 characters) |
|
|
110
|
-
| `dashboardPluginId` | string | No | - | Optional dashboard plugin ID for configuration UI |
|
|
111
|
-
|
|
112
72
|
## Key Implementation Notes
|
|
113
73
|
|
|
114
74
|
1. **Return all IDs** - You must return every ID from `availableResourceIds`, just reordered
|
|
@@ -4,12 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
The Custom Triggers SPI allows you to define custom conditions that can trigger discounts in the Wix eCommerce system. You can create time-based triggers, product-based triggers, or any custom logic.
|
|
6
6
|
|
|
7
|
-
## Import
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
import { customTriggers } from "@wix/ecom/service-plugins";
|
|
11
|
-
```
|
|
12
|
-
|
|
13
7
|
## Handlers
|
|
14
8
|
|
|
15
9
|
| Handler | Description |
|
|
@@ -19,11 +13,7 @@ import { customTriggers } from "@wix/ecom/service-plugins";
|
|
|
19
13
|
|
|
20
14
|
## Request and Response Schema
|
|
21
15
|
|
|
22
|
-
Before implementing, call `ReadFullDocsMethodSchema`
|
|
23
|
-
|
|
24
|
-
**MCP Tools to use:**
|
|
25
|
-
- `ReadFullDocsMethodSchema` - Full request/response schema with field names, types, and descriptions
|
|
26
|
-
- `ReadFullDocsArticle` - Full documentation with code examples (use if schema needs more context)
|
|
16
|
+
Before implementing, call `ReadFullDocsMethodSchema` on each docs URL to get the full request/response types.
|
|
27
17
|
|
|
28
18
|
| Handler | Docs URL |
|
|
29
19
|
| --- | --- |
|
|
@@ -4,12 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
The Gift Vouchers Provider SPI allows you to integrate external gift card or voucher systems with Wix eCommerce. This enables customers to redeem gift cards, check balances, and void transactions.
|
|
6
6
|
|
|
7
|
-
## Import
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
import { giftVouchersProvider } from '@wix/ecom/service-plugins';
|
|
11
|
-
```
|
|
12
|
-
|
|
13
7
|
## Handlers
|
|
14
8
|
|
|
15
9
|
| Handler | Description |
|
|
@@ -20,11 +14,7 @@ import { giftVouchersProvider } from '@wix/ecom/service-plugins';
|
|
|
20
14
|
|
|
21
15
|
## Request and Response Schema
|
|
22
16
|
|
|
23
|
-
Before implementing, call `ReadFullDocsMethodSchema`
|
|
24
|
-
|
|
25
|
-
**MCP Tools to use:**
|
|
26
|
-
- `ReadFullDocsMethodSchema` - Full request/response schema with field names, types, and descriptions
|
|
27
|
-
- `ReadFullDocsArticle` - Full documentation with code examples (use if schema needs more context)
|
|
17
|
+
Before implementing, call `ReadFullDocsMethodSchema` on each docs URL to get the full request/response types.
|
|
28
18
|
|
|
29
19
|
| Handler | Docs URL |
|
|
30
20
|
| --- | --- |
|
|
@@ -2,29 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
The Payment Settings SPI
|
|
6
|
-
|
|
7
|
-
A common use case is to enforce 3D Secure (3DS) payments for certain transactions based on custom business logic.
|
|
8
|
-
|
|
9
|
-
## Import
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
import { paymentSettings } from '@wix/ecom/service-plugins';
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Handler
|
|
16
|
-
|
|
17
|
-
| Handler | Description |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
| `getPaymentSettings` | Return payment settings to apply during the payment process |
|
|
5
|
+
The Payment Settings SPI lets you integrate custom payment settings with the Wix eCommerce payment process. It's called during payment processing (e.g., when a customer enters credit card details) and returns settings that Wix passes to the payment provider. A common use case is enforcing 3D Secure (3DS) for certain transactions. Implement the `getPaymentSettings` handler.
|
|
20
6
|
|
|
21
7
|
## Request and Response Schema
|
|
22
8
|
|
|
23
|
-
Before implementing, call `ReadFullDocsMethodSchema`
|
|
24
|
-
|
|
25
|
-
**MCP Tools to use:**
|
|
26
|
-
- `ReadFullDocsMethodSchema` - Full request/response schema with field names, types, and descriptions
|
|
27
|
-
- `ReadFullDocsArticle` - Full documentation with code examples (use if schema needs more context)
|
|
9
|
+
Before implementing, call `ReadFullDocsMethodSchema` on the docs URL to get the full request/response types.
|
|
28
10
|
|
|
29
11
|
| Handler | Docs URL |
|
|
30
12
|
| --- | --- |
|
|
@@ -113,23 +95,3 @@ paymentSettings.provideHandlers({
|
|
|
113
95
|
5. **Fallback configuration** - Use the `fallbackValueForRequires3dSecure` builder field to set a default value if the SPI call fails (defaults to `false`)
|
|
114
96
|
6. **Handle errors gracefully** - Return sensible defaults on error rather than throwing
|
|
115
97
|
|
|
116
|
-
## Extension Registration
|
|
117
|
-
|
|
118
|
-
Register the payment settings provider using the `ecomPaymentSettings()` builder. This builder accepts a special `fallbackValueForRequires3dSecure` field:
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
import { extensions } from "@wix/astro/builders";
|
|
122
|
-
|
|
123
|
-
export const paymentSettings = extensions.ecomPaymentSettings({
|
|
124
|
-
id: "{{GENERATE_UUID}}",
|
|
125
|
-
name: "Custom Payment Settings",
|
|
126
|
-
source: "./backend/service-plugins/ecom-payment-settings/my-payment-settings/plugin.ts",
|
|
127
|
-
fallbackValueForRequires3dSecure: false, // Default if SPI call fails
|
|
128
|
-
});
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Additional Builder Fields
|
|
132
|
-
|
|
133
|
-
| Field | Type | Required | Description |
|
|
134
|
-
| --- | --- | --- | --- |
|
|
135
|
-
| `fallbackValueForRequires3dSecure` | boolean | No | Default value for `requires3dSecure` if the SPI call fails (defaults to `false`) |
|
|
@@ -2,28 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
The Shipping Rates SPI
|
|
6
|
-
|
|
7
|
-
## Import
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
import { shippingRates } from "@wix/ecom/service-plugins";
|
|
11
|
-
import { ChargeType } from "@wix/auto_sdk_ecom_shipping-rates";
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Handler
|
|
15
|
-
|
|
16
|
-
| Handler | Description |
|
|
17
|
-
| --- | --- |
|
|
18
|
-
| `getShippingRates` | Calculate and return available shipping options with costs |
|
|
5
|
+
The Shipping Rates SPI lets you provide custom shipping options and calculate shipping costs based on order details, destination, weight, or any custom logic. Implement the `getShippingRates` handler — it returns the available shipping options with their costs.
|
|
19
6
|
|
|
20
7
|
## Request and Response Schema
|
|
21
8
|
|
|
22
|
-
Before implementing, call `ReadFullDocsMethodSchema`
|
|
23
|
-
|
|
24
|
-
**MCP Tools to use:**
|
|
25
|
-
- `ReadFullDocsMethodSchema` - Full request/response schema with field names, types, and descriptions
|
|
26
|
-
- `ReadFullDocsArticle` - Full documentation with code examples (use if schema needs more context)
|
|
9
|
+
Before implementing, call `ReadFullDocsMethodSchema` on the docs URL to get the full request/response types.
|
|
27
10
|
|
|
28
11
|
| Handler | Docs URL |
|
|
29
12
|
| --- | --- |
|