@wix/agent-skills 1.16.0 → 1.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +72 -8
- package/skills/wix-app/references/CODE_QUALITY.md +0 -1
- package/skills/wix-app/references/DASHBOARD_MODAL.md +21 -14
- package/skills/wix-app/references/DASHBOARD_PAGE.md +30 -184
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +19 -3
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +172 -0
- package/skills/wix-app/references/dashboard-page/WDS_LAYOUT.md +187 -0
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +12 -7
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +31 -2
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +6 -1
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +60 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +6 -6
- package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -2
- package/skills/wix-app/references/editor-react-component/SITE-CONTEXT-HOOKS.md +187 -0
- package/skills/wix-app/scripts/scan-a11y-code.cjs +777 -0
- package/skills/wix-app/scripts/scan-a11y-eslint.cjs +201 -0
- package/skills/wix-base44-connector/SKILL.md +185 -0
- package/skills/wix-base44-connector/scripts/utils.js +212 -0
- package/skills/wix-design-system/SKILL.md +19 -15
- package/skills/wix-docs/SKILL.md +75 -1
- package/skills/wix-headless/references/CAPABILITIES.md +16 -3
- package/skills/wix-headless/references/SDK_HANDOFF.md +1 -1
- package/skills/wix-headless/references/SEED.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +560 -102
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +210 -143
- package/skills/wix-manage/SKILL.md +20 -17
- package/skills/wix-manage/references/accessibility/scan-site-accessibility.md +98 -0
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +1 -2
- package/skills/wix-manage/references/domains/domain-search-purchase-and-connect.md +2603 -0
- package/skills/wix-manage/references/events/create-wix-event.md +112 -90
- package/skills/wix-manage/references/events/manage-wix-events.md +33 -94
- package/skills/wix-manage/references/sites/create-headless-site.md +1 -0
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +154 -0
- package/skills/wix-manage/references/sites/read-site-context.md +125 -0
- package/skills/wix-manage/references/sites/site-import.md +67 -15
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +273 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +1 -1
- package/skills/wix-vibe-headless/SKILL.md +2 -1
- package/skills/wix-vibe-headless/install/deploy.cjs +63 -3
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +104 -0
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +74 -0
- package/skills/wix-vibe-headless/platforms/base44.md +15 -40
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/blog/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +1 -2
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +7 -12
- package/skills/wix-vibe-headless/references/events/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +7 -11
- package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +1 -1
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +5 -3
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +75 -13
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +29 -86
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +3 -8
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +78 -105
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +92 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useVariantOptions.js +76 -0
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +44 -5
- package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +0 -326
- package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +0 -115
- package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +0 -264
- package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +0 -37
- package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +0 -86
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +0 -119
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +0 -103
- package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +0 -76
- package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +0 -82
- package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +0 -89
- package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +0 -124
- package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +0 -91
- package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +0 -71
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +0 -70
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +0 -73
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +0 -98
- package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +0 -278
- package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +0 -94
- package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +0 -43
- package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +0 -66
- package/skills/wix-app/references/auto-patterns-dashboard/views.md +0 -76
- package/skills/wix-app/scripts/generate-auto-patterns.js +0 -510
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +0 -437
- package/skills/wix-manage/references/stores/create-product-from-image.md +0 -1031
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +0 -623
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +0 -106
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
# Auto Patterns Dashboard Page
|
|
2
|
-
|
|
3
|
-
Generates declarative `patterns.json` + a thin page component (`<page-name>.tsx`) for simple CRUD dashboard pages using `@wix/auto-patterns`. Supports both creating new pages and updating existing ones.
|
|
4
|
-
|
|
5
|
-
## Quick Start Checklist
|
|
6
|
-
|
|
7
|
-
- [ ] **Step 1:** Determine if this is a new page or update to existing
|
|
8
|
-
- [ ] **Step 2:** For new pages — scaffold via `wix generate`, generate schema, run generator script
|
|
9
|
-
- [ ] **Step 2 (alt):** For existing pages — read `patterns.json`, consult references, edit directly
|
|
10
|
-
- [ ] **Step 3:** Install dependencies (`@wix/auto-patterns`, `@wix/patterns`)
|
|
11
|
-
- [ ] **Step 4:** Verify per [APP_VALIDATION.md](APP_VALIDATION.md)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Required App Permissions
|
|
16
|
-
|
|
17
|
-
Auto-patterns calls `@wix/data` at runtime to CRUD the collection. The app must declare these scopes in the Wix Dev Center — they are NOT added automatically:
|
|
18
|
-
|
|
19
|
-
- `SCOPE.DC-DATA.READ` — for `get`, `query`, `count`, `distinct`
|
|
20
|
-
- `SCOPE.DC-DATA.WRITE` — for `insert`, `update`, `save`, `remove`, `bulk*`
|
|
21
|
-
|
|
22
|
-
Add them at: `https://manage.wix.com/apps/{app-id}/dev-center-permissions` (replace `{app-id}` with your app ID).
|
|
23
|
-
|
|
24
|
-
Without these scopes, the dashboard page renders but all data operations fail.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Core Rules
|
|
29
|
-
|
|
30
|
-
### Configuration Generation
|
|
31
|
-
|
|
32
|
-
1. **Analyze** schema requirements.
|
|
33
|
-
2. **Select** fields based on data types (max 3 initially).
|
|
34
|
-
3. **Validate** against the constraints below.
|
|
35
|
-
|
|
36
|
-
### Enum Handling
|
|
37
|
-
|
|
38
|
-
- **IF** `enumConfig` is required (implicit or explicit):
|
|
39
|
-
- **THEN** ASK user for possible option values.
|
|
40
|
-
- **THEN** Derive `label` from `value` (e.g., "dog" -> "Dog") unless specified.
|
|
41
|
-
- **NEVER** guess or invent enum values.
|
|
42
|
-
|
|
43
|
-
### Structural Limits
|
|
44
|
-
|
|
45
|
-
- **MUST** have exactly 2 pages in `pages` array (`collectionPage` + `entityPage`).
|
|
46
|
-
- **MUST** have exactly 1 component with `layout` array in `collectionPage`.
|
|
47
|
-
- **MUST** use TypeScript for configuration.
|
|
48
|
-
|
|
49
|
-
### Field Selection
|
|
50
|
-
|
|
51
|
-
- **MAX** 3 columns initially for `collectionPage`.
|
|
52
|
-
- **MUST** include `create` action in `collectionPage` navigating to `entityPage`.
|
|
53
|
-
- **NEVER** fill optional fields unless explicitly requested.
|
|
54
|
-
|
|
55
|
-
### Type Binding
|
|
56
|
-
|
|
57
|
-
- **IF** `type: 'collectionPage'` **THEN** only `collectionPage` field allowed.
|
|
58
|
-
- **IF** `type: 'entityPage'` **THEN** only `entityPage` field allowed.
|
|
59
|
-
- **NEVER** mix types in single page config.
|
|
60
|
-
|
|
61
|
-
### Validation
|
|
62
|
-
|
|
63
|
-
- **MUST** align with `AppConfig` structure.
|
|
64
|
-
- **MUST** remove unsupported configuration entries.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Part A: Creating a New Auto-Patterns Page
|
|
69
|
-
|
|
70
|
-
### Step 1: Scaffold the Dashboard Page
|
|
71
|
-
|
|
72
|
-
An auto-patterns page is a dashboard page — scaffold it with the Wix CLI:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
wix generate --params '{"extensionType":"DASHBOARD_PAGE","title":"<title>","route":"<route>"}'
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
The CLI generates the page folder, the component stub `<page-name>.tsx`, the builder file `<page-name>.extension.ts` (which registers the extension and points its `component` at `<page-name>.tsx`), a unique UUID, and the `src/extensions.ts` registration — do NOT hand-write any of these. The folder name comes from `route`. After scaffolding, the page folder looks like this:
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
src/extensions/dashboard/pages/<page-name>/
|
|
82
|
-
├── <page-name>.extension.ts # Builder file (generated — registration + UUID, component → <page-name>.tsx)
|
|
83
|
-
├── <page-name>.tsx # CLI component stub (overwritten in Step 3)
|
|
84
|
-
└── patterns.json # Declarative AppConfig — added in Step 3, edit this to iterate
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
> **Why this matters for Step 3:** the generator writes the auto-patterns wrapper to `<page-name>.tsx` — the SAME file the builder already registers — so it overwrites the stub and is wired up automatically. Do NOT let it produce a separate `page.tsx`; that would leave the wrapper unregistered next to the empty stub, and the dashboard would render blank.
|
|
88
|
-
|
|
89
|
-
### Step 2: Generate the Schema
|
|
90
|
-
|
|
91
|
-
You must produce the input JSON for the generator script. Top-level keys: `collection`, `schema`, `relevantCollectionId`, `extensionName`.
|
|
92
|
-
|
|
93
|
-
**`collection`** (from the data collection you scaffolded):
|
|
94
|
-
|
|
95
|
-
- `idSuffix` — the collection's short ID
|
|
96
|
-
- `fields` — array of `{ key, displayName, type }` (types: TEXT, NUMBER, BOOLEAN, DATE, IMAGE, URL, RICH_TEXT, etc.)
|
|
97
|
-
|
|
98
|
-
**`relevantCollectionId`** (top-level, sibling to `collection` and `schema`) — full scoped collection ID (e.g., `@namespace/my-collection`)
|
|
99
|
-
|
|
100
|
-
**`schema.content`** — 20 string fields you generate:
|
|
101
|
-
|
|
102
|
-
- `collectionRouteId` — URL-friendly collection ID (kebab-case, e.g., "cool-gadgets")
|
|
103
|
-
- `singularEntityName` — URL-friendly singular form (e.g., "cool-gadget")
|
|
104
|
-
- `pageTitle` — Main page title (e.g., "Cool Gadgets Collection")
|
|
105
|
-
- `pageSubtitle` — Page description
|
|
106
|
-
- `actionButtonLabel` — Primary create button (e.g., "Add New Gadget")
|
|
107
|
-
- `toolbarTitle` — Table toolbar title
|
|
108
|
-
- `toolbarSubtitle` — Table toolbar subtitle
|
|
109
|
-
- `emptyStateTitle` — Title when no items exist
|
|
110
|
-
- `emptyStateSubtitle` — Empty state description
|
|
111
|
-
- `emptyStateButtonText` — Empty state CTA button text
|
|
112
|
-
- `deleteModalTitle` — Delete confirmation title
|
|
113
|
-
- `deleteModalDescription` — Delete confirmation description
|
|
114
|
-
- `deleteSuccessToast` — Delete success message
|
|
115
|
-
- `deleteErrorToast` — Delete error message
|
|
116
|
-
- `bulkDeleteModalTitle` — Bulk delete title
|
|
117
|
-
- `bulkDeleteModalDescription` — Bulk delete description
|
|
118
|
-
- `bulkDeleteSuccessToast` — Bulk delete success
|
|
119
|
-
- `bulkDeleteErrorToast` — Bulk delete error
|
|
120
|
-
- `entityPageTitle` — Entity detail page title
|
|
121
|
-
- `entityPageSubtitle` — Entity detail page subtitle
|
|
122
|
-
|
|
123
|
-
**`schema.layout`** — organize ALL collection fields into sections:
|
|
124
|
-
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"main": [
|
|
128
|
-
{
|
|
129
|
-
"title": "Basic Info",
|
|
130
|
-
"subtitle": "Core details",
|
|
131
|
-
"fields": ["field1", "field2"]
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
"sidebar": [
|
|
135
|
-
{ "title": "Status", "subtitle": "Metadata", "fields": ["isActive"] }
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Rules: Every field must appear exactly once. Main = user-facing content. Sidebar = metadata/status. If there are no sidebar-worthy fields, use `"sidebar": []`.
|
|
141
|
-
|
|
142
|
-
**`schema.columns`** — ordered list for the table view:
|
|
143
|
-
|
|
144
|
-
```json
|
|
145
|
-
[{ "id": "fieldKey", "displayName": "Short Name" }]
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Include ALL fields, primary identifiers first. Display names target ≤10 characters.
|
|
149
|
-
|
|
150
|
-
**`schema.gridItem`** (only if IMAGE fields exist, otherwise `null`):
|
|
151
|
-
|
|
152
|
-
```json
|
|
153
|
-
{
|
|
154
|
-
"titleFieldId": "name",
|
|
155
|
-
"subtitleFieldId": "category",
|
|
156
|
-
"imageFieldId": "photo"
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
> **🛑 Nesting is required.** Content, layout, columns, and gridItem are **not** top-level keys and **not** flat siblings under `schema`. The generator rejects flat shapes like `"schema": { "collectionRouteId": "...", "main": [...] }`. Always nest as `"schema": { "content": {...}, "layout": {...}, "columns": [...], "gridItem": null }`.
|
|
161
|
-
|
|
162
|
-
### Step 3: Run the Generator Script
|
|
163
|
-
|
|
164
|
-
The generator script is bundled with this skill at `<SKILL_ROOT>/scripts/generate-auto-patterns.js` — it is **not** copied into the user's app repo. Run it from the project directory using the skill's absolute path (`<SKILL_ROOT>` is the folder containing this skill's `SKILL.md`).
|
|
165
|
-
|
|
166
|
-
Write the input JSON to a temp file and run the script, pointing `--output` at the folder the CLI scaffolded in Step 1:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
# Write input to temp file
|
|
170
|
-
cat > /tmp/auto-patterns-input.json << 'EOF'
|
|
171
|
-
{
|
|
172
|
-
"collection": {
|
|
173
|
-
"idSuffix": "<collection-id>",
|
|
174
|
-
"fields": [
|
|
175
|
-
{ "key": "<field-key>", "displayName": "<Field Label>", "type": "<TYPE>" }
|
|
176
|
-
]
|
|
177
|
-
},
|
|
178
|
-
"schema": {
|
|
179
|
-
"content": {
|
|
180
|
-
"collectionRouteId": "<collection-route-id>",
|
|
181
|
-
"singularEntityName": "<singular-entity-name>",
|
|
182
|
-
"pageTitle": "<Page Title>",
|
|
183
|
-
"pageSubtitle": "<Page subtitle>",
|
|
184
|
-
"actionButtonLabel": "<Create button label>",
|
|
185
|
-
"toolbarTitle": "<Toolbar title>",
|
|
186
|
-
"toolbarSubtitle": "<Toolbar subtitle>",
|
|
187
|
-
"emptyStateTitle": "<Empty state title>",
|
|
188
|
-
"emptyStateSubtitle": "<Empty state subtitle>",
|
|
189
|
-
"emptyStateButtonText": "<Empty state button>",
|
|
190
|
-
"deleteModalTitle": "<Delete modal title>",
|
|
191
|
-
"deleteModalDescription": "<Delete modal description>",
|
|
192
|
-
"deleteSuccessToast": "<Delete success toast>",
|
|
193
|
-
"deleteErrorToast": "<Delete error toast>",
|
|
194
|
-
"bulkDeleteModalTitle": "<Bulk delete modal title>",
|
|
195
|
-
"bulkDeleteModalDescription": "<Bulk delete modal description>",
|
|
196
|
-
"bulkDeleteSuccessToast": "<Bulk delete success toast>",
|
|
197
|
-
"bulkDeleteErrorToast": "<Bulk delete error toast>",
|
|
198
|
-
"entityPageTitle": "<Entity page title>",
|
|
199
|
-
"entityPageSubtitle": "<Entity page subtitle>"
|
|
200
|
-
},
|
|
201
|
-
"layout": {
|
|
202
|
-
"main": [
|
|
203
|
-
{
|
|
204
|
-
"title": "<Section title>",
|
|
205
|
-
"subtitle": "<Section subtitle>",
|
|
206
|
-
"fields": ["<field-key>"]
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
"sidebar": []
|
|
210
|
-
},
|
|
211
|
-
"columns": [
|
|
212
|
-
{ "id": "<field-key>", "displayName": "<Short Name>" }
|
|
213
|
-
],
|
|
214
|
-
"gridItem": null
|
|
215
|
-
},
|
|
216
|
-
"relevantCollectionId": "@<namespace>/<collection-id>",
|
|
217
|
-
"extensionName": "<Extension Name>"
|
|
218
|
-
}
|
|
219
|
-
EOF
|
|
220
|
-
|
|
221
|
-
# Run generator
|
|
222
|
-
node <SKILL_ROOT>/scripts/generate-auto-patterns.js --input /tmp/auto-patterns-input.json --output ./src/extensions/dashboard/pages/<page-name>/
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
The `--output` directory MUST be the exact folder the CLI scaffolded in Step 1 — the script derives the component filename from that folder's name.
|
|
226
|
-
|
|
227
|
-
The script produces:
|
|
228
|
-
|
|
229
|
-
- `patterns.json` — The declarative AppConfig
|
|
230
|
-
- `<page-name>.tsx` — Thin React wrapper component, written to the SAME filename the CLI scaffolded and the builder already registers (overwrites the stub)
|
|
231
|
-
|
|
232
|
-
The builder file (`<page-name>.extension.ts`) and `src/extensions.ts` registration from Step 1 stay as-is — no manual registration edit, and no stray `page.tsx`.
|
|
233
|
-
|
|
234
|
-
### Step 4: Install Dependencies
|
|
235
|
-
|
|
236
|
-
The CLI template pins `@wix/auto-patterns` and `@wix/patterns` to exact versions — keep it that way. Check `package.json` first: if both are already in `dependencies`, **skip this step**.
|
|
237
|
-
|
|
238
|
-
If one is missing, install only that package:
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
npm install --save-exact <missing-package>
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### Step 5: Validate
|
|
245
|
-
|
|
246
|
-
Run validation per [APP_VALIDATION.md](APP_VALIDATION.md) to verify TypeScript compilation and build.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## Part B: Updating an Existing Auto-Patterns Page
|
|
251
|
-
|
|
252
|
-
> **🛑 STOP — UI changes go through overrides, NOT page-component edits.**
|
|
253
|
-
> If you're adding a banner, custom header, action, slot, custom column rendering, or row sectioning to an auto-patterns page, you MUST use the matching `custom-*-override.md` reference (see the topic index in Step 2). Do NOT add the UI by hand-writing JSX in the page component (`<page-name>.tsx`) — that bypasses the override registration and breaks the iteration model.
|
|
254
|
-
|
|
255
|
-
When `patterns.json` already exists in a page directory, edit it directly. **This is the iteration model**: changes to layout, columns, actions, and content are made by editing JSON — the page component (`<page-name>.tsx`) only changes to register new overrides. No React rewrite, no rebuild of CRUD logic.
|
|
256
|
-
|
|
257
|
-
> **Component filename:** the page component is `<page-name>.tsx` (the file the CLI scaffolded and the `<page-name>.extension.ts` builder registers). The override reference files below say "`page.tsx`" as shorthand for this component — edit the existing `<page-name>.tsx`; **never create a new `page.tsx`**, or it will sit unregistered next to the real component.
|
|
258
|
-
|
|
259
|
-
### Step 1: Read the Existing Config
|
|
260
|
-
|
|
261
|
-
Read the current `patterns.json` to understand the configuration structure.
|
|
262
|
-
|
|
263
|
-
### Step 2: Consult Reference Documentation
|
|
264
|
-
|
|
265
|
-
Use the topic index below to find the right reference file for your change:
|
|
266
|
-
|
|
267
|
-
| Topic | Keywords | Reference File |
|
|
268
|
-
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
269
|
-
| AppConfig structure, page types, component types, page.tsx template | AppConfig, PageConfig, CollectionPageConfig, EntityPageConfig | [app-config-structure.md](auto-patterns-dashboard/app-config-structure.md) |
|
|
270
|
-
| Page setup, relationships, routing, URL configuration, sticky columns | page relationships, routing, entityPageId, parentPageId, route parameters | [pages-configuration.md](auto-patterns-dashboard/pages-configuration.md) |
|
|
271
|
-
| Collection page components, table/grid layouts, column configuration | table/grid configuration, columns, customColumns, view switching | [collection-page.md](auto-patterns-dashboard/collection-page.md) |
|
|
272
|
-
| Views configuration, presets, categories, filters integration | views, presets, categories, columnPreferences, filters, default view | [views.md](auto-patterns-dashboard/views.md) |
|
|
273
|
-
| Page-level actions, create actions, custom collection actions, row click actions | primaryActions, secondaryActions, onRowClick, action menus | [collection-page-actions.md](auto-patterns-dashboard/collection-page-actions.md) |
|
|
274
|
-
| Row-level actions, update/delete actions, custom row actions | actionCell, edit, delete, inline actions, custom resolver | [action-cell.md](auto-patterns-dashboard/action-cell.md) |
|
|
275
|
-
| Bulk operations, bulk delete, bulk action toolbar | bulk delete, multi-select actions, bulkActionToolbar | [bulk-actions.md](auto-patterns-dashboard/bulk-actions.md) |
|
|
276
|
-
| Entity page layout, grid system, field layout, containers | entity page layout, grid system, column spans, main/sidebar, 12-column grid | [entity-page.md](auto-patterns-dashboard/entity-page.md) |
|
|
277
|
-
| Entity page edit mode actions, moreActions, custom entity actions | edit mode actions, moreActions, duplicate, clone | [entity-page-actions.md](auto-patterns-dashboard/entity-page-actions.md) |
|
|
278
|
-
| Entity page view mode actions, primaryActions, secondaryActions | view mode actions, read-only entity actions, navigation actions | [entity-page-view-actions.md](auto-patterns-dashboard/entity-page-view-actions.md) |
|
|
279
|
-
| ResolvedAction interface, common return type for custom actions | ResolvedAction, label, icon, onClick, disabled, hidden, tooltip, skin | [resolved-action.md](auto-patterns-dashboard/resolved-action.md) |
|
|
280
|
-
| AppContext hook, shared collection data, refresh functionality | useAppContext, items, refreshCollection | [app-context.md](auto-patterns-dashboard/app-context.md) |
|
|
281
|
-
| SDK utilities, optimistic actions, schema access | AutoPatternsSDK, optimisticActions, getSchema, createOne, updateOne, deleteOne | [sdk-utilities.md](auto-patterns-dashboard/sdk-utilities.md) |
|
|
282
|
-
| Custom action resolvers, action overrides, useActions hook | custom actions, action resolver, useActions, ResolvedAction | [custom-actions-override.md](auto-patterns-dashboard/custom-actions-override.md) |
|
|
283
|
-
| Column rendering overrides, IColumnValue, custom column display | column override, IColumnValue, useColumns, custom rendering | [custom-columns-override.md](auto-patterns-dashboard/custom-columns-override.md) |
|
|
284
|
-
| Custom form components, useController, entity page customization | custom components, useComponents, useController, form, entity | [custom-components-override.md](auto-patterns-dashboard/custom-components-override.md) |
|
|
285
|
-
| Entity page header, dynamic subtitle, dynamic badges | header override, subtitle, badges, entityPageHeaderSubtitle, entityPageHeaderBadges | [custom-header-override.md](auto-patterns-dashboard/custom-header-override.md) |
|
|
286
|
-
| Table row grouping, section headers, section renderer | sections, grouping, useSections, section renderer, row grouping | [custom-sections-override.md](auto-patterns-dashboard/custom-sections-override.md) |
|
|
287
|
-
| Custom slot components, page slots, banners, informational sections | slots, useSlots, banner, custom content, top section | [custom-slots-override.md](auto-patterns-dashboard/custom-slots-override.md) |
|
|
288
|
-
|
|
289
|
-
### Step 3: Make Targeted Edits
|
|
290
|
-
|
|
291
|
-
Edit `patterns.json` based on the user's request. Key constraints:
|
|
292
|
-
|
|
293
|
-
- **Always 2 pages** — one `collectionPage` + one `entityPage`
|
|
294
|
-
- **Bidirectional linking** — `entityPageId` in collection component ↔ `parentPageId` in entity page
|
|
295
|
-
- **Max 3 columns initially** for new table views
|
|
296
|
-
- **`biName` is mandatory** for every action (kebab-case: `{action-purpose}-action`)
|
|
297
|
-
- **`customColumns.enabled: true`** when > 5 columns
|
|
298
|
-
- **Grid item only if IMAGE fields exist**
|
|
299
|
-
- **Route format**: entity page must be `/[segment]/:entityId`
|
|
300
|
-
- **Exactly 1 `appMainPage: true`** across all pages
|
|
301
|
-
|
|
302
|
-
If adding custom overrides (actions, columns, components, slots, etc.):
|
|
303
|
-
|
|
304
|
-
1. Create the override files in the appropriate `components/` subfolder
|
|
305
|
-
2. Update the page component (`<page-name>.tsx`) to register overrides via `PatternsWizardOverridesProvider`
|
|
306
|
-
3. See the `custom-*-override.md` reference files for implementation patterns
|
|
307
|
-
|
|
308
|
-
> **🛑 Overrides ALWAYS go in their own file under `components/<type>/`** (e.g. `components/columns/status.tsx`) with a `use*` hook — **regardless of size, even for a single small override.** This is structural, required by the override-registration model. **Never inline override render logic in the page component** (`<page-name>.tsx`), and do NOT apply the general ~300-line "split only if large" rule here — it does not override this requirement.
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
## Non-Matching Intents
|
|
313
|
-
|
|
314
|
-
Do NOT use this skill when:
|
|
315
|
-
|
|
316
|
-
- User needs multi-collection data display → see [DASHBOARD_PAGE.md](DASHBOARD_PAGE.md)
|
|
317
|
-
- User needs embedded script configuration → see [DASHBOARD_PAGE.md](DASHBOARD_PAGE.md)
|
|
318
|
-
- User needs custom business logic or external APIs → see [DASHBOARD_PAGE.md](DASHBOARD_PAGE.md)
|
|
319
|
-
- User needs a modal/popup → see [DASHBOARD_MODAL.md](DASHBOARD_MODAL.md)
|
|
320
|
-
- User needs backend endpoints → see [BACKEND_API.md](BACKEND_API.md)
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
## Example patterns.json
|
|
325
|
-
|
|
326
|
-
See [auto-patterns-dashboard/example-patterns.json](auto-patterns-dashboard/example-patterns.json) for a complete working example.
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# ActionCell Rules
|
|
2
|
-
|
|
3
|
-
## Type Definitions
|
|
4
|
-
```typescript
|
|
5
|
-
interface ActionCellConfig {
|
|
6
|
-
primaryAction?: SinglePrimary | MultiplePrimary;
|
|
7
|
-
secondaryActions?: {
|
|
8
|
-
items: (ActionCellItem | DividerItem)[];
|
|
9
|
-
inlineCount?: number;
|
|
10
|
-
inlineAlwaysVisible?: boolean;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface SinglePrimary {
|
|
15
|
-
item: ActionCellItem;
|
|
16
|
-
alwaysVisible?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface MultiplePrimary {
|
|
20
|
-
items: ActionCellItem[];
|
|
21
|
-
alwaysVisible?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface ActionCellItem {
|
|
25
|
-
id: string; // Matches resolver if custom
|
|
26
|
-
type: 'update' | 'delete' | 'custom';
|
|
27
|
-
label?: string;
|
|
28
|
-
biName: string; // MANDATORY
|
|
29
|
-
skin?: 'standard' | 'inverted' | 'premium' | 'dark' | 'destructive';
|
|
30
|
-
update?: { mode: 'page'; page: { id: string } };
|
|
31
|
-
delete?: { mode: 'modal'; modal: ModalConfig };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface DividerItem {
|
|
35
|
-
type: 'divider';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Primary cell action resolver — primary actions don't accept `icon`; use `prefixIcon`/`suffixIcon`.
|
|
39
|
-
type CustomActionCellPrimaryActionResolver = (params: {
|
|
40
|
-
actionParams: { item: any };
|
|
41
|
-
sdk: AutoPatternsSDK;
|
|
42
|
-
}) => ResolvedActionCellPrimaryAction;
|
|
43
|
-
// ResolvedActionCellPrimaryAction = Omit<ResolvedAction, 'icon'> & { prefixIcon?: IconElement; suffixIcon?: IconElement }
|
|
44
|
-
|
|
45
|
-
// Secondary cell action resolver — uses standard ResolvedAction (with `icon`).
|
|
46
|
-
type CustomActionCellSecondaryActionResolver = (params: {
|
|
47
|
-
actionParams: { item: any };
|
|
48
|
-
sdk: AutoPatternsSDK;
|
|
49
|
-
}) => ResolvedAction;
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Validation Logic
|
|
53
|
-
- **IF** `type: 'update'` **THEN** `update` config with `page.id` is **REQUIRED**.
|
|
54
|
-
- **IF** `type: 'delete'` **THEN** `delete.mode: 'modal'` is **REQUIRED**.
|
|
55
|
-
- **IF** `type: 'custom'` **THEN** resolver implementation is **REQUIRED**.
|
|
56
|
-
- **IF** `type: 'custom'` **THEN** resolver MUST be registered via override pattern (see **custom_actions_override**).
|
|
57
|
-
- **IF** using `secondaryActions.inlineCount` **THEN** value MUST be <= items count.
|
|
58
|
-
|
|
59
|
-
## Implementation Rules
|
|
60
|
-
- **MUST** include `biName` for every action (`{action-purpose}-action`).
|
|
61
|
-
- **MUST** place `actionCell` at component level (sibling to `collection`), NOT inside `table`/`grid`.
|
|
62
|
-
- **MUST** implement custom resolvers using `CustomActionCellPrimaryActionResolver` (for primary actions) or `CustomActionCellSecondaryActionResolver` (for secondary actions).
|
|
63
|
-
- **MUST** use `errorHandler` for Wix API calls in resolvers.
|
|
64
|
-
- **SHOULD** use `multiplePrimary` for 2-3 equally important actions.
|
|
65
|
-
- **NEVER** use `primaryAction` inside `secondaryActions`.
|
|
66
|
-
- **NEVER** use `actionResolvers` prop on `AutoPatternsApp` - this prop does not exist.
|
|
67
|
-
- **NEVER** create resolver files outside `components/actions/` folder.
|
|
68
|
-
|
|
69
|
-
## Canonical Example
|
|
70
|
-
```typescript
|
|
71
|
-
// Config
|
|
72
|
-
actionCell: {
|
|
73
|
-
primaryAction: {
|
|
74
|
-
item: {
|
|
75
|
-
id: 'editItem',
|
|
76
|
-
type: 'update',
|
|
77
|
-
label: 'Edit',
|
|
78
|
-
biName: 'edit-action',
|
|
79
|
-
skin: 'standard',
|
|
80
|
-
update: { mode: 'page', page: { id: 'edit-page' } }
|
|
81
|
-
},
|
|
82
|
-
alwaysVisible: true
|
|
83
|
-
},
|
|
84
|
-
secondaryActions: {
|
|
85
|
-
items: [
|
|
86
|
-
{
|
|
87
|
-
id: 'deleteItem',
|
|
88
|
-
type: 'delete',
|
|
89
|
-
label: 'Delete',
|
|
90
|
-
biName: 'delete-action',
|
|
91
|
-
skin: 'destructive',
|
|
92
|
-
delete: { mode: 'modal', modal: {} }
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Resolvers (if custom) - see custom_actions_override for full registration pattern
|
|
99
|
-
|
|
100
|
-
// Primary action resolver: use prefixIcon (icon is not allowed on primary cell actions)
|
|
101
|
-
export const myPrimaryAction: CustomActionCellPrimaryActionResolver = ({ actionParams }) => ({
|
|
102
|
-
label: 'Custom',
|
|
103
|
-
prefixIcon: <MyIcon />,
|
|
104
|
-
biName: 'custom-action',
|
|
105
|
-
onClick: () => console.log(actionParams.item)
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// Secondary action resolver: uses icon
|
|
109
|
-
export const mySecondaryAction: CustomActionCellSecondaryActionResolver = ({ actionParams }) => ({
|
|
110
|
-
label: 'Custom',
|
|
111
|
-
icon: <MyIcon />,
|
|
112
|
-
biName: 'custom-action',
|
|
113
|
-
onClick: () => console.log(actionParams.item)
|
|
114
|
-
});
|
|
115
|
-
```
|