@wix/agent-skills 1.18.0 → 1.18.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/agent-skills",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Wix Skills for AI coding agents — versioned npm distribution of the wix/skills content.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,32 +1,26 @@
1
1
  # Wix Editor React Component Builder
2
2
 
3
- Build Editor React Components for Harmony Editor and Studio2 in Wix CLI
4
- applications. These components are not supported in other Wix editors.
5
-
6
- ## Before You Start
7
-
8
- Determine whether the request creates a component or edits an existing one.
9
- Inspect the existing component before changing it.
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.
10
6
 
11
7
  ## File Contract
12
8
 
13
9
  Use the Wix CLI scaffold as the source of truth. Do not replace it with a custom
14
- layout or a hand-written manifest. After applying this workflow, preserve these
15
- file responsibilities:
10
+ layout or a hand-written manifest. Preserve these file responsibilities:
16
11
 
17
12
  | File | Ownership | Purpose |
18
13
  | --- | --- | --- |
19
- | `<component-name>.props.ts` | Edit | Export the props type and `defaultProps` from one shared source. |
20
- | `<component-name>.tsx` | Edit | Implement the component UI and behavior. |
21
- | `<component-name>.module.css` | Edit | Define scoped component styles. |
22
- | `component.tsx` | Keep generated | Wire the component and `defaultProps` with `withDefaults`. |
23
- | `component.preview.tsx` | Edit narrowly | Keep generated wrappers; sync the preview adapter, one crucial data field, and root class. |
24
- | `<component-name>.generated.ts` | NEVER edit | Generated manifest consumed by the editor. |
25
- | `<component-name>.extension.ts` | Edit narrowly | Apply supported partial manifest overrides. |
26
-
27
- Supplementary files such as `constants.ts`, hooks, or internal sub-components
28
- are allowed when the implementation needs them. Keep the scaffolded files and
29
- their responsibilities intact.
14
+ | `<component-name>.props.ts` | Edit | Props type + `defaultProps` |
15
+ | `<component-name>.tsx` | Edit | Component UI and behavior |
16
+ | `<component-name>.module.css` | Edit | Scoped component styles |
17
+ | `component.tsx` | Keep generated | Wire component and `defaultProps` with `withDefaults` |
18
+ | `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 |
20
+ | `<component-name>.extension.ts` | Edit narrowly | Supported partial manifest overrides |
21
+
22
+ Supplementary files (constants, hooks, sub-components) are allowed; keep scaffold
23
+ roles intact.
30
24
 
31
25
  ## Workflow
32
26
 
@@ -36,9 +30,8 @@ their responsibilities intact.
36
30
  npx wix generate --params '{"extensionType":"EDITOR_REACT_COMPONENT","name":"ComponentName","folder":"component-name","description":"A brief description"}'
37
31
  ```
38
32
 
39
- The command creates `src/extensions/site/components/<component-name>/` and
40
- registers the extension in `src/extensions.ts`. Do not rerun it for an
41
- existing component.
33
+ Creates `src/extensions/site/components/<component-name>/` and registers the
34
+ extension in `src/extensions.ts`. Do not rerun for an existing component.
42
35
 
43
36
  2. **Run the dependency preflight.** Verify that all component creation and
44
37
  accessibility-review dependencies are installed:
@@ -47,25 +40,23 @@ their responsibilities intact.
47
40
  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'];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; 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; fi; }
48
41
  ```
49
42
 
50
- 3. **Plan the contract and structure.** Identify content and behavior props,
51
- elect the semantic root, identify named inner parts, and decide which design
52
- states each part supports. Read the relevant references from the routing
53
- table below before writing code.
43
+ 3. **Plan the contract and structure.** Identify props, semantic root, named
44
+ parts, and design states; read routed references below before writing code.
54
45
 
55
- 4. **Implement the editable sources.** Preserve the scaffold contract. Keep
56
- props/defaults in the props file, component logic in the main TSX file, and
57
- static styling in the CSS Module. Do not edit `*.generated.ts`.
46
+ 4. **Implement the editable sources.** Preserve the scaffold contract: props in
47
+ the props file, logic in TSX, styles in the CSS Module. Do not edit
48
+ `*.generated.ts`.
58
49
 
59
50
  5. **Run the accessibility review.** Follow
60
- [`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md): run both bundled
61
- scanners, triage their output, complete the manual semantic checklist, fix
62
- confirmed issues, and rerun the scanners on changed JSX files.
51
+ [`editor-react-component/ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md): run scanners,
52
+ triage output, complete the manual checklist, fix issues, rerun on changed
53
+ JSX.
63
54
 
64
55
  6. **Configure the editor extension when required.** For a new component or a
65
56
  requested sizing, installation, or manifest change, apply
66
57
  [`editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md)
67
58
  to `<component-name>.extension.ts`. Otherwise leave the file unchanged.
68
- Finally, synchronize `requiredDataFields` and `rootClassName` in
59
+ Synchronize `requiredDataFields` and `rootClassName` in
69
60
  `component.preview.tsx`.
70
61
 
71
62
  7. **Generate and validate.** Run:
@@ -75,82 +66,71 @@ their responsibilities intact.
75
66
  npx tsc --noEmit
76
67
  ```
77
68
 
78
- Run relevant project tests and lint commands when available. Inspect the
79
- regenerated manifest; never repair it by hand. Design-state generation needs
80
- `@wix/cli` 1.1.210 or newer, and prop-triggered `ElementState` generation
81
- needs 1.1.215 or newer. If expected states are absent on an older CLI, report
82
- the version constraint and let the user decide whether to upgrade. If the
83
- build or manifest command exits with an error, diagnose it with
84
- [`editor-react-component/MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md), apply the
85
- matching fix, and rerun both commands.
69
+ Run relevant tests and lint when available. Inspect the regenerated manifest;
70
+ never repair it by hand. On failure, diagnose with
71
+ [`editor-react-component/MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md).
86
72
 
87
73
  8. **Report the result.** Summarize edited files and checks. Call out any
88
- unresolved instruction conflict, missing dependency, unsupported CLI
89
- version, or check that could not run.
74
+ unresolved conflict, missing dependency, unsupported CLI version, or check
75
+ that could not run.
90
76
 
91
77
  ## Reference Policy
92
78
 
93
- Read every reference required for the current scope. Read an optional reference
94
- only when its trigger applies; when it does, that reference becomes required.
95
- Apply every matching row; do not load the entire reference set by default.
79
+ - Read **only** matching required + triggered optional rows; optional triggers
80
+ become required when they match.
81
+ - References refine the active step; they do not restart workflow or expand scope.
82
+ - Never re-scaffold an existing component or edit `*.generated.ts`.
96
83
 
97
- References refine the active workflow step; they do not restart the workflow or
98
- expand the user's requested scope. `SKILL.md` is the only reference router;
99
- reference files are self-contained leaves and do not route to other references.
100
- For an existing component, preserve out-of-scope public props, styling,
101
- extension configuration, and supporting files. Never re-scaffold an existing
102
- component or edit `*.generated.ts` as a reference-driven fix.
84
+ `SKILL.md` is the only reference router; reference files are self-contained
85
+ leaves. For existing components, preserve out-of-scope public props, styling,
86
+ extension configuration, and supporting files.
103
87
 
104
88
  ### Required References
105
89
 
106
90
  | Scope | Required references |
107
91
  | --- | --- |
108
- | Creating a component | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md), [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PARTS.md`](editor-react-component/PARTS.md), [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md), [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md), [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md), [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md), and [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
109
- | Editing React or JSX | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md) and [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md) |
110
- | Changing the public contract, semantic root, or named parts | [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PARTS.md`](editor-react-component/PARTS.md), and [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md) |
111
- | Changing public data props or the elected root global class | [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
112
- | Creating or changing an 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), and [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
92
+ | Creating a component | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md), [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PARTS.md`](editor-react-component/PARTS.md), [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md), [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md), [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md), [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md), [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
93
+ | Editing React or JSX | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md), [`ACCESSIBILITY.md`](editor-react-component/ACCESSIBILITY.md) |
94
+ | Changing public contract, semantic root, or named parts | [`COMPONENT-CONTRACT.md`](editor-react-component/COMPONENT-CONTRACT.md), [`PARTS.md`](editor-react-component/PARTS.md), [`PROPS-VS-CSS.md`](editor-react-component/PROPS-VS-CSS.md) |
95
+ | Changing public data props or elected root global class | [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
96
+ | 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) |
113
97
  | Creating or changing CSS | [`CSS-GUIDELINES.md`](editor-react-component/CSS-GUIDELINES.md) |
114
- | Changing the root direction contract, direction-sensitive behavior, or a `ReactNode` slot | [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md) |
115
- | Changing sizing, installation, or manifest overrides | [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
98
+ | Root direction contract, direction-sensitive behavior, or `ReactNode` slot | [`DIRECTIONALITY.md`](editor-react-component/DIRECTIONALITY.md) |
99
+ | Sizing, installation, or manifest overrides | [`EDITOR-EXTENSION-CONFIGURATION.md`](editor-react-component/EDITOR-EXTENSION-CONFIGURATION.md) |
116
100
 
117
101
  ### Optional References
118
102
 
119
103
  | Trigger | Read |
120
104
  | --- | --- |
121
- | An interactive or selectable part is created or changed—for example a button, link, input, tab, accordion trigger, or carousel control—or a custom state is added | [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
122
- | Public event callbacks are added or changed | [`FUNCTION-HANDLERS.md`](editor-react-component/FUNCTION-HANDLERS.md) |
123
- | Browser APIs, effects, or time-dependent output are introduced | [`SSR.md`](editor-react-component/SSR.md) |
124
- | A CSS feature or DOM API that is not clearly long-established is introduced, or the user asks for one by name | [`BROWSER-SUPPORT.md`](editor-react-component/BROWSER-SUPPORT.md) |
105
+ | Interactive/selectable part or custom state | [`DESIGN-STATES.md`](editor-react-component/DESIGN-STATES.md) |
106
+ | Public event callbacks added or changed | [`FUNCTION-HANDLERS.md`](editor-react-component/FUNCTION-HANDLERS.md) |
107
+ | Browser APIs, effects, or time-dependent output | [`SSR.md`](editor-react-component/SSR.md) |
108
+ | Non-established CSS feature or DOM API, or user asks for one by name | [`BROWSER-SUPPORT.md`](editor-react-component/BROWSER-SUPPORT.md) |
125
109
  | `npx wix build` or manifest generation exits with an error | [`MANIFEST-ERRORS.md`](editor-react-component/MANIFEST-ERRORS.md) |
126
- | Primary content is playable, looped, or autoplaying | [`ANIMATED-COMPONENTS.md`](editor-react-component/ANIMATED-COMPONENTS.md) and [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
127
- | Runtime site pages, URLs, JavaScript direction, or reduced-motion context is needed | [`SITE-CONTEXT-HOOKS.md`](editor-react-component/SITE-CONTEXT-HOOKS.md) |
128
- | Non-animation behavior must differ in editor design mode | [`SITE-CONTEXT-HOOKS.md`](editor-react-component/SITE-CONTEXT-HOOKS.md) and [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
129
- | The prompt explicitly requests a branded, themed, or brand-aware component | [`BRANDED-COMPONENTS.md`](editor-react-component/BRANDED-COMPONENTS.md) |
110
+ | Animation, video, carousel, or other playable/looped/autoplaying content | [`ANIMATED-COMPONENTS.md`](editor-react-component/ANIMATED-COMPONENTS.md), [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) |
111
+ | Site/runtime/editor context hooks needed | [`SITE-CONTEXT-HOOKS.md`](editor-react-component/SITE-CONTEXT-HOOKS.md) (+ [`COMPONENT-PREVIEW.md`](editor-react-component/COMPONENT-PREVIEW.md) when design-mode behavior differs) |
112
+ | Branded, themed, or brand-aware component requested | [`BRANDED-COMPONENTS.md`](editor-react-component/BRANDED-COMPONENTS.md) |
130
113
 
131
- ## Core Invariants
114
+ ## Non-Negotiables
132
115
 
133
- - Use React 18-compatible APIs; do not assume React 19 runtime features.
116
+ - React 18 only; do not assume React 19 runtime features.
134
117
  - Include typed `id`, `className`, `direction`, and `a11y` support.
135
- - Apply `dir={direction}` and the unconditional fallback-direction class to the
136
- elected root. Use logical CSS properties for direction-sensitive layout.
137
- - Keep render output deterministic and avoid browser globals during render.
138
- - Use only Baseline Widely Available CSS features and DOM APIs, or ones that
139
- fall back to them. When a design needs a feature that is not, build the
140
- supported alternative.
141
- - Route ARIA through the typed `a11y` contract; do not add one-off ARIA props.
142
- - Give every named inner part a global class, a CSS Module class, and a matching
143
- `elementProps` entry. The elected root uses top-level props instead.
144
- - Pair each eligible native editor design-state selector with its
145
- editor-injected global modifier. Keep a non-input control's keyboard-only
146
- `:focus-visible` indicator standalone unless editable focus styling is
147
- explicitly requested. Toggle custom global state classes from data.
148
- - For an item array where only one body is visible, give every item a `name`,
149
- use `ActiveItemIndex<'arrayPropName'>`, render every body, and hide inactive
150
- bodies accessibly.
151
- - If primary content autoplays or loops, provide an accessible play/pause
152
- control, honor reduced motion, and suppress autoplay in editor design mode.
153
- - In `component.preview.tsx`, keep `withDefaults` and `withFallbackPlaceholder`,
154
- wrap the preview adapter when present, normally put
155
- only the one data prop crucial to meaningful rendering in
156
- `requiredDataFields`, and match `rootClassName` to the root global class.
118
+ - Elected root: `dir={direction}`, fallback-direction class, logical CSS for
119
+ direction-sensitive layout.
120
+ - Deterministic render; no browser globals during render.
121
+ - Explicit foreground colors need a known contrasting background; transparent
122
+ roots inherit from the host.
123
+ - Baseline Widely Available CSS/DOM only, or supported fallbacks.
124
+ - Route ARIA through `a11y`; no one-off ARIA props.
125
+ - Named parts: global class, module class, and `elementProps` (root uses
126
+ top-level props).
127
+ - Native design states: pair selectors with injected modifiers; keep non-input
128
+ `:focus-visible` standalone unless editable focus is requested; toggle custom
129
+ state classes from data.
130
+ - Single-visible-body arrays: `name` per item, `ActiveItemIndex<'prop'>`, render
131
+ all bodies, hide inactive accessibly.
132
+ - Autoplay/loop: play/pause control, honor reduced motion, suppress autoplay in
133
+ editor design mode.
134
+ - `component.preview.tsx`: keep `withDefaults` and `withFallbackPlaceholder`,
135
+ wrap the preview adapter when present, one crucial `requiredDataFields`
136
+ entry, and `rootClassName` matching the root global class.
@@ -1,11 +1,13 @@
1
1
  # CSS Guidelines
2
2
 
3
3
  Use these rules for the scaffolded `<component-name>.module.css` file and any
4
- colocated CSS Modules owned by internal sub-components. Keep existing visual
5
- decisions outside the request unchanged. These rules keep the component
4
+ colocated CSS Modules owned by internal sub-components. These rules keep the component
6
5
  editable by zero config, responsive to its Wix-owned container, and safe in
7
6
  both LTR and RTL layouts.
8
7
 
8
+ **Visual intent.** When the request specifies how the component should look —
9
+ mood, palette, layout style, or a reference — follow that direction. Default to a modern, refined look — intentional layout, pleasing proportions, polished and deliberate styling.
10
+
9
11
  ## Contents
10
12
 
11
13
  - [Classes and Named Parts](#classes-and-named-parts)
@@ -210,20 +212,30 @@ and do not expose a visual prop solely for that purpose.
210
212
 
211
213
  ## Default Visual Quality
212
214
 
213
- When creating a component and the request has no visual direction, use a
214
- restrained accessible default. When editing an existing component, preserve its
215
- visual language unless the request changes it.
215
+ Create a clear hierarchy with at least two techniques that fit the component:
216
+ a defined surface, border or soft shadow, type scale or weight, spacing, an
217
+ accent, or visible interaction states. Use these neutral defaults unless the
218
+ request or existing design provides better values:
219
+
220
+ - 16px or larger body text, 14px or larger labels, and 600–700 weight for titles
221
+ - 8–16px spacing inside controls and 16–32px spacing inside containers
222
+ - 8–12px corner radii for cards and controls; `50%` for circular media
223
+ - a subtle border or soft shadow when a card, panel, or control needs separation
224
+ - touch targets at least 44 by 44px and visible keyboard focus states
225
+
226
+ ### Foreground and Background Ownership
227
+
228
+ If the component is a self-contained block (card, panel, banner, accordion item), give the root a background. If it is an inline control meant to blend in (link, ghost button, icon button), control may leave the root transparent instead.
229
+
230
+ - On a transparent root, don't hardcode text or icon colors; inherit them from the parent.
231
+ - Set the background and main text/icon color together on the same element. Any secondary text (captions, hints, icons) must still be readable against that same background.
232
+ - If an interactive state changes the background, set the foreground color in that state too. Don't assume a color inherited from a parent or from a previous state will still look right on the new background.
233
+ - In every default and interactive state, meet WCAG AA contrast: 4.5:1 for body text and 3:1 for large text and UI controls.
216
234
 
217
- - body text at least 16px and labels at least 14px, with an explicit `font-family`
218
- - WCAG AA contrast (4.5:1 body text, 3:1 large text and UI controls)
219
- - touch targets at least 44 by 44px
220
- - clear hierarchy and visible focus states
221
- - generous but consistent spacing
222
- - transparent root backgrounds unless the design requires a surface
235
+ A neutral owned surface may use a light background with dark primary and
236
+ secondary foregrounds, plus one accessible accent. The exact colors are not a
237
+ contract; the contrast relationship is.
223
238
 
224
- Avoid prescribing a brand palette in a generic component. Only when the prompt
225
- explicitly requests branded or themed output, use its named brand tokens rather
226
- than hardcoded generic color choices.
227
239
 
228
240
  ## Checklist
229
241
 
@@ -239,3 +251,6 @@ than hardcoded generic color choices.
239
251
  - [ ] Every part that sets `font-size` also sets `font-family`, on the part that
240
252
  should own the typography control.
241
253
  - [ ] Interactive elements expose pointer events and accessible design states.
254
+ - [ ] Visual containers have deliberate hierarchy rather than bare scaffolding.
255
+ - [ ] Every explicit foreground has a known contrasting background; transparent
256
+ components inherit foregrounds from their host.
@@ -71,12 +71,25 @@ exhaust the site's form allowance (read it from
71
71
  [List Forms Providers Configs](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/list-forms-providers-configs)),
72
72
  which is also why you must **never create throwaway forms to probe the shape.**
73
73
 
74
+ > **⚠️ `providers-config` tells you which namespaces the site can create in — NOT its limits.** A
75
+ > provider app declares `restrictions` **once, for all sites**, in its app dashboard; the Wix Forms
76
+ > app separately derives the site's real form/field/step limits from its **premium plan** and
77
+ > enforces them on every create. (A missing `restrictions` means default platform limits, not
78
+ > unlimited.) That is why free and unpublished sites report `maxFields: 150` / `maxForms: 150` here
79
+ > while the create rejects with `Field count reached its limit of 10` and
80
+ > `Steps count reached its limit of 3`. **The create call is the only authority** — when it returns
81
+ > a count error, go to "Plan gates" below.
82
+
74
83
  ### STEP 2: Create each form schema
75
84
 
76
85
  **One POST per form** to `https://www.wixapis.com/form-schema-service/v4/forms`. How many forms, and
77
86
  each form's fields and labels, come from the request you're fulfilling; this step gives the call and
78
87
  the required format. Forms are independent (no shared revision), so concurrent creates are safe.
79
88
 
89
+ **Every body carries `"namespace": "wix.form_app.form"`** — the same literal the reads below take as
90
+ their required `?namespace=`. A form created under anything else is reachable over the API and
91
+ invisible in the dashboard and Editor.
92
+
80
93
  **⚠️ Generate every `id` in the shell as a lowercase UUID v4 — never type one from memory**
81
94
  (`uuidgen | tr 'A-Z' 'a-z'`). Supply them at create rather than omitting them: `steps` must
82
95
  reference each field by `fieldId` in the same request.
@@ -96,9 +109,18 @@ step unless the request needs multiple pages.
96
109
  beside `target`/`inputType`:
97
110
 
98
111
  ```jsonc
99
- "inputOptions": { "target": "full_name", "required": true, "inputType": "STRING",
100
- "stringOptions": { "validation": {}, "componentType": "TEXT_INPUT",
101
- "textInputOptions": { "label": "Full Name", "showLabel": true } } }
112
+ "inputOptions": {
113
+ "target": "first_name",
114
+ "required": true, // HERE — beside target/inputType
115
+ "pii": true,
116
+ "contactMapping": { "contactField": "FIRST_NAME" }, // per field; this is what creates the contact
117
+ "inputType": "STRING",
118
+ "stringOptions": {
119
+ "validation": {}, // always present, even empty — never `required`
120
+ "componentType": "TEXT_INPUT",
121
+ "textInputOptions": { "label": "First name", "showLabel": true }
122
+ }
123
+ }
102
124
  ```
103
125
 
104
126
  A `required` key inside `stringOptions.validation` — or any `<inputType>Options.validation`, since no
@@ -126,12 +148,21 @@ surface in the dashboard or on the first real submission.
126
148
  Three plan-tier limits return a real `400` on create. **Do not work around any of them; tell the user
127
149
  to reduce or upgrade.**
128
150
 
129
- - **`FIELDS_COUNT_RESTRICTIONS_ERROR`** — the form exceeds the plan's per-form field cap. **Do NOT
130
- split the form into multiple schemas** to dodge it. Reduce the field count, or upgrade.
151
+ - **Field count — two caps, counting different things.** `Field count reached its limit of N` is the
152
+ **premium** cap the Wix Forms app enforces from the site's plan, and it counts **`INPUT` fields
153
+ only** (display elements and the `SUBMIT_BUTTON` don't count). `FORM_FIELDS_COUNT_EXCEEDED` /
154
+ `FIELDS_COUNT_RESTRICTIONS_ERROR` is the schema-service cap, which counts **every** field
155
+ including display elements. **Do NOT split the form into multiple schemas** to dodge either — that
156
+ trades one submission record for several and consumes more of the site's form allowance. Reduce
157
+ the field count, or upgrade.
158
+ - **`Steps count reached its limit of N`** — the premium cap on `steps.length`. Collapse the form
159
+ into fewer pages, or upgrade. Conditions (`formRules`) are capped the same way. Neither has a
160
+ schema-service equivalent, so neither appears in the Create Form error table.
131
161
  - **`FILE_UPLOAD_RESTRICTIONS_ERROR`** — a file upload, signature, or payment field on a plan below
132
162
  Core. **Do NOT suggest inlining files as base64** — it stores no real file, gives the owner nothing
133
163
  usable, and blows past submission size limits. Drop the field, or upgrade.
134
- - **`FORMS_COUNT_RESTRICTIONS_ERROR`** — the site hit its plan's total-form cap. Upgrade, or free a
164
+ - **`FORMS_COUNT_RESTRICTIONS_ERROR`** / **`NAMESPACE_FORMS_COUNT_EXCEEDED`** (and
165
+ `NAMESPACE_DELETED_FORMS_COUNT_EXCEEDED` for the trash bin) — the site hit its plan's total-form cap. Upgrade, or free a
135
166
  slot (STEP 1's list-then-delete — but only delete forms that are clearly install sample data; ask
136
167
  before deleting anything that could be the owner's real form).
137
168
 
@@ -167,10 +198,19 @@ A `200` on create is not proof the form is queryable or that the dashboard will
167
198
  `formSummary.fields` is NON-EMPTY**, with a count equal to **every input field you sent** (i.e.
168
199
  `formFields[]` minus the `SUBMIT_BUTTON`). A 6-input form returns all 6 — **including non-contact
169
200
  `DROPDOWN` and `TEXT_AREA` fields** — so do *not* expect only the contact-mapped ones. This is
170
- the reliable dashboard-truth check: the summary returns exactly the fields the Wix dashboard
171
- shows. A `summary.fields: []`, or a count short of your inputs, means the form renders blank (or
172
- partly blank) for the owner even though the public site submits fine — **do not report success;
173
- fix the `identifier`s and re-create.**
201
+ the dashboard-truth check for *placement*. A `summary.fields: []`, or a count short of your
202
+ inputs, means the form renders blank (or partly blank) for the owner even though the public site
203
+ submits fine — **do not report success; fix the layout placement or the GUID casing and
204
+ re-create.**
205
+
206
+ **⚠️ This step does NOT prove the `identifier`s are right, so check them in step 1.** An
207
+ unrecognized `identifier` is accepted and stored: it comes back in `formFields[]` and accepts
208
+ submissions, so every API-level check passes — but the **Wix Forms editor cannot render a field
209
+ it doesn't recognize**, so the owner can't see or edit it, and a form built entirely from
210
+ invented identifiers opens **empty** in the editor. Whether such a field is also omitted from
211
+ `formSummary.fields` is unverified, so don't rely on this count to catch it. Assert every
212
+ returned `formFields[].identifier` against the known values in About Form Fields — a plain string
213
+ comparison, no extra call.
174
214
 
175
215
  3. **⚠️ If the form has a multi-choice ARRAY field (`CHECKBOX_GROUP` / `TAGS`), the two checks above
176
216
  are NOT enough — send one real `createSubmission`.** A malformed `arrayOptions.validation.items`
@@ -201,9 +241,16 @@ To change a form the request has since revised — add a field, relabel one, tig
201
241
  [Update Form](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/update-form):
202
242
 
203
243
  ```
244
+ GET https://www.wixapis.com/form-schema-service/v4/forms?namespace=wix.form_app.form&formIds={formId}
204
245
  PATCH https://www.wixapis.com/form-schema-service/v4/forms/{formId}
246
+ { "form": { …the whole object you just read, with your change…, "revision": "<its current revision>" } }
205
247
  ```
206
248
 
249
+ **Read the form back first** — the `PATCH` needs its current `revision`, and `formFields` is replaced
250
+ wholesale (anything missing from the array you send moves to `deletedFormFields`), so the read-back
251
+ *is* the body. The read needs the **required** `?namespace=wix.form_app.form`; without it it `400`s
252
+ with `namespace must not be empty` — a violation naming a field, so it misreads as a body problem.
253
+
207
254
  **Prefer updating over delete-and-recreate.** An update keeps the `formId` the handoff already
208
255
  carries and consumes no additional slot against the site's form cap. **Re-run STEP 3 after any update**
209
256
  — it can regress the layout or the dashboard summary exactly as a create can.