@wix/agent-skills 1.16.3 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +134 -127
- package/skills/wix-app/references/SITE_PLUGIN.md +2 -2
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +2 -2
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +182 -99
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +92 -48
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +15 -6
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +275 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-PREVIEW.md +29 -42
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +153 -449
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +53 -29
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +53 -158
- package/skills/wix-app/references/editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md +78 -0
- package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +42 -134
- package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +11 -3
- package/skills/wix-app/references/editor-react-component/PARTS.md +46 -24
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +63 -179
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +79 -163
- package/skills/wix-app/references/editor-react-component/SITE-CONTEXT-HOOKS.md +36 -21
- package/skills/wix-app/references/editor-react-component/SSR.md +30 -99
- package/skills/wix-base44-connector/SKILL.md +34 -17
- package/skills/wix-base44-connector/scripts/utils.js +33 -25
- package/skills/wix-headless/entry/bootstrap.mjs +9 -2
- package/skills/wix-headless/references/SDK_HANDOFF.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +42 -23
- package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +10 -8
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +27 -24
- package/skills/wix-headless/references/managed/AUTHENTICATION.md +5 -0
- package/skills/wix-manage/SKILL.md +11 -1
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +20 -13
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +24 -11
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +5 -5
- package/skills/wix-manage/references/seo/manage-seo-tags.md +315 -0
- package/skills/wix-manage/references/seo/manage-url-redirects.md +250 -0
- package/skills/wix-manage/references/sites/query-sites.md +72 -161
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +5 -6
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +13 -9
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +10 -7
- package/skills/wix-vibe-headless/platforms/base44.md +13 -10
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +2 -0
- package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +9 -8
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +4 -1
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +23 -11
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +1 -1
- package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +29 -31
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +15 -8
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +37 -38
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +2 -2
- package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +35 -35
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +0 -172
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +0 -143
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +0 -516
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +0 -225
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +0 -6
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +0 -95
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
# Component Configuration
|
|
2
|
-
|
|
3
|
-
After scaffolding the component and running `npx wix build && npx wix generate manifest`,
|
|
4
|
-
configure the component's behavior in the editor by writing **partial
|
|
5
|
-
manifest overrides** in the component's hand-edited extension file
|
|
6
|
-
(`<ComponentName>.extension.ts`). That file imports the auto-generated
|
|
7
|
-
manifest and spreads it; specific fields are overridden inline. Re-running
|
|
8
|
-
this command regenerates each `<ComponentName>.generated.ts`
|
|
9
|
-
companion but never touches the overrides authored in the extension file.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 1. Verifying that height sizing type meets user needs
|
|
14
|
-
|
|
15
|
-
Set `installation.initialSize.height.sizingType` based on whether the
|
|
16
|
-
component's own content decides how tall it is.
|
|
17
|
-
|
|
18
|
-
### Heuristic — one question
|
|
19
|
-
|
|
20
|
-
**Does the component's own content decide how tall it is?**
|
|
21
|
-
|
|
22
|
-
- **Yes — height should grow with text the user types or children they drop inside** → `LAYOUT.SIZING_TYPE.content`. Omit `pixels`.
|
|
23
|
-
- **No — the component is a framed visual** (a graphic, an embedded media surface, a form control with a standard height, an empty placeholder) → `LAYOUT.SIZING_TYPE.pixels`. Provide a `pixels` default that matches its natural visual size.
|
|
24
|
-
|
|
25
|
-
**Tiebreaker:** if a designer would drag a handle to set the height, it's `pixels`. If the height should just fit whatever is inside, it's `content`.
|
|
26
|
-
|
|
27
|
-
### Where to write the override
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import { extensions } from '@wix/astro/builders';
|
|
31
|
-
import { LAYOUT } from '@wix/react-component-schema';
|
|
32
|
-
import { manifest } from './ComponentName.generated';
|
|
33
|
-
|
|
34
|
-
const componentExtension = extensions.editorReactComponent({
|
|
35
|
-
// …other fields…
|
|
36
|
-
installation: {
|
|
37
|
-
initialSize: {
|
|
38
|
-
width: {
|
|
39
|
-
sizingType: LAYOUT.SIZING_TYPE.pixels,
|
|
40
|
-
pixels: 250,
|
|
41
|
-
},
|
|
42
|
-
height: {
|
|
43
|
-
sizingType: LAYOUT.SIZING_TYPE.updateMe,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Examples
|
|
51
|
-
|
|
52
|
-
**Content-driven** (`LAYOUT.SIZING_TYPE.content`) — testimonial card,
|
|
53
|
-
FAQ accordion, pricing tier, blog-post body, list/grid of arbitrary
|
|
54
|
-
children:
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
height: {
|
|
58
|
-
sizingType: LAYOUT.SIZING_TYPE.content,
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Framed visual** (`LAYOUT.SIZING_TYPE.pixels`) — hero banner with a
|
|
63
|
-
fixed image, video embed, color-picker swatch grid, OTP input, empty
|
|
64
|
-
placeholder slot:
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
height: {
|
|
68
|
-
sizingType: LAYOUT.SIZING_TYPE.pixels,
|
|
69
|
-
pixels: 320,
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## 2. Verifying that resize direction meets user needs
|
|
76
|
-
|
|
77
|
-
Set `editorElement.layout.resizeDirection` based on which axes the
|
|
78
|
-
designer should be able to control with a drag handle. Allow an axis
|
|
79
|
-
if dragging it produces a meaningful, intended change. Disallow it if
|
|
80
|
-
dragging would do nothing visible or would break the component's
|
|
81
|
-
identity.
|
|
82
|
-
|
|
83
|
-
### Heuristic — which axes are meaningful?
|
|
84
|
-
|
|
85
|
-
| Choice | When to use |
|
|
86
|
-
|--------|-------------|
|
|
87
|
-
| `horizontalAndVertical` | Content fills or stretches in both axes. Hero, carousel, gallery, card grid, embed, form control, any framed visual. **Default for most components.** |
|
|
88
|
-
| `horizontal` | Height is rigid/intrinsic — cannot meaningfully stretch. Breadcrumb, tag row, nav bar, single-line input, slider rail. |
|
|
89
|
-
| `vertical` | Width is rigid/intrinsic. Vertical stack, ribbon, sidebar rail. |
|
|
90
|
-
| `aspectRatio` | Distortion breaks identity — logo, illustration, animation. |
|
|
91
|
-
| `none` | Size fully owned by a parent layout. Never for top-level components. |
|
|
92
|
-
|
|
93
|
-
**Tiebreaker:** if a drag handle on an axis would feel inert or wrong
|
|
94
|
-
to a designer, take it away.
|
|
95
|
-
|
|
96
|
-
### Where to write the override
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
import { extensions } from '@wix/astro/builders';
|
|
100
|
-
import { LAYOUT } from '@wix/react-component-schema';
|
|
101
|
-
import { manifest } from './ComponentName.generated';
|
|
102
|
-
|
|
103
|
-
const componentExtension = extensions.editorReactComponent({
|
|
104
|
-
// …other fields…
|
|
105
|
-
editorElement: {
|
|
106
|
-
...manifest.editorElement,
|
|
107
|
-
layout: {
|
|
108
|
-
resizeDirection: LAYOUT.RESIZE_DIRECTION._selectedResizeDirection_,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Examples
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
// hero, carousel, gallery, card grid, embed, form
|
|
118
|
-
resizeDirection: LAYOUT.RESIZE_DIRECTION.horizontalAndVertical,
|
|
119
|
-
|
|
120
|
-
// breadcrumb, tag row, nav bar, slider rail
|
|
121
|
-
resizeDirection: LAYOUT.RESIZE_DIRECTION.horizontal,
|
|
122
|
-
|
|
123
|
-
// logo, illustration, animation
|
|
124
|
-
resizeDirection: LAYOUT.RESIZE_DIRECTION.aspectRatio,
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## 3. Wiring defaults into the manifest
|
|
130
|
-
|
|
131
|
-
1. **Define and export `defaultProps` from `<componentName>.props.ts`** — this is the single source of truth used by both `component.tsx` and the extension file.
|
|
132
|
-
2. **Import `componentUrl` from `'./component.tsx?url'`** (the wrapped component), not from `'./ComponentName.tsx?url'` (the raw component).
|
|
133
|
-
3. **Wrap `editorElement` with `withEditorElementDefaults`** using the same `defaultProps`.
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
import { withEditorElementDefaults } from '@wix/react-component-utils';
|
|
137
|
-
import componentUrl from './component.tsx?url';
|
|
138
|
-
import { defaultProps } from './<componentName>.props';
|
|
139
|
-
|
|
140
|
-
// in the extension:
|
|
141
|
-
editorElement: withEditorElementDefaults({
|
|
142
|
-
...manifest.editorElement,
|
|
143
|
-
}, defaultProps),
|
|
144
|
-
resources: {
|
|
145
|
-
...manifest.resources,
|
|
146
|
-
client: { componentUrl },
|
|
147
|
-
},
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## 4. Enabling automatic installation on Harmony editor
|
|
153
|
-
|
|
154
|
-
**Always include `"staticContainer": "HOMEPAGE"`** in `installation` so the
|
|
155
|
-
component is automatically installed on the Harmony editor.
|
|
156
|
-
|
|
157
|
-
```ts
|
|
158
|
-
const componentExtension = extensions.editorReactComponent({
|
|
159
|
-
// …other fields…
|
|
160
|
-
installation: {
|
|
161
|
-
// …other fields…
|
|
162
|
-
staticContainer: 'HOMEPAGE',
|
|
163
|
-
},
|
|
164
|
-
});
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## 5. Adding range constraints for numeric props
|
|
170
|
-
|
|
171
|
-
The zero-config pipeline reads `@min` and `@max` JSDoc tags on numeric props and
|
|
172
|
-
emits them as `number: { min, max }` in the generated manifest. Add these tags
|
|
173
|
-
directly on the prop in the component's props interface — no extension file
|
|
174
|
-
override is needed.
|
|
175
|
-
|
|
176
|
-
### Heuristic — does this number have a fixed domain?
|
|
177
|
-
|
|
178
|
-
| Scenario | Action |
|
|
179
|
-
|----------|--------|
|
|
180
|
-
| Rating 0–5, column count 1–6, items per row 1–4 | Add `@min` / `@max` |
|
|
181
|
-
| Volume 0–100, playback speed 0.5–5, autoplay delay 0.5–30 | Add `@min` / `@max` |
|
|
182
|
-
| Geo coordinates, zoom level | Add `@min` / `@max` |
|
|
183
|
-
| Arbitrary count, free-form price, unconstrained input | Omit — leave as `number` |
|
|
184
|
-
| Semantic index (active tab, active slide, active item) | Omit — upper bound is driven by the component's own item count, not a fixed domain |
|
|
185
|
-
|
|
186
|
-
### How to write the tags
|
|
187
|
-
|
|
188
|
-
Add `@min` and `@max` inline in the JSDoc comment for the prop in `<componentName>.props.ts`:
|
|
189
|
-
|
|
190
|
-
```ts
|
|
191
|
-
export interface RatingWidgetProps {
|
|
192
|
-
/** @min 0 @max 5 */
|
|
193
|
-
rating: number;
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Zero-config picks these up during `npx wix build && npx wix generate manifest`
|
|
198
|
-
and emits:
|
|
199
|
-
|
|
200
|
-
```ts
|
|
201
|
-
rating: {
|
|
202
|
-
dataType: 'number',
|
|
203
|
-
number: { min: '0', max: '5' },
|
|
204
|
-
}
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### Examples
|
|
208
|
-
|
|
209
|
-
```ts
|
|
210
|
-
// Star rating 0–5
|
|
211
|
-
/** @min 0 @max 5 */
|
|
212
|
-
rating: number;
|
|
213
|
-
|
|
214
|
-
// Volume 0–100
|
|
215
|
-
/** @min 0 @max 100 */
|
|
216
|
-
volume: number;
|
|
217
|
-
|
|
218
|
-
// Playback speed 0.5–5
|
|
219
|
-
/** @min 0.5 @max 5 */
|
|
220
|
-
speed: number;
|
|
221
|
-
|
|
222
|
-
// Column count 1–6
|
|
223
|
-
/** @min 1 @max 6 */
|
|
224
|
-
columns: number;
|
|
225
|
-
```
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# React Component Patterns
|
|
2
|
-
|
|
3
|
-
Code patterns and common mistakes for Editor React components.
|
|
4
|
-
|
|
5
|
-
# Part 1: Implementation Patterns
|
|
6
|
-
|
|
7
|
-
## 1.1 SSR-Safe Implementation
|
|
8
|
-
|
|
9
|
-
Avoid browser-only APIs at module scope or during render; use them inside `useEffect` with `typeof window !== 'undefined'`.
|
|
10
|
-
|
|
11
|
-
**❌ Wrong:**
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
const userAgent = window.navigator.userAgent;
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**✅ Correct:**
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (typeof window !== "undefined") {
|
|
22
|
-
const userAgent = window.navigator.userAgent;
|
|
23
|
-
}
|
|
24
|
-
}, []);
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## 1.2 Element Visibility (Platform-Managed)
|
|
28
|
-
|
|
29
|
-
See [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) — element visibility is platform-managed; always render all elements, no conditional rendering.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
# Part 2: CSS/SCSS Rules
|
|
34
|
-
|
|
35
|
-
Authoritative SCSS rules: `REACT-GUIDELINES.md` Part 2. For RTL/logical CSS patterns, see [`DIRECTIONALITY.md`](DIRECTIONALITY.md).
|
|
36
|
-
|
|
37
|
-
## 2.1 What NOT to Include
|
|
38
|
-
|
|
39
|
-
```scss
|
|
40
|
-
// ❌ NEVER include:
|
|
41
|
-
|
|
42
|
-
// Transitions/Animations
|
|
43
|
-
transition: all 0.3s; // ❌
|
|
44
|
-
animation: fadeIn 0.5s; // ❌
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
> Design states (`hover`, `focus`, `selected`, …) are authored per
|
|
48
|
-
> [`DESIGN-STATES.md`](DESIGN-STATES.md).
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
# Part 3: Common Mistakes
|
|
53
|
-
|
|
54
|
-
## 3.1 Custom-state classes
|
|
55
|
-
|
|
56
|
-
For a custom design state, toggle the element's **global** state class from
|
|
57
|
-
its data in JSX (e.g. `isSelected && 'pricing-card-row--selected'`, using the
|
|
58
|
-
component-name-prefixed class) — don't express it as a module-scoped class. State styling lives in [`DESIGN-STATES.md`](DESIGN-STATES.md).
|
|
59
|
-
|
|
60
|
-
## 3.2 Browser APIs at module scope
|
|
61
|
-
|
|
62
|
-
**❌ Wrong:**
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
const isMobile = window.innerWidth < 768; // ❌ SSR breaks
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**✅ Correct:**
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
if (typeof window !== "undefined") {
|
|
73
|
-
setIsMobile(window.innerWidth < 768);
|
|
74
|
-
}
|
|
75
|
-
}, []);
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## 3.3 Use semantic HTML for collection-style UI
|
|
79
|
-
|
|
80
|
-
For lists, breadcrumbs, tabs, menus, and similar collection-style UI, render the underlying semantic HTML directly (`<ol>`/`<ul>` + `<li>`, `<nav>`, `<button role="tab">`, etc.) and own the keyboard / ARIA wiring in your own React code.
|
|
81
|
-
|
|
82
|
-
```tsx
|
|
83
|
-
<ol className="breadcrumbs">
|
|
84
|
-
<li>
|
|
85
|
-
<a href="/">Home</a>
|
|
86
|
-
</li>
|
|
87
|
-
<li>
|
|
88
|
-
<span aria-hidden="true">/</span>
|
|
89
|
-
<a href="/products">Products</a>
|
|
90
|
-
</li>
|
|
91
|
-
</ol>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Handle separators with CSS pseudo-elements or inside each item.
|
|
95
|
-
|