@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 +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +72 -92
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +29 -14
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +57 -10
- package/skills/wix-manage/SKILL.md +100 -92
- package/skills/wix-manage/references/dashboard-navigation/routes.json +12 -52
- package/skills/wix-manage/references/ecommerce/shipping/ecom-shipping-api.md +0 -2
- package/skills/wix-manage/references/forms/create-form.md +272 -184
- package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +13 -10
- package/skills/wix-manage/references/forms/update-form.md +122 -0
- package/skills/wix-manage/references/media/generate-image-with-ai.md +86 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +16 -1
- package/skills/wix-vibe-headless/platforms/base44.md +4 -0
- package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +23 -7
- package/skills/wix-vibe-headless/references/forms/seed/SEED.md +90 -16
package/package.json
CHANGED
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
# Wix Editor React Component Builder
|
|
2
2
|
|
|
3
|
-
Build Editor React Components for Harmony
|
|
4
|
-
|
|
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.
|
|
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 |
|
|
20
|
-
| `<component-name>.tsx` | Edit |
|
|
21
|
-
| `<component-name>.module.css` | Edit |
|
|
22
|
-
| `component.tsx` | Keep generated | Wire
|
|
23
|
-
| `component.preview.tsx` | Edit narrowly |
|
|
24
|
-
| `<component-name>.generated.ts` | NEVER edit | Generated manifest
|
|
25
|
-
| `<component-name>.extension.ts` | Edit narrowly |
|
|
26
|
-
|
|
27
|
-
Supplementary files
|
|
28
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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
|
|
51
|
-
|
|
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
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
89
|
-
|
|
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
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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),
|
|
109
|
-
| Editing React or JSX | [`REACT-GUIDELINES.md`](editor-react-component/REACT-GUIDELINES.md)
|
|
110
|
-
| Changing
|
|
111
|
-
| Changing public data props or
|
|
112
|
-
|
|
|
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
|
-
|
|
|
115
|
-
|
|
|
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
|
-
|
|
|
122
|
-
| Public event callbacks
|
|
123
|
-
| Browser APIs, effects, or time-dependent output
|
|
124
|
-
|
|
|
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
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
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
|
-
##
|
|
114
|
+
## Non-Negotiables
|
|
132
115
|
|
|
133
|
-
-
|
|
116
|
+
- React 18 only; do not assume React 19 runtime features.
|
|
134
117
|
- Include typed `id`, `className`, `direction`, and `a11y` support.
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- Route ARIA through
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
|
|
153
|
-
|
|
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.
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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": {
|
|
100
|
-
"
|
|
101
|
-
|
|
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
|
-
-
|
|
130
|
-
|
|
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`**
|
|
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
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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.
|