@wix/agent-skills 1.22.0 → 1.24.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.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +12 -4
  3. package/skills/wix-app/references/APP_VALIDATION.md +16 -10
  4. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +64 -50
  5. package/skills/wix-app/references/SDK_MODULE_MAP.md +2 -0
  6. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +1 -1
  7. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +4 -3
  8. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +28 -25
  9. package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +8 -2
  10. package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +12 -14
  11. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +4 -3
  12. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +66 -9
  13. package/skills/wix-app/references/editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md +25 -0
  14. package/skills/wix-app/references/editor-react-component/OVERFLOW.md +146 -0
  15. package/skills/wix-app/references/editor-react-component/PARTS.md +6 -0
  16. package/skills/wix-app/scripts/scan-a11y-eslint.cjs +25 -1
  17. package/skills/{wix-headless-fast → wix-headless-kit}/SKILL.md +96 -50
  18. package/skills/{wix-headless-fast → wix-headless-kit}/cold-start/bootstrap.mjs +2 -2
  19. package/skills/{wix-headless-fast → wix-headless-kit}/cold-start/cold-start.md +26 -31
  20. package/skills/wix-headless-kit/guides/capabilities.md +76 -0
  21. package/skills/{wix-headless-fast → wix-headless-kit}/guides/existing-site.md +3 -1
  22. package/skills/wix-headless-kit/guides/feedback.md +98 -0
  23. package/skills/wix-headless-kit/guides/migration.md +54 -0
  24. package/skills/{wix-headless-fast → wix-headless-kit}/guides/reference-mode.md +4 -1
  25. package/skills/{wix-headless-fast → wix-headless-kit}/install/AGENTS.md +6 -1
  26. package/skills/{wix-headless-fast → wix-headless-kit}/install/agents-md.mjs +5 -1
  27. package/skills/{wix-headless-fast → wix-headless-kit}/install/attach.mjs +14 -1
  28. package/skills/wix-headless-kit/install/check.mjs +87 -0
  29. package/skills/wix-headless-kit/install/context.mjs +169 -0
  30. package/skills/{wix-headless-fast → wix-headless-kit}/install/deploy.mjs +101 -23
  31. package/skills/{wix-headless-fast → wix-headless-kit}/install/setup.mjs +115 -41
  32. package/skills/{wix-headless-fast → wix-headless-kit}/install/templates.mjs +1 -1
  33. package/skills/wix-manage/SKILL.md +3 -3
  34. package/skills/wix-manage/references/app-installation/install-wix-apps.md +68 -2
  35. package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +2 -2
  36. package/skills/wix-manage/references/cms/cms-data-items-crud.md +16 -16
  37. package/skills/wix-manage/references/cms/cms-publishing-flow.md +15 -15
  38. package/skills/wix-manage/references/cms/cms-schema-management.md +6 -6
  39. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +37 -4
  40. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +29 -3
  41. package/skills/wix-manage/references/sites/query-sites.md +1 -8
  42. package/skills/wix-manage/references/sites/site-import.md +101 -37
  43. package/skills/wix-auth/SKILL.md +0 -12
  44. package/skills/wix-auth/references/device-flow.md +0 -140
  45. /package/skills/{wix-headless-fast → wix-headless-kit}/install/lock.mjs +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/agent-skills",
3
- "version": "1.22.0",
3
+ "version": "1.24.0",
4
4
  "description": "Wix Skills for AI coding agents — versioned npm distribution of the wix/skills content.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,8 +28,8 @@ Helps build extensions for Wix CLI applications. Covers all extension types: das
28
28
  - [ ] **Every filter reaches the query**: declared in the collection hook's `filters` and read inside `fetchData`. Filter UI that never narrows the rows is a defect that looks like a feature.
29
29
 
30
30
  A filtered table with no drill-in and no working filters is what gets built when nobody states the requirement — the most common way a generated dashboard disappoints. The aggregate is the judgment call; the drill-in and the filters are not.
31
- - [ ] **🛑 Template-First Gate (MANDATORY, dashboard UI only, comes before writing any shell/provider/router):** Identified which case in [DRAFT_TEMPLATE.md](references/dashboard-page/DRAFT_TEMPLATE.md#which-case-matches-the-request) — A (collection only), B (collection + entity), C (settings only), or D (all three) — matches what Step 2's workflow analysis above just established — then copied and adapted that case's files. Composing the page shell, provider nesting, or router wiring from scratch when a case already shows it is the failure mode this gate exists to prevent — the Patterns/Component Docs gates below are for what the matching case's files don't cover, not a replacement for starting there.
32
- - [ ] **🛑 Patterns Docs Gate (MANDATORY for any dashboard page UI):** Read [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md), then **probe** `dist/docs/index.json` with `grep`/`python3` — never a whole-file `Read`, which truncates it silently. It is the one file that says, per symbol, where to import it from (`importPath`), whether its props live in the doc or in a `.d.ts` (`bundle`), and which worked examples exist (`examples`). Upgrade `@wix/patterns` if that file is missing. Patterns API facts come only from the published `dist/docs/` (pages), `dist/examples/` (worked calls) and `dist/dts-bundle/` (types) trees — never from `src/`, `dist/esm/`, or any other path inside the package, with one named exception: `dist/types/` when a bundle has stubbed the prop you need (WIX_PATTERNS_DOCS.md step 5).
31
+ - [ ] **🛑 Template-First Gate (MANDATORY, dashboard UI only, comes before writing any shell/provider/router):** Identified which case in [DRAFT_TEMPLATE.md](references/dashboard-page/DRAFT_TEMPLATE.md#which-case-matches-the-request) — A (collection only), B (collection + entity), C (settings only), or D (all three) — matches what Step 2's workflow analysis above just established — then copied and adapted that case's files. Composing the page shell, provider nesting, or router wiring from scratch when a case already shows it is the failure mode this gate exists to prevent — the Patterns/Component Docs gates below are for what the matching case's files don't cover, not a replacement for starting there. The reverse holds too: a case replaces composing the shell, never the discovery chain, so every symbol the case doesn't show still goes through the next gate.
32
+ - [ ] **🛑 Patterns Docs Gate (MANDATORY for any dashboard page UI):** Read [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md) **before the first command that touches `node_modules/@wix/patterns`** — its discovery chain (`pkg-root.cjs`, the index, `Composition and Providers.md` once, `Collection Toolkit.md` for which component serves a need) lives only in that file, and this line is a summary of its step 1, not a substitute for opening it. Then **probe** `dist/docs/index.json` with `grep`/`python3` — never a whole-file `Read`, which truncates it silently. It is the one file that says, per symbol, where to import it from (`importPath`), whether its props live in the doc or in a `.d.ts` (`bundle`), and which worked examples exist (`examples`). Upgrade `@wix/patterns` if that file is missing. Patterns API facts come only from the published `dist/docs/` (pages), `dist/examples/` (worked calls) and `dist/dts-bundle/` (types) trees — never from `src/`, `dist/esm/`, or any other path inside the package, with one named exception: `dist/types/` when a bundle has stubbed the prop you need (WIX_PATTERNS_DOCS.md step 5).
33
33
  - [ ] **🛑 Component Docs Gate (MANDATORY, dashboard UI only):** For each patterns symbol you are about to write, decided **from the index** which single artifact answers the question you actually have — `importPath`, `examples`, or `bundle` — and read only that one, per [Component Selection Order](#component-selection-order)'s "the short version". State which artifact you read per symbol, and why, before the first line of JSX. Reading a doc *and* its bundle for the same symbol, or opening a page for an `importPath` the index already gave you, is the failure this gate exists to prevent.
34
34
 
35
35
  For the object `useTableCollection()` returns, read [TABLE_STATE.md](references/dashboard-page/TABLE_STATE.md) — a state object you receive rather than construct, whose members are unobvious and several plausible ones absent.
@@ -226,6 +226,14 @@ Use a Dashboard Modal for dialogs that neither write nor display a listed record
226
226
 
227
227
  Find the entity the user mentioned in the [entity → SDK module map](references/SDK_MODULE_MAP.md) and use that package. If the entity isn't listed or you're unsure, run `SearchWixSDKDocumentation` for it — **never conclude CMS with zero MCP calls**. CMS is only for data your app itself introduces (configuration, rules, app-specific records) that no Wix app manages.
228
228
 
229
+ **SDK types:** access them through the namespace you import, as `<namespace>.<TypeName>`, using any type name shown in the docs — never import a type by name from the `@wix/<pkg>` root.
230
+
231
+ ```ts
232
+ import { orders } from '@wix/ecom';
233
+ const rows: orders.Order[] = []; // ✅
234
+ // import type { Order } from '@wix/ecom'; // ❌ has no exported member 'Order'
235
+ ```
236
+
229
237
  ---
230
238
 
231
239
  ## Data Collection Inference
@@ -440,7 +448,7 @@ Only after validation passes, provide a **concise summary section** at the top o
440
448
  - ✅ Dependencies: [Installed / status message]
441
449
  - ✅ TypeScript: [No compilation errors / status]
442
450
  - ✅ Build: [Completed successfully / status]
443
- - ✅/⚠️ Preview: [Running at URL / Failed - reason]
451
+ - ✅/⚠️ Preview: [Created — Dashboard URL / Failed - reason]
444
452
 
445
453
  **⚠️ IMPORTANT: [X] manual step(s) required to complete setup** (see "Manual Steps Required" section below)
446
454
  ```
@@ -480,7 +488,7 @@ Execute these steps sequentially after all implementation is complete. See [APP_
480
488
  1. **Package Installation** — Detect package manager, run install
481
489
  2. **TypeScript Compilation** — `npx tsc --noEmit -p .`
482
490
  3. **Build** — `npx wix build`
483
- 4. **Preview** — `npx wix preview`
491
+ 4. **Preview** — `npx wix preview`, in the foreground: it uploads, prints the preview URLs and exits on its own, so no `timeout`, backgrounding or `sleep`
484
492
 
485
493
  Stop and report errors if any step fails. Check `.wix/debug.log` on failures.
486
494
 
@@ -85,23 +85,29 @@ npx wix build
85
85
 
86
86
  ### Step 4: Preview Deployment
87
87
 
88
- Start the preview server:
88
+ `npx wix preview` is a one-shot command, not a server: it uploads a preview build, prints the preview URLs and **exits on its own**, in seconds. Run it in the foreground and read its output:
89
89
 
90
90
  ```bash
91
91
  npx wix preview
92
92
  ```
93
93
 
94
+ Don't wrap it in `timeout` (macOS has none, so the call fails before preview runs), background it, `sleep` or poll a log for it, or `kill` it afterwards. There is no process left to wait for or stop.
95
+
94
96
  **Success criteria:**
95
- - Preview server starts successfully
96
- - Preview URLs are generated (both site and dashboard)
97
+ - The command exits 0
98
+ - It printed `✔ Preview created successfully!` and the preview URLs
99
+
100
+ **URL extraction:** the URLs follow `Open the preview on:`, one per line, each in parentheses:
97
101
 
98
- **URL extraction:** Parse the terminal output to find both preview URLs. Look for patterns like:
99
- - Site preview: `Site preview: https://...` or `Site URL: https://...`
100
- - Dashboard preview: `Dashboard preview: https://...` or `Preview URL: https://...` or `Your app is available at: https://...`
102
+ ```
103
+ › Site (https://www.wix.com/app-installer?appId=...)
104
+ › Editor (https://www.wix.com/app-installer?appId=...)
105
+ › Dashboard (https://www.wix.com/app-installer?appId=...)
106
+ ```
101
107
 
102
- Extract both URLs and provide them to the user for manual verification.
108
+ A long URL wraps across several lines. Join the lines up to the closing `)` before using it. Give the Site and Dashboard URLs to the user for manual verification.
103
109
 
104
- **On failure:** Report the preview startup errors, [check the debug log](#debug-log-on-errors) for detailed diagnostics, and stop validation.
110
+ **On failure:** Report the preview errors, [check the debug log](#debug-log-on-errors) for detailed diagnostics, and stop validation.
105
111
 
106
112
  ## Validation Report
107
113
 
@@ -111,7 +117,7 @@ After completing all steps, provide a summary:
111
117
  - Dependencies: ✓ All packages installed successfully
112
118
  - TypeScript: ✓ No compilation errors
113
119
  - Build: ✓ Compiled successfully
114
- - Preview: ✓ Running at [URL]
120
+ - Preview: ✓ Created — [Dashboard URL]
115
121
 
116
122
  **Fail:**
117
123
  - Identify which step failed
@@ -138,7 +144,7 @@ Read: .wix/debug.log (with offset to the end)
138
144
  | Package installation fails | Missing lock file, network issues, or corrupted node_modules | Delete `node_modules` and lock file, then reinstall |
139
145
  | TypeScript compilation fails | Type mismatches, missing declarations, or incorrect types | Fix TypeScript errors shown in `npx tsc --noEmit -p .` output |
140
146
  | Build fails | TypeScript errors, missing dependencies, or internal CLI error | Fix TypeScript errors in source; for non-obvious failures, check `.wix/debug.log` |
141
- | Preview fails to start | Port conflict, config issue, or internal CLI error | Check `wix.config.json`; if unclear, check `.wix/debug.log` for details |
147
+ | Preview fails | Config issue, not logged in, or internal CLI error | Check `wix.config.json`; if unclear, check `.wix/debug.log` for details |
142
148
  | Console errors in preview | Runtime exceptions | Check browser console output |
143
149
  | UI not rendering | Component errors | Review component code and imports |
144
150
  | CLI error with no clear message | Truncated terminal output | Read `.wix/debug.log` for the full error trace and stack details |
@@ -1,13 +1,11 @@
1
1
  # Wix Editor React Component Builder
2
2
 
3
3
  Build Editor React Components for Harmony/Studio2 Wix CLI apps only. First
4
- determine **create vs edit**; for edits, inspect the existing component and
5
- never re-scaffold.
4
+ determine **create vs edit**; for edits, inspect the existing component.
6
5
 
7
6
  ## File Contract
8
7
 
9
- Use the Wix CLI scaffold as the source of truth. Do not replace it with a custom
10
- layout or a hand-written manifest. Preserve these file responsibilities:
8
+ Keep the Wix CLI scaffold and file roles:
11
9
 
12
10
  | File | Ownership | Purpose |
13
11
  | --- | --- | --- |
@@ -16,37 +14,55 @@ layout or a hand-written manifest. Preserve these file responsibilities:
16
14
  | `<component-name>.module.css` | Edit | Scoped component styles |
17
15
  | `component.tsx` | Keep generated | Wire component and `defaultProps` with `withDefaults` |
18
16
  | `component.preview.tsx` | Edit narrowly | Sync preview adapter, one crucial data field, root class |
19
- | `<component-name>.generated.ts` | NEVER edit | Generated manifest — do not edit |
17
+ | `<component-name>.generated.ts` | NEVER edit | Generated manifest |
20
18
  | `<component-name>.extension.ts` | Edit narrowly | Supported partial manifest overrides |
21
19
 
22
- Supplementary files (constants, hooks, sub-components) are allowed; keep scaffold
23
- roles intact.
20
+ Supplementary files are allowed; keep scaffold roles intact.
24
21
 
25
22
  ## Workflow
26
23
 
27
- 1. **Scaffold only when creating.** If the component folder does not exist, run
28
- inside the Wix app project (the folder with `wix.config.json`):
24
+ 1. **Scaffold only when creating.** Run in the Wix app (`wix.config.json`).
25
+ Check the current directory, then this workspace; never search the OS:
29
26
 
30
27
  ```bash
31
- npx wix generate --params '{"extensionType":"EDITOR_REACT_COMPONENT","name":"ComponentName","folder":"component-name","description":"A brief description"}'
28
+ npx wix generate --params '{"extensionType":"EDITOR_REACT_COMPONENT","name":"ComponentName","folder":"component-name","description":"A meaningful description of component's intent and functionality"}'
32
29
  ```
33
30
 
34
- Creates `src/extensions/site/components/<component-name>/` and registers the
35
- extension in `src/extensions.ts`. Do not rerun for an existing component.
31
+ Never rerun the scaffold for an existing component.
32
+ Write a meaningful `description` in 1-2 plain sentences (max 300 chars): what
33
+ the user sees, when to use it, and capabilities that affect that choice.
34
+ Don't repeat the component name or add implementation details.
36
35
 
37
- 2. **Run the dependency preflight.** Verify that all component creation and
38
- accessibility-review dependencies are installed:
36
+ 2. **Run the dependency preflight.** Check required packages:
39
37
 
40
38
  ```bash
41
- node -e "const fs=require('fs'),path=require('path'),ps=['@wix/react-component-schema','@wix/react-component-utils','@wix/editor-react-types','@babel/parser','@babel/traverse','@babel/types','eslint','eslint-plugin-jsx-a11y','@typescript-eslint/parser','typescript','@types/eslint-plugin-jsx-a11y','jsdom','axe-core'];const missing=ps.filter(p=>!(require.resolve.paths(p)||[]).some(d=>fs.existsSync(path.join(d,p,'package.json'))));if(missing.length){console.error('Missing dependencies: '+missing.join(', '));process.exit(1)}" || { d="$PWD"; while [ "$d" != "/" ] && [ ! -f "$d/yarn.lock" ]; do d="${d%/*}"; done; if [ -f "$d/yarn.lock" ]; then yarn add @wix/react-component-schema @wix/react-component-utils @wix/editor-react-types && yarn add -D @babel/parser @babel/traverse @babel/types eslint eslint-plugin-jsx-a11y @typescript-eslint/parser 'typescript@<7' @types/eslint-plugin-jsx-a11y jsdom axe-core; else npm install @wix/react-component-schema @wix/react-component-utils @wix/editor-react-types && npm install --save-dev @babel/parser @babel/traverse @babel/types eslint eslint-plugin-jsx-a11y @typescript-eslint/parser 'typescript@<7' @types/eslint-plugin-jsx-a11y jsdom axe-core; fi; }
39
+ deps=(@wix/react-component-schema @wix/react-component-utils @wix/editor-react-types)
40
+ dev=(@babel/parser @babel/traverse @babel/types eslint eslint-plugin-jsx-a11y @typescript-eslint/parser 'typescript@<7' @types/eslint-plugin-jsx-a11y jsdom axe-core)
41
+
42
+ node - "${deps[@]}" "${dev[@]}" <<'JS' || {
43
+ const fs = require('fs'), path = require('path');
44
+ const missing = process.argv.slice(2)
45
+ .map(p => p.replace(/@<7$/, ''))
46
+ .filter(p => !require.resolve.paths(p)?.some(d => fs.existsSync(path.join(d, p, 'package.json'))));
47
+ if (missing.length) {
48
+ console.error(`Missing dependencies: ${missing.join(', ')}`);
49
+ process.exit(1);
50
+ }
51
+ JS
52
+ d="$PWD"
53
+ while [[ "$d" != / && ! -f "$d/yarn.lock" ]]; do d="$(dirname "$d")"; done
54
+ if [[ -f "$d/yarn.lock" ]]; then install=(yarn add); else install=(npm install); fi
55
+ "${install[@]}" "${deps[@]}" && "${install[@]}" -D "${dev[@]}"
56
+ }
42
57
  ```
43
58
 
44
- 3. **Plan the contract and structure.** Identify props, semantic root, named
45
- parts, and design states; read routed references below before writing code.
59
+ 3. **Plan.** Identify props, root, parts, and states; read routed references.
60
+ Use the scaffold and references before package declarations; probe an API
61
+ only when undocumented or a typecheck fails.
46
62
 
47
- 4. **Implement the editable sources.** Preserve the scaffold contract: props in
48
- the props file, logic in TSX, styles in the CSS Module. Do not edit
49
- `*.generated.ts`.
63
+ 4. **Implement.** Keep props, logic, and styles in their scaffolded editable
64
+ files. Format edited source files with the app's configured formatter before
65
+ checking formatting. Never edit or format `*.generated.ts`.
50
66
 
51
67
  5. **Run the accessibility review.** Once the JSX is complete, run from the
52
68
  same folder (`<SKILL_ROOT>` is the directory containing the active `SKILL.md`):
@@ -55,42 +71,36 @@ roles intact.
55
71
  node <SKILL_ROOT>/scripts/scan-a11y-review.cjs src/extensions/site/components/<component-name>
56
72
  ```
57
73
 
58
- Then follow [`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md):
59
- fix confirmed findings, rerun after each fix pass (at most two), and report
60
- what remains.
74
+ Follow [`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md); fix and
75
+ rerun at most twice, then report remaining findings.
61
76
 
62
- 6. **Configure the editor extension when required.** For a new component or a
63
- requested sizing, installation, or manifest change, apply
77
+ 6. **Configure the editor extension.** For creation or a requested sizing,
78
+ installation, or manifest change, apply
64
79
  [`editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md)
65
- to `<component-name>.extension.ts`. Otherwise leave the file unchanged.
66
- Synchronize `requiredDataFields` and `rootClassName` in
67
- `component.preview.tsx`.
80
+ to the extension; otherwise leave it unchanged. Synchronize preview
81
+ `requiredDataFields` and `rootClassName`.
68
82
 
69
- 7. **Generate and validate.** Run:
83
+ 7. **Generate and validate.** Batch implementation edits, then build and
84
+ generate the manifest once:
70
85
 
71
86
  ```bash
72
87
  npx wix build && npx wix generate manifest
73
- npx tsc --noEmit
74
88
  ```
75
89
 
76
- Run relevant tests and lint when available. Inspect the regenerated manifest;
77
- never repair it by hand. On failure, diagnose with
90
+ Run `npx tsc --noEmit`, relevant tests/lint, and the accessibility review.
91
+ If later edits affect a check, rerun that
92
+ check. Inspect the manifest when generated; never hand-repair it. Diagnose
93
+ failures with
78
94
  [`editor-react-component/MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md).
79
95
 
80
- 8. **Report the result.** Summarize edited files and checks. Call out any
81
- unresolved conflict, missing dependency, unsupported CLI version, or check
82
- that could not run.
96
+ For creation/layout changes, complete the routed overflow resize review.
83
97
 
84
- ## Reference Policy
98
+ 8. **Report.** Summarize files, checks, blockers, and checks that could not run.
85
99
 
86
- - Read **only** matching required + triggered optional rows; optional triggers
87
- become required when they match.
88
- - References refine the active step; they do not restart workflow or expand scope.
89
- - Never re-scaffold an existing component or edit `*.generated.ts`.
100
+ ## Reference Policy
90
101
 
91
- `SKILL.md` is the only reference router; reference files are self-contained
92
- leaves. For existing components, preserve out-of-scope public props, styling,
93
- extension configuration, and supporting files.
102
+ Read only matched references. Preserve unrelated behavior. `SKILL.md` routes;
103
+ references are leaves.
94
104
 
95
105
  ### Required References
96
106
 
@@ -102,6 +112,7 @@ extension configuration, and supporting files.
102
112
  | Changing public data props or elected root global class | [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
103
113
  | Item array where only one body is visible | [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md), [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
104
114
  | Creating or changing CSS | [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md) |
115
+ | Creating or changing layout/content | [`OVERFLOW.md`](editor-react-component/OVERFLOW.md) |
105
116
  | Root direction contract, direction-sensitive behavior, or `ReactNode` slot | [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md) |
106
117
  | Sizing, installation, or manifest overrides | [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
107
118
 
@@ -109,7 +120,7 @@ extension configuration, and supporting files.
109
120
 
110
121
  | Trigger | Read |
111
122
  | --- | --- |
112
- | Interactive/selectable part or custom state | [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
123
+ | Interactive/selectable part, custom state, or open/collapse toggle | [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
113
124
  | Creating interactive components or changing interactions/callbacks | [`FUNCTION-HANDLERS.md`](editor-react-component/FUNCTION-HANDLERS.md) |
114
125
  | Browser APIs, effects, or time-dependent output | [`SSR.md`](editor-react-component/SSR.md) |
115
126
  | Non-established CSS feature or DOM API, or user asks for one by name | [`BROWSER-SUPPORT.md`](editor-react-component/BROWSER-SUPPORT.md) |
@@ -135,14 +146,17 @@ extension configuration, and supporting files.
135
146
  top-level props).
136
147
  - Native design states: pair selectors with injected modifiers; keep non-input
137
148
  `:focus-visible` standalone unless editable focus is requested; toggle custom
138
- state classes from data.
149
+ state classes from data, each with a matching `:global()` rule.
150
+ - Open/collapse components: expose a props-only `isOpen: ElementState<boolean>`
151
+ root state and sync internal state from it.
139
152
  - Single-visible-body arrays: `name` per item, `ActiveItemIndex<'prop'>`, render
140
153
  all bodies, hide inactive accessibly.
141
154
  - Autoplay/loop: play/pause control, honor reduced motion, suppress autoplay in
142
155
  editor design mode.
143
- - `component.preview.tsx`: preserve this outer-to-inner composition, inline or
144
- through component variables:
156
+ - Resizable layout: keep required content usable at 320px. Reflow visible
157
+ groups inside their page and cap track minima with
158
+ `minmax(min(100%, <minimum>), 1fr)`. Follow [`OVERFLOW.md`](editor-react-component/OVERFLOW.md).
159
+ - Preview composition, inline or through variables:
145
160
  `withDefaults(withFallbackPlaceholder(PreviewOrComponent, options), defaultProps)`.
146
- Keep `withDefaults` outermost, wrap the preview adapter when present, use one
147
- crucial `requiredDataFields` entry, and match `rootClassName` to the root
148
- global class.
161
+ Keep `withDefaults` outermost; use one crucial data field and match the root
162
+ class.
@@ -41,4 +41,6 @@ Data owned by an existing Wix business app is read and written through that app'
41
41
  | locations / site properties | `@wix/business-tools` |
42
42
  | app instances | `@wix/app-management` |
43
43
 
44
+ Types from these packages are accessed as `<namespace>.<TypeName>` — see [SDK types](../SKILL.md#sdk-first-rule-existing-wix-app-data-is-never-cms).
45
+
44
46
  If the entity isn't listed or you're unsure, run `SearchWixSDKDocumentation` for it — **never conclude CMS with zero MCP calls**. CMS is only for data your app itself introduces (configuration, rules, app-specific records) that no Wix app manages.
@@ -1,6 +1,6 @@
1
1
  # Draft Template — the starting point for every dashboard page
2
2
 
3
- **Start here for any Dashboard Page request, before writing a shell, provider, or router from scratch.** Pick the case below, copy its files, rename, and adapt fields/API calls/data source. Only leave this file for [WIX_PATTERNS_DOCS.md](../WIX_PATTERNS_DOCS.md), the package's own `Collection Toolkit.md` guide, [TABLE_STATE.md](TABLE_STATE.md), a component doc, or an MCP lookup when the request needs something no case shows.
3
+ **Start here for any Dashboard Page request, before writing a shell, provider, or router from scratch.** Pick the case below, copy its files, rename, and adapt fields/API calls/data source. Only leave this file when the request needs something no case shows, and then go to [WIX_PATTERNS_DOCS.md](../WIX_PATTERNS_DOCS.md) first — before any lookup inside `node_modules/@wix/patterns`, `index.json` included. It routes you to the package's own `Collection Toolkit.md` guide, a component doc or an example; [TABLE_STATE.md](TABLE_STATE.md) and MCP lookups come after it.
4
4
 
5
5
  Every snippet below was copied from the installed `dist/docs/*.md` and `dist/dts-bundle/*.d.ts`, not from memory — confirm props against your own installed version before deviating.
6
6
 
@@ -1,7 +1,6 @@
1
1
  # Accessibility Implementation and Review
2
2
 
3
- Use this reference while authoring Editor React Component props and JSX, then
4
- run the review command once the JSX is complete.
3
+ Use while authoring; run the review after JSX is complete.
5
4
 
6
5
  ## Contents
7
6
 
@@ -41,7 +40,9 @@ function Toggle({ elementProps }: ToggleProps) {
41
40
 
42
41
  return (
43
42
  <button {...toggleProps} aria-label={toggleA11y?.ariaLabel ?? ARIA_LABELS.toggle}>
44
- <ChevronIcon aria-hidden="true" />
43
+ <svg aria-hidden="true" viewBox="0 0 16 16">
44
+ <path d="m3 6 5 5 5-5" fill="none" stroke="currentColor" />
45
+ </svg>
45
46
  </button>
46
47
  );
47
48
  }
@@ -5,23 +5,9 @@ Use this reference when the component's primary content **auto-advances or plays
5
5
 
6
6
  Every such component must ship an on-stage **play/pause button**.
7
7
 
8
- ## Contents
9
-
10
- - [Apply When](#apply-when)
11
- - [Required Contract](#required-contract)
12
- - [Announce Manually Selected Parallel Content](#announce-manually-selected-parallel-content)
13
- - [Define Props](#1-define-props)
14
- - [Manage Playback State](#2-manage-playback-state)
15
- - [Add the Play/Pause Button](#3-add-the-playpause-button)
16
- - [Suppress Autoplay in `component.preview.tsx`](#4-suppress-autoplay-in-componentpreviewtsx)
17
- - [Edit the generated `component.preview.tsx`](#edit-the-generated-componentpreviewtsx)
18
- - [Checklist](#checklist)
19
-
20
8
  ## Apply When
21
9
 
22
- Apply automatically — without being asked — whenever the component has an
23
- `autoPlay` prop **or** its primary content is a **startable / loopable**
24
- animation a visitor would reasonably want to start or stop:
10
+ Apply whenever the component has `autoPlay` or startable/loopable primary content:
25
11
 
26
12
  - Slideshow, carousel, slider, or gallery that advances slides/cards
27
13
  - Lottie / JSON vector animations
@@ -94,8 +80,20 @@ export interface MyAnimationProps {
94
80
  }
95
81
  ```
96
82
 
97
- The example shows a looping animation. Omit `loop` when the component does not
98
- support repeat behavior; do not add it only to match the example.
83
+ Omit `loop` when repeat is unsupported.
84
+
85
+ ### Lottie / JSON source
86
+
87
+ For Lottie, `animationUrl?: string` is a JSON URL, not `VectorArt` (SVG).
88
+ This and its renderer are exceptions to the generic media/dependency rules in
89
+ `COMPONENT-CONTRACT.md`. Check `package.json`: use `lottie-web` if present,
90
+ otherwise add it as a runtime dependency. Import `lottie` and
91
+ `type AnimationItem` from it. In an effect, call
92
+ `lottie.loadAnimation({ container, renderer: 'svg', path: animationUrl,
93
+ loop, autoplay: false })`; keep the item in a ref, destroy it on cleanup,
94
+ and use `play()` / `pause()` when `isPlaying` changes. Browser work belongs in
95
+ effects. If no URL is supplied, bundle a valid local Lottie JSON asset and
96
+ import it with `?url` as the component default; a placeholder URL renders blank.
99
97
 
100
98
  ## 2. Manage Playback State
101
99
 
@@ -109,20 +107,22 @@ const reducedMotion = useReducedMotion();
109
107
 
110
108
  const [isPlayOn, setIsPlayOn] = React.useState(() => (autoPlay ?? true) && !reducedMotion);
111
109
 
112
- const skipInitialAutoPlaySync = React.useRef(true);
110
+ const previousAutoPlay = React.useRef(autoPlay);
113
111
  React.useEffect(() => {
114
- if (skipInitialAutoPlaySync.current) {
115
- skipInitialAutoPlaySync.current = false;
116
- return;
112
+ if (previousAutoPlay.current !== autoPlay) {
113
+ setIsPlayOn((autoPlay ?? true) && !reducedMotion);
114
+ } else if (reducedMotion) {
115
+ setIsPlayOn(false);
117
116
  }
118
- setIsPlayOn(autoPlay ?? true);
119
- }, [autoPlay]);
117
+ previousAutoPlay.current = autoPlay;
118
+ }, [autoPlay, reducedMotion]);
120
119
 
121
120
  const handlePause = () => setIsPlayOn(false);
122
121
  const handleResume = () => setIsPlayOn(true);
123
122
  ```
124
123
 
125
- `reducedMotion` is a runtime signal, not a manifest/data prop.
124
+ `reducedMotion` is runtime-only. Pause when the OS turns reduced motion on, but
125
+ do not restart when it turns off. Resume can still override the preference.
126
126
 
127
127
  Derive runtime playback from `isPlayOn` plus only needed conditions. Without
128
128
  another condition, use `const isPlaying = isPlayOn`. A carousel, slideshow,
@@ -140,7 +140,10 @@ clears `isStoppedByFocus`.
140
140
 
141
141
  ## 3. Add the Play/Pause Button
142
142
 
143
- Create play/pause icons that visually match the component's style. Use simple recognizable shapes — a triangle for play, two rectangles for pause — implemented as inline SVG so there is no external icon dependency. Size and color of SVG should be controlled by CSS variables declared on the button level: --icon-size and --icon-color.
143
+ Use inline SVG icons: a triangle for play and two bars for pause. Declare
144
+ `--icon-size` and `--icon-color` on the button. Apply `var(--icon-size)` to the
145
+ SVG's CSS `width` and `height` (or React `style`), not raw SVG attributes;
146
+ set button `color: var(--icon-color)` and SVG `fill: currentColor`.
144
147
 
145
148
  Position the button absolutely so it overlays the content without pushing other elements out of place:
146
149
 
@@ -28,8 +28,14 @@ using CSS Modules `@value`, then consume with `var()`.
28
28
  - Do not use `var(--wst-*)` directly; import the `@value` alias first.
29
29
  - Do not pass a fallback as `var()`'s second argument
30
30
  - Do not use `@import`; CSS Modules resolves theme aliases through `@value`.
31
- - Do not use `wst-base-1-color` for text. Prefer heading/paragraph color tokens,
32
- or `wst-base-2-color` when a base contrast color is required.
31
+ - Do not use `wst-base-1-color` for text on a light surface. Prefer
32
+ heading/paragraph color tokens for body text.
33
+ - Use matching control tokens: pair `wst-button-primary-background-color` with
34
+ `wst-button-primary-color` for a primary CTA (or the secondary pair for a
35
+ secondary CTA). Do not mix `wst-links-and-actions-color` with
36
+ `wst-base-2-color` as button background and text: they are unrelated tokens
37
+ and may fail contrast. Check the rendered contrast of every state, and choose
38
+ a different token pair or design if it fails.
33
39
 
34
40
  ## Checklist
35
41
 
@@ -3,17 +3,6 @@
3
3
  Use this reference when defining props, defaults, named-part wiring, complex data,
4
4
  or internal file boundaries.
5
5
 
6
- ## Contents
7
-
8
- - [Public Props Contract](#public-props-contract)
9
- - [Numeric Range Constraints](#numeric-range-constraints)
10
- - [Named Parts and `elementProps`](#named-parts-and-elementprops)
11
- - [Content and Data](#content-and-data)
12
- - [Active-Item Components](#active-item-components)
13
- - [Defaults and Resources](#defaults-and-resources)
14
- - [Internal File Splitting](#internal-file-splitting)
15
- - [Checklist](#checklist)
16
-
17
6
  ## Public Props Contract
18
7
 
19
8
  Keep identity and platform contracts together with component-specific data and
@@ -54,6 +43,9 @@ Rules:
54
43
  - Default to common optional SDK callbacks by capability; add specialized ones
55
44
  when requested. Keep implementation handlers internal.
56
45
  - Use `Array<T>`, not `T[]`, for exported arrays.
46
+ - A CTA with a real destination is a native link with that `href`. If it only
47
+ performs an action, use a native button. Never use `href="#"` as a fallback;
48
+ it creates a focusable link without a meaningful destination.
57
49
 
58
50
  ## Numeric Range Constraints
59
51
 
@@ -153,6 +145,7 @@ slides, steps). Skip for always-visible lists, multi-select, or multi-expand.
153
145
  `@wix/react-component-utils`. The type argument must match the array prop name
154
146
  exactly, and `defaultProps` must set the index to `0`.
155
147
  - Render all bodies with `.map()`. Active body gets --active; inactive bodies get functional CSS visibility, aria-hidden, and inert.
148
+ - With React 18 types, spread `...(!isActive ? { inert: 'true' } : {})` onto an inactive body; this emits the boolean HTML attribute without a TypeScript prop error. Use the app's typecheck instead of a scratch TypeScript project.
156
149
  - Provide keyboard navigation and the matching ARIA pattern.
157
150
 
158
151
  ```ts
@@ -184,11 +177,16 @@ media type, whether it is a top-level prop or a field in an array item. Name
184
177
  the field for the media itself (`image`, `video`, `audio`, and so on), not for
185
178
  one representation of it.
186
179
 
180
+ Common fields in the installed types: `Image` has required `url: string` and
181
+ optional `uri`, `alt`, `width`, `height`; `Link` has optional `href`, `target`
182
+ (`'_self' | '_blank'`), and `rel`. Use `image.url` for `<img src>`,
183
+ `image.alt` for its alternative text, and `link.href` for `<a href>`.
184
+
187
185
  Do not represent media as a URL/source string or split its metadata across
188
186
  primitive props. Preserve the media object through the public contract so the
189
- component can consume all of its supported data. See
190
- `node_modules/@wix/react-component-schema/dist/editor-react-types.d.ts` for the
191
- full list.
187
+ component can consume all of its supported data. Inspect the installed media
188
+ type declaration only if a needed field is not covered here or a typecheck
189
+ reports an error.
192
190
 
193
191
  ## Defaults and Resources
194
192
 
@@ -56,6 +56,7 @@ that semantic element is the root. Do not wrap it just to host root props.
56
56
 
57
57
  Use flat, top-level selectors. Each selector must target one class plus an
58
58
  optional state pseudo-class or global state modifier.
59
+ Put state overrides before bare classes so the manifest keeps resting defaults.
59
60
 
60
61
  ```css
61
62
  .heading {
@@ -103,7 +104,7 @@ Choose the simplest root shape that fits the component:
103
104
 
104
105
  - column: `--display: flex; flex-direction: column`
105
106
  - row: `--display: flex; flex-direction: row`
106
- - split layout: `--display: grid; grid-template-columns: 1fr 1fr`
107
+ - split layout: `--display: grid; grid-template-columns: repeat(2, minmax(0, 1fr))`
107
108
  - responsive collection: `--display: grid; grid-template-columns: repeat(auto-fit, minmax(...))`
108
109
 
109
110
  Do not hardcode the root's pixel dimensions. Installation defaults belong in
@@ -136,7 +137,7 @@ the extension file.
136
137
  ## Responsiveness and Direction
137
138
 
138
139
  Respond to the component container, not the browser viewport. Prefer intrinsic
139
- flex/grid sizing, `minmax()`, `auto-fit`, `1fr`, and `clamp()`. Do not add
140
+ flex/grid sizing and tracks that can shrink below content size. Do not add
140
141
  viewport `@media` rules; Wix owns page breakpoints.
141
142
 
142
143
  Use logical inline-axis properties so layout flips automatically in RTL:
@@ -171,7 +172,7 @@ Use this pattern:
171
172
 
172
173
  .grid {
173
174
  --columns: 3;
174
- grid-template-columns: repeat(var(--columns), 1fr);
175
+ grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
175
176
  }
176
177
  ```
177
178