@wix/agent-skills 1.16.1 → 1.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +72 -8
  3. package/skills/wix-app/references/CODE_QUALITY.md +0 -1
  4. package/skills/wix-app/references/DASHBOARD_MODAL.md +21 -14
  5. package/skills/wix-app/references/DASHBOARD_PAGE.md +30 -184
  6. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +1 -0
  7. package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +172 -0
  8. package/skills/wix-app/references/dashboard-page/WDS_LAYOUT.md +187 -0
  9. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +31 -2
  10. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +6 -1
  11. package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +167 -0
  12. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -2
  13. package/skills/wix-base44-connector/SKILL.md +185 -0
  14. package/skills/wix-base44-connector/scripts/utils.js +212 -0
  15. package/skills/wix-design-system/SKILL.md +19 -15
  16. package/skills/wix-docs/SKILL.md +75 -1
  17. package/skills/wix-manage/SKILL.md +12 -16
  18. package/skills/wix-manage/references/domains/domain-search-purchase-and-connect.md +2603 -0
  19. package/skills/wix-manage/references/events/create-wix-event.md +112 -90
  20. package/skills/wix-manage/references/events/manage-wix-events.md +33 -94
  21. package/skills/wix-manage/references/sites/create-headless-site.md +1 -0
  22. package/skills/wix-manage/references/sites/manage-oauth-apps.md +154 -0
  23. package/skills/wix-manage/references/sites/read-site-context.md +125 -0
  24. package/skills/wix-manage/references/stores/create-product-catalog-v3.md +273 -0
  25. package/skills/wix-vibe-headless/install/deploy.cjs +1 -2
  26. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +104 -0
  27. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +74 -0
  28. package/skills/wix-vibe-headless/platforms/base44.md +3 -3
  29. package/skills/wix-vibe-headless/references/blog/seed/SEED.md +1 -1
  30. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +1 -1
  31. package/skills/wix-vibe-headless/references/events/seed/SEED.md +1 -1
  32. package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +1 -1
  33. package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +1 -1
  34. package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +1 -1
  35. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +68 -2
  36. package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +29 -86
  37. package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +3 -8
  38. package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +78 -105
  39. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +92 -0
  40. package/skills/wix-vibe-headless/references/storefront/app/hooks/useVariantOptions.js +76 -0
  41. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +1 -1
  42. package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +0 -326
  43. package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +0 -115
  44. package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +0 -264
  45. package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +0 -37
  46. package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +0 -86
  47. package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +0 -119
  48. package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +0 -103
  49. package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +0 -76
  50. package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +0 -82
  51. package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +0 -89
  52. package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +0 -124
  53. package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +0 -91
  54. package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +0 -71
  55. package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +0 -70
  56. package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +0 -73
  57. package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +0 -98
  58. package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +0 -278
  59. package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +0 -94
  60. package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +0 -43
  61. package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +0 -66
  62. package/skills/wix-app/references/auto-patterns-dashboard/views.md +0 -76
  63. package/skills/wix-app/scripts/generate-auto-patterns.js +0 -510
  64. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +0 -437
  65. package/skills/wix-manage/references/stores/create-product-from-image.md +0 -1031
  66. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +0 -623
  67. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +0 -106
@@ -0,0 +1,172 @@
1
+ # @wix/patterns Component Documentation
2
+
3
+ ## Prerequisites
4
+
5
+ The docs are pre-built at `node_modules/@wix/patterns/dist/docs/` (160+ markdown files + `index.json`). This requires `@wix/patterns` version **1.367.0** or later. Verify they exist:
6
+
7
+ ```bash
8
+ ls node_modules/@wix/patterns/dist/docs/ # expect ~165 .md files + index.json
9
+ ```
10
+
11
+ If the directory is missing, install the package at the minimum version:
12
+
13
+ ```bash
14
+ npm install @wix/patterns@^1.367.0
15
+ ```
16
+
17
+ ## Library Architecture
18
+
19
+ ### Composition Hierarchy
20
+
21
+ ```
22
+ Provider <- WixPatternsProvider or WixPatternsBMProvider
23
+ +-- Page <- CollectionPage, EntityPage, or SettingsPage
24
+ +-- Collection <- Table, Grid, TableGridSwitch, etc.
25
+ +-- Features <- filters, actions, sorting, drag-and-drop, etc.
26
+ ```
27
+
28
+ ### The Collection Triad
29
+
30
+ Each collection type follows the same Component + State + Hook pattern:
31
+
32
+ | Collection | Component | State Type | Hook |
33
+ |------------------|--------------------|-------------------------|---------------------------------|
34
+ | Table | `Table` | `TableState` | `useTableCollection()` |
35
+ | Grid | `Grid` | `GridState` | `useGridCollection()` |
36
+ | TableGridSwitch | `TableGridSwitch` | `TableGridSwitchState` | `useTableGridSwitchCollection()`|
37
+ | TableFolders | `TableFolders` | `TableFoldersState` | `useTableFolders()` |
38
+ | GridFolders | `GridFolders` | `GridFoldersState` | `useGridFolders()` |
39
+
40
+ This table covers the common collection types — the full, authoritative list is in `node_modules/@wix/patterns/dist/docs/index.json`.
41
+
42
+ Create state with the hook -> pass it to the component's `state` prop -> wrap in a page component.
43
+
44
+ ### Choosing the Right Provider
45
+
46
+ | Provider | When to Use |
47
+ |---------------------------------|--------------------------------------------------------------------------------------|
48
+ | `WixPatternsProvider` | **Default — start here.** Auto-detects the environment (BM, Essentials, Giza) and supplies the right context. |
49
+ | `WixPatternsBMProvider` | Optional alternative for Yoshi BM Flow over Business Manager. |
50
+ | `WixPatternsGizaProvider` | Optional alternative for Yoshi BM Flow over Giza. |
51
+ | `WixPatternsEssentialsProvider` | Yoshi Fullstack. |
52
+ | `WixPatternsBaseProvider` | App does **not** run under a Giza/WixEssentials environment and you inject services (i18n, sentry) yourself. |
53
+
54
+ Prefer `WixPatternsProvider` unless the project is on one of the specific Yoshi flows above — it is the documented recommendation for most apps, and it resolves the environment for you rather than making you pick.
55
+
56
+ **Confirm the import path in the provider's own doc file** — these do not all come from the same subpath (`WixPatternsEssentialsProvider` and `WixPatternsBaseProvider` are under `@wix/patterns/essentials`, for instance). Check the project's `package.json` to identify the flow.
57
+
58
+ ### Keep Provider and Page Separate
59
+
60
+ The provider **must** be in a separate parent component from the page content. Hooks like `useTableCollection` require the provider's context to already exist above them in the React tree.
61
+
62
+ **Wrong — provider and page in the same component:**
63
+ ```tsx
64
+ function BadApp() {
65
+ const state = useTableCollection({
66
+ queryName: 'my-items',
67
+ itemKey: (item) => item.id,
68
+ itemName: (item) => item.name,
69
+ fetchData: async () => ({ items: [], total: 0 }),
70
+ filters: {},
71
+ }); // fails at runtime — no provider context above this component
72
+ return (
73
+ <WixPatternsProvider>
74
+ <CollectionPage>
75
+ <Table state={state} columns={[{ title: 'Name', render: (item) => item.name }]} />
76
+ </CollectionPage>
77
+ </WixPatternsProvider>
78
+ );
79
+ }
80
+ ```
81
+
82
+ **Correct — provider in root, page in a separate file:**
83
+ ```tsx
84
+ // App.tsx
85
+ import { WixPatternsProvider } from '@wix/patterns/provider';
86
+
87
+ function App() {
88
+ return (
89
+ <WixPatternsProvider>
90
+ <MyCollectionPage />
91
+ </WixPatternsProvider>
92
+ );
93
+ }
94
+
95
+ // MyCollectionPage.tsx
96
+ import { Table, useTableCollection } from '@wix/patterns';
97
+ import { CollectionPage } from '@wix/patterns/page';
98
+
99
+ function MyCollectionPage() {
100
+ const state = useTableCollection({
101
+ queryName: 'my-items',
102
+ itemKey: (item) => item.id,
103
+ itemName: (item) => item.name,
104
+ fetchData: async () => ({ items: [], total: 0 }),
105
+ filters: {},
106
+ }); // works — the provider context exists above this component
107
+ return (
108
+ <CollectionPage>
109
+ <Table state={state} columns={[{ title: 'Name', render: (item) => item.name }]} />
110
+ </CollectionPage>
111
+ );
112
+ }
113
+ ```
114
+
115
+ Always keep the provider (and router if needed) in the app's root component, and each page in its own file.
116
+
117
+ When the user needs **multiple pages**, use the `@wix/patterns` routing solution (`PatternsReactRouter`, `PatternsReactRoute`, `usePatternsNavigate`) instead of a separate router. Look up the relevant doc files for setup details.
118
+
119
+ ## How to Look Things Up
120
+
121
+ **Don't guess which components or props exist — read the doc files first.**
122
+
123
+ ### Finding the right file
124
+
125
+ - **By name:** Read `node_modules/@wix/patterns/dist/docs/index.json` — it maps every component name to its doc file and category.
126
+ - **By browsing:** List the `dist/docs/` folder. Filenames match component names directly (e.g., `Table.md`, `useTableCollection.md`). Note some names contain spaces (`AI Assistant.md`) or dots (`CollectionPage.Header.md`) — quote paths when searching.
127
+ - **By concept:** Search filenames for keywords (e.g., "filter"). Check `index.json` categories — related components share a category prefix.
128
+
129
+ ### Reading doc files
130
+
131
+ Each doc contains the component's category, import path, description, code examples, and API props table. **Always check the import statement** — not everything comes from `@wix/patterns` (some use subpaths like `@wix/patterns/provider`).
132
+
133
+ ### Following cross-references
134
+
135
+ Docs contain relative Storybook URLs like `[TableState](./?path=/story/...--tablestate)`. To resolve these, **use the link text as the filename**: `[TableState](...)` -> read `TableState.md`.
136
+
137
+ Links to `https://www.docs.wixdesignsystem.com/` are external (Wix Design System) — not part of `@wix/patterns` docs.
138
+
139
+ ## The Collection → Entity Flow
140
+
141
+ A collection page and its item form are **two patterns pages**, not a page plus a modal. Getting the table right and then hand-building the "add item" form in a dashboard modal is the most common way this goes wrong.
142
+
143
+ | Step | What owns it |
144
+ | --- | --- |
145
+ | Navigate from a row / primary action to the item | `usePatternsNavigate()` → `navigateToEntityPage({ path, entity })` |
146
+ | Register the route | `PatternsReactRoute` inside `PatternsReactRouter` |
147
+ | Fetch, save, validation, dirty state, skeletons, errors | `useEntityPage({ fetch, onSave })` |
148
+ | Form state and field binding | `useForm` / `useController` from `@wix/patterns/form` |
149
+ | Body layout | `EntityPage.Header`, `.MainContent`, `.AdditionalContent`, `.Card` |
150
+ | The individual fields inside those cards | `@wix/design-system` (`FormField`, `Input`, `Text`) |
151
+
152
+ `navigateToEntityPage` is preferred over a plain route change because the entity header (title, subtitle, breadcrumbs) renders immediately, without waiting for the fetch.
153
+
154
+ Read `EntityPage.md`, `useEntityPage.md`, and `usePatternsNavigate.md` before implementing — and note that `useCreateCollection` is **not** about creating items; it returns a function that initializes collection state.
155
+
156
+ Reserve dashboard modals for genuine dialogs — delete confirmations, short prompts — not entity editing.
157
+
158
+ ## When Patterns Has No Equivalent
159
+
160
+ A concept is only "missing" from patterns after you've checked `index.json` **and** searched the docs folder by keyword. Then, and only then:
161
+
162
+ 1. Look the component up in `@wix/design-system` via the `wix-design-system` skill.
163
+ 2. Render it *inside* the patterns page shell / collection, not as a replacement for it.
164
+ 3. If WDS lacks it too, compose from WDS primitives (`Box`, `Card`, `Text`) — never restyle patterns internals or add another UI library.
165
+
166
+ Anything page- or collection-shaped (page shell, header, table, grid, filters, sorting, paging, row actions, bulk actions) is patterns' territory. If you're about to build one of those from WDS parts, you skipped a lookup.
167
+
168
+ ## Tips
169
+
170
+ - **Compound components** have separate docs per sub-part: `CollectionPage.md`, `CollectionPage.Header.md`, `CollectionPage.Content.md`.
171
+ - **Hook docs** list configuration options as props in the API table.
172
+ - **Type docs** (e.g., `TableState.md`) describe the shape of state objects.
@@ -0,0 +1,187 @@
1
+ # Dashboard Page Layout Guidelines
2
+
3
+ Layout and spacing guidance for dashboard page content. Wix Design System design language — the 6px base unit, the 12-column grid, spacing tokens, and the common content layouts.
4
+
5
+ > **Scope — read this in the right order.** On a dashboard page, `@wix/patterns` owns the page shell (`CollectionPage` / `EntityPage` / `SettingsPage`) and everything collection-shaped: tables, grids, filters, sorting, paging, row and bulk actions, empty states. This file describes how to lay out content **inside** that shell. It is not a licence to build the shell, a table, or a filter bar out of raw WDS — see [Component Selection Order](../../SKILL.md#component-selection-order) and [WIX_PATTERNS_DOCS.md](../WIX_PATTERNS_DOCS.md) first.
6
+ >
7
+ > Where a patterns page component already establishes structure (page header, content area, sticky footer, table/grid layout), follow the patterns component's own API rather than reproducing the grid by hand. Use the guidance below for the parts patterns leaves to you: cards, forms, statistics rows, marketing sections, and spacing between them.
8
+
9
+
10
+ Layout determines how users interact with your dashboard content. It establishes the structure, hierarchy, and rhythm of your dashboard page, contributing to the overall coherence and user experience. By making mindful and calculated choices in how you organize your content, users can move around more smoothly, saving time and frustration when completing tasks.
11
+
12
+ ### Design Principles
13
+
14
+ To create dashboard pages optimized for user experience, follow these design principles:
15
+
16
+ 1. **Consistent:** Maintain repetitive layouts and content patterns for intuitive and easy-to-read pages.
17
+ 2. **Inclusive:** Create layouts and content that adapt well to various screen sizes.
18
+ 3. **Balanced:** Emphasize the priority of regions and content elements through deliberate management of size and white space.
19
+ 4. **Connected:** Minimize the distance between related regions or content elements to enhance cohesion and navigation.
20
+
21
+
22
+ ### Screen Size
23
+
24
+ Dashboard pages are designed to accommodate various screen sizes rather than being tailored to one specific resolution. The primary content should be at the top of the page to ensure users immediately understand the purpose of the page.
25
+
26
+ > **Note:** Content displayed in the top 600 pixels of the page will be visible for the majority of users.
27
+
28
+
29
+ ### Base Unit
30
+
31
+ The base unit establishes the increment by which all elements and measurements are multiplied. This practice ensures consistency in the spacing and sizing of design elements.
32
+
33
+ > **Note:** The design system is based on a 6px unit.
34
+
35
+ The layout grid, spacing tokens, and nearly all visual elements and sizes adhere to multiples of six (6, 12, 18, 24, etc.), with only occasional exceptions.
36
+
37
+ | TOKEN | SIZE | USE FOR |
38
+ |-------|------|---------|
39
+ | SP1 | 6px | Spacing between components |
40
+ | SP2 | 12px | Spacing between components |
41
+ | SP3 | 18px | Spacing between components |
42
+ | SP4 | 24px | Spacing between components, layout spacing |
43
+ | SP5 | 30px | Layout spacing |
44
+ | SP6 | 36px | Layout spacing |
45
+ | SP7 | 42px | Layout spacing |
46
+ | SP8 | 48px | Layout spacing |
47
+ | SP10 | 54px | Layout spacing |
48
+ | SP11 | 60px | Layout spacing |
49
+
50
+
51
+ ### Layout Structure
52
+
53
+ To best design the layout for your app, understand:
54
+
55
+ 1. The core frame of the app (Application frame)
56
+ 2. The placement and alignment of each segment within the grid layout (Grid layout)
57
+ 3. The content to appear in the grid (Common layouts)
58
+
59
+ #### Application Frame
60
+
61
+ The dashboard app frame is used by the majority of Wix applications settings. Dashboard pages consist of 4 areas:
62
+
63
+ | AREA | USAGE |
64
+ |------|-------|
65
+ | 1. Global navigation (top bar) | General navigation at the top of a page which allows users to navigate between different environments. Full width container with a fixed height of 48px. |
66
+ | 2. Sidebar navigation | Local navigation of an environment. Container with a fixed width of 228px. |
67
+ | 3. Content area | Page content area with a width that's adaptive to screen size. |
68
+ | 4. Side panel (optional) | An optional panel that shows additional actions or content associated with the content of a page. Fixed width of 420px. Can either overlay the main content area or push it from the right side. |
69
+
70
+ **Side Panel Guidelines:**
71
+ - Let the side panel overlay main content when it contains supplementary actions or settings, such as data filters
72
+ - Push main content with the side panel when users must see the full context to continue
73
+
74
+
75
+ #### Grid Layout
76
+
77
+ The system uses a fluid grid layout with a fixed maximum width. It uses columns that scale and resize the content accordingly.
78
+
79
+ The grid is constructed from 3 elements:
80
+ - **Columns** - The design system uses a 12-column grid. Column width is fluid and changes according to the page width.
81
+ - **Gutters** - The gaps between the columns. Gutter width has a fixed value of 24px.
82
+ - **Margins** - By default, a page's content area has 48px side margins and a 48px bottom margin.
83
+
84
+ **Grid Specifications:**
85
+ - Minimum content area width: 864 pixels (each grid column is 50px wide)
86
+ - Maximum content area width: 1248px (each column is 82px wide)
87
+ - Wider screens maintain 1248px content width with side margins stretching to center content
88
+ - Use 24px gap between cards both vertically and horizontally
89
+
90
+
91
+ ### Common Layouts
92
+
93
+ Page layouts can be divided by intention into the following types:
94
+
95
+ #### 1. Form Layouts
96
+
97
+ Forms are pages that allow users to fill in data or edit existing data. Two variations:
98
+
99
+ - **2/3 layout with optional sidebar (8/4 column split)** - Provides flexibility to expose primary and secondary content at the same time
100
+ - **Full width (12 columns)** - Supports advanced product needs with complex structures
101
+
102
+ Both form page layouts include mandatory **Save** and **Cancel** actions in the header and footer areas.
103
+
104
+ **2/3 Layout Best Practices:**
105
+ - Use to expose primary and secondary content at the same time
106
+ - Keep the form easy to scan and comprehend
107
+ - Display a live content preview on the side (widget can be sticky)
108
+ - Use 8 columns for forms to keep text lines and input fields narrow for quicker reading
109
+ - Bring actions closer to related titles (e.g., toggle switches near settings)
110
+
111
+ **Full Width Layout Best Practices:**
112
+ - Use when a form includes complex structures such as tables
113
+ - Use for list items that contain many data columns
114
+
115
+ **Combining Layouts:**
116
+ - Avoid coast-to-coast inputs; keep inputs to 2/3 width of a card, or lay them out in two columns
117
+ - Use white space on the right side for content preview
118
+ - Use full width for tables with many columns and dividers that separate sections
119
+
120
+ > **Note:** A column is easy to read if it is wide enough to accommodate an average of 10 words per line.
121
+
122
+ #### 2. Display Layouts
123
+
124
+ Display pages showcase data or content without accepting input from users. They can contain minor actions such as data filtering.
125
+
126
+ **List (Table):**
127
+ - Tables display large data sets and provide users with a quick overview
128
+ - Use a 12-column layout for tables
129
+ - Enables users to manipulate and act on a data set
130
+
131
+ **List (Grid) Options:**
132
+ - 2 columns (6/6 split) - For items with lengthy descriptions
133
+ - 3 columns (4/4/4 split) - For visual items with multiple data types
134
+ - 4 columns (3/3/3/3 split) - For user-generated galleries and collections, reveals up to 50% more content above the fold than 4/4/4
135
+ - Custom - For mixed content needs
136
+
137
+ **Grid Selection Considerations:**
138
+ - Total amount of items to show
139
+ - Content to display in each list item
140
+ - What objects the list items reflect (match physical shapes when applicable)
141
+
142
+ **Dashboards:**
143
+ Display different types of data on a specific topic using a combination grid.
144
+
145
+ Column span recommendations:
146
+ - **3 or 4 columns** - For list items, previews, marketing, statistics, and charts
147
+ - **12 columns (full width)** - For tables and marketing content
148
+ - **8 columns** - For lists, tables with few data columns, setup wizards, and charts
149
+ - **6 columns** - For lists, tables with few data columns, and statistics
150
+
151
+ **Empty States:**
152
+ - Use full width layout for empty state of a page
153
+ - Indicates feature/product has no data yet, all data cleared, or not set up yet
154
+ - Include clear CTA indicating what to do to fill the page
155
+ - Can combine with other layout elements such as tabs, statistics widgets, or marketing cards
156
+
157
+ #### 3. Marketing Layouts
158
+
159
+ Marketing pages promote new products that site owners are not aware of yet. Built using the `<MarketingPageLayout/>` component split into 2 columns:
160
+
161
+ 1. Promo messaging
162
+ 2. Visual representation of product and features
163
+
164
+ Optional footer area can display features or testimonials list.
165
+
166
+ #### 4. Wizard Layouts
167
+
168
+ Wizard pages guide users through setting up a product or feature. They split complex forms into steps for easier completion.
169
+
170
+ **Entry Points:**
171
+ - A marketing page
172
+ - A marketing card
173
+ - The primary action of a page
174
+ - An empty state
175
+
176
+ > **Note:** Wizards must have a final destination. After completing all steps, users should end up on a relevant page: a dashboard, a details page, or any other relevant location.
177
+
178
+
179
+ ### Related WDS Components (content inside the shell)
180
+
181
+ These are content-level building blocks. They do **not** replace the `@wix/patterns` page shell.
182
+
183
+ - `<Layout />` / `<Cell />` - Grid layout container for content within a page's content area
184
+ - `<Card />` - Content container with 24px gaps between cards
185
+ - `<MarketingPageLayout />` - Marketing page wrapper (marketing pages only — these have no collection, so no patterns shell applies)
186
+
187
+ > **On WDS `<Page />`:** do not use it as the wrapper for a `@wix/patterns` dashboard page. The patterns page component (`CollectionPage` / `EntityPage` / `SettingsPage`) is the shell and already provides the header, content area, and scroll behavior. Reach for WDS `<Page />` only on a page that uses no patterns shell at all.
@@ -32,7 +32,7 @@ implementation detail.
32
32
 
33
33
  1. **Props** — `autoPlay`, `loop`, `pauseButtonVisibility`
34
34
  2. **Playback state** — `isPlaying` + `handlePause` / `handleResume`
35
- 3. **Play/pause button** — overlay `<button>` with inline SVG icon + CSS positioning and optional hover-only visibility
35
+ 3. **Play/pause button** — overlay `<button>` with inline SVG icon + CSS positioning and optional hover-only visibility; **must be a named part** (`classNames('component-name-play-button', styles.playButton)`) with hover/focus design-state selectors
36
36
  4. **Modify `component.preview.tsx`** — suppress autoplay in editor design mode
37
37
  5. **Respect `prefers-reduced-motion`** — suppress autoplay when the OS requests reduced motion
38
38
 
@@ -117,10 +117,39 @@ Position the button absolutely so it overlays the content without pushing other
117
117
  inset-inline-end: 5px;
118
118
  inset-block-start: 5px;
119
119
  }
120
+
121
+ /* Design-state selectors: pair native pseudo-class with editor-injected modifier class.
122
+ The editor applies the modifier class (e.g. my-animation-play-button--hover) when
123
+ the site owner previews that state in the design panel, so both selectors must exist. */
124
+ .playButton:global(.my-animation-play-button--hover),
125
+ .playButton:hover {
126
+ /* e.g. background: rgba(255, 255, 255, 1); */
127
+ }
128
+
129
+ .playButton:global(.my-animation-play-button--focus),
130
+ .playButton:focus-visible {
131
+ outline: 2px solid currentColor;
132
+ outline-offset: 2px;
133
+ }
134
+ ```
135
+
136
+ ```tsx
137
+ {/* ✅ Named part: play/pause is always a named part — site owners can style it independently */}
138
+ <button
139
+ type="button"
140
+ className={classNames('my-animation-play-button', styles.playButton)}
141
+ onClick={isPlaying ? handlePause : handleResume}
142
+ aria-label={isPlaying ? 'Pause' : 'Play'}
143
+ >
144
+ {isPlaying ? <PauseIcon /> : <PlayIcon />}
145
+ </button>
120
146
  ```
121
147
 
122
148
  ```css
123
- /* pauseButtonVisibility variants — structural CSS, not named-part rules */
149
+ /* pauseButtonVisibility visibility behavior — descendant CSS is allowed here
150
+ because these rules control the button's *visibility*, not its styling surface.
151
+ The button itself is a named part (classNames('...-play-button', styles.playButton))
152
+ and must carry both a global class and design-state selectors (see above). */
124
153
 
125
154
  /* showOnHover (default) */
126
155
  .root[data-pause-button-visibility="showOnHover"] .playButton {
@@ -187,6 +187,12 @@ When creating TypeScript interfaces for component props, use types from `@wix/ed
187
187
  import type { Link } from "@wix/editor-react-types"; // Reference at node_modules/@wix/react-component-schema/dist/editor-react-types.d.ts
188
188
  ```
189
189
 
190
+ For **function event handler props** (`onClick`, `onDblClick`, `onChange`, `onFocus`, `onBlur`, `onMouseIn`, `onMouseOut`) and custom callbacks, follow [`FUNCTION-HANDLERS.md`](FUNCTION-HANDLERS.md). Key rules:
191
+
192
+ - Use the exact SDK prop names from that file — the manifest system recognizes them
193
+ - Wire them to the correct DOM events (note: `onDblClick` → `onDoubleClick`, `onMouseIn` → `onMouseEnter`, `onMouseOut` → `onMouseLeave`)
194
+ - Custom callbacks not tied to DOM events use `() => void` (no React event parameter)
195
+
190
196
  ### External resources are forbidden
191
197
 
192
198
  All resources rendered or fetched by the component (images, icons, fonts,
@@ -476,4 +482,3 @@ interface ComponentProps {
476
482
  ```
477
483
 
478
484
  See also: [Array Element Types: Always Objects with Named Keys](#array-element-types-always-objects-with-named-keys) — items must be objects with named keys.
479
-
@@ -0,0 +1,167 @@
1
+ # Function Event Handlers
2
+
3
+ Rules and patterns for adding function event handler props to an Editor React component's TypeScript interface, wiring them to DOM events, and declaring custom callbacks.
4
+
5
+ ---
6
+
7
+ ## Rules
8
+
9
+ ### Standard SDK Event Handlers
10
+
11
+ These are the standard event handler props the editor SDK exposes to site owners. Use the exact prop names — ZeroConfig and the manifest system recognize them.
12
+
13
+ | Prop name | React DOM event | Type |
14
+ | ------------ | --------------- | ------------------------------------------------ |
15
+ | `onClick` | `onClick` | `(event: React.MouseEvent) => void` |
16
+ | `onDblClick` | `onDoubleClick` | `(event: React.MouseEvent) => void` |
17
+ | `onChange` | `onChange` | `(event: React.ChangeEvent<HTMLElement>) => void` |
18
+ | `onFocus` | `onFocus` | `(event: React.FocusEvent) => void` |
19
+ | `onBlur` | `onBlur` | `(event: React.FocusEvent) => void` |
20
+ | `onMouseIn` | `onMouseEnter` | `(event: React.MouseEvent) => void` |
21
+ | `onMouseOut` | `onMouseLeave` | `(event: React.MouseEvent) => void` |
22
+
23
+ Three props have a **name mismatch** between the SDK prop and the DOM event: `onDblClick` → `onDoubleClick`, `onMouseIn` → `onMouseEnter`, `onMouseOut` → `onMouseLeave`.
24
+
25
+ ### Declaring Standard Handler Props
26
+
27
+ Declare standard handlers inline with the exact SDK prop names and React event types:
28
+
29
+ ```typescript
30
+ interface MyComponentProps {
31
+ label?: string;
32
+ onClick?: (event: React.MouseEvent) => void;
33
+ onDblClick?: (event: React.MouseEvent) => void;
34
+ onChange?: (event: React.ChangeEvent<HTMLElement>) => void;
35
+ onFocus?: (event: React.FocusEvent) => void;
36
+ onBlur?: (event: React.FocusEvent) => void;
37
+ onMouseIn?: (event: React.MouseEvent) => void;
38
+ onMouseOut?: (event: React.MouseEvent) => void;
39
+ }
40
+ ```
41
+
42
+ Only declare handlers the component actually exposes. Do not add all seven if the component only handles two.
43
+
44
+ ### Wiring Standard Handlers to DOM Events
45
+
46
+ Destructure the props and pass them to the correct DOM event — applying the name mappings:
47
+
48
+ ```typescript
49
+ export const MyComponent = (props: MyComponentProps) => {
50
+ const { onClick, onDblClick, onFocus, onBlur, onMouseIn, onMouseOut } = props;
51
+ return (
52
+ <div
53
+ onClick={onClick}
54
+ onDoubleClick={onDblClick}
55
+ onFocus={onFocus}
56
+ onBlur={onBlur}
57
+ onMouseEnter={onMouseIn}
58
+ onMouseLeave={onMouseOut}
59
+ >
60
+ {/* ... */}
61
+ </div>
62
+ );
63
+ };
64
+ ```
65
+
66
+ ### Custom Callbacks
67
+
68
+ Component-specific callbacks that do not correspond to a DOM event (e.g., `onPlay`, `onPause`, `onEnded`, `onTimeupdate`) are **not** standard SDK event handlers. Type them as `() => void` — no React event parameter:
69
+
70
+ ```typescript
71
+ interface VideoPlayerProps {
72
+ onPlay?: () => void;
73
+ onPause?: () => void;
74
+ onEnded?: () => void;
75
+ }
76
+ ```
77
+
78
+ Pass them directly to the underlying element — no name remapping needed:
79
+
80
+ ```typescript
81
+ export const VideoPlayer = (props: VideoPlayerProps) => {
82
+ const { onPlay, onPause, onEnded } = props;
83
+ return <video onPlay={onPlay} onPause={onPause} onEnded={onEnded} />;
84
+ };
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Common Mistakes
90
+
91
+ ### Passing SDK prop name directly to DOM instead of remapping
92
+
93
+ **❌ Wrong:**
94
+
95
+ ```typescript
96
+ export const MyComponent = (props: MyComponentProps) => {
97
+ const { onMouseIn, onMouseOut, onDblClick } = props;
98
+ return (
99
+ <div
100
+ onMouseIn={onMouseIn} // ❌ not a valid React DOM prop
101
+ onMouseOut={onMouseOut} // ❌ not a valid React DOM prop
102
+ onDblClick={onDblClick} // ❌ not a valid React DOM prop
103
+ />
104
+ );
105
+ };
106
+ ```
107
+
108
+ **✅ Correct:**
109
+
110
+ ```typescript
111
+ export const MyComponent = (props: MyComponentProps) => {
112
+ const { onMouseIn, onMouseOut, onDblClick } = props;
113
+ return (
114
+ <div
115
+ onMouseEnter={onMouseIn} // ✅ onMouseIn → onMouseEnter
116
+ onMouseLeave={onMouseOut} // ✅ onMouseOut → onMouseLeave
117
+ onDoubleClick={onDblClick} // ✅ onDblClick → onDoubleClick
118
+ />
119
+ );
120
+ };
121
+ ```
122
+
123
+ ### Adding a React event parameter to custom callbacks
124
+
125
+ **❌ Wrong:**
126
+
127
+ ```typescript
128
+ interface VideoPlayerProps {
129
+ onPlay?: (event: React.SyntheticEvent) => void; // ❌ event param on custom callback
130
+ onEnded?: (event: React.SyntheticEvent) => void; // ❌ event param on custom callback
131
+ }
132
+ ```
133
+
134
+ **✅ Correct:**
135
+
136
+ ```typescript
137
+ interface VideoPlayerProps {
138
+ onPlay?: () => void; // ✅ no event param
139
+ onEnded?: () => void; // ✅ no event param
140
+ }
141
+ ```
142
+
143
+ **Why:** Custom callbacks are component-level notifications to the site owner, not DOM event forwarders. They carry no event object — the SDK passes no event to them.
144
+
145
+ ### Using the DOM event name as the SDK prop name
146
+
147
+ **❌ Wrong:**
148
+
149
+ ```typescript
150
+ interface MyComponentProps {
151
+ onDoubleClick?: (event: React.MouseEvent) => void; // ❌ DOM name, not SDK name
152
+ onMouseEnter?: (event: React.MouseEvent) => void; // ❌ DOM name, not SDK name
153
+ onMouseLeave?: (event: React.MouseEvent) => void; // ❌ DOM name, not SDK name
154
+ }
155
+ ```
156
+
157
+ **✅ Correct:**
158
+
159
+ ```typescript
160
+ interface MyComponentProps {
161
+ onDblClick?: (event: React.MouseEvent) => void; // ✅ SDK prop name
162
+ onMouseIn?: (event: React.MouseEvent) => void; // ✅ SDK prop name
163
+ onMouseOut?: (event: React.MouseEvent) => void; // ✅ SDK prop name
164
+ }
165
+ ```
166
+
167
+ **Why:** The SDK prop names (`onDblClick`, `onMouseIn`, `onMouseOut`) are what ZeroConfig and the manifest system register. Using DOM names breaks the editor's event wiring.
@@ -9,6 +9,7 @@ This guide defines rules and guidance on **how to implement** production-quality
9
9
  - [`DIRECTIONALITY.md`](DIRECTIONALITY.md) — RTL/LTR rules and patterns
10
10
  - [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) — What should be a React prop vs CSS
11
11
  - [`COMPONENT-API.md`](COMPONENT-API.md) — Props structure, elementProps, data types, file splitting, containers, array props
12
+ - [`FUNCTION-HANDLERS.md`](FUNCTION-HANDLERS.md) — Standard SDK event handler props, DOM wiring, custom callbacks
12
13
  - [`ANIMATED-COMPONENTS.md`](ANIMATED-COMPONENTS.md) — Play/pause control and autoplay for animated/playable components
13
14
  - [`REACT-PATTERNS.md`](REACT-PATTERNS.md) — SSR-safe patterns, CSS rules, common mistakes
14
15
 
@@ -110,7 +111,7 @@ Unless explicitly specified as a component capability/API in the specification,
110
111
  **External handlers (only when specified):**
111
112
 
112
113
  - Only expose handlers that are explicitly listed as component capabilities
113
- - Example: If specification says "onClick callback for external control", then add `onClick?: () => void` to props
114
+ - Use the standard SDK prop names and DOM wiring rules from [`FUNCTION-HANDLERS.md`](FUNCTION-HANDLERS.md)
114
115
 
115
116
  **Child component handlers:**
116
117
 
@@ -170,4 +171,3 @@ See [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) and [`COMPONENT-API.md`](COMPONENT-API.
170
171
  **Phase 2: Component File** — Apply all §1.1 mandatory features and §1.2 implementation standards; toggle custom-state classes from data ([`DESIGN-STATES.md`](DESIGN-STATES.md))
171
172
 
172
173
  **Phase 3: Styles** — Apply Part 2 SCSS rules, including state styles ([`DESIGN-STATES.md`](DESIGN-STATES.md)). If the request uses the words **branded**, **themed**, or **brand-aware**, also apply [`BRANDED-COMPONENTS.md`](BRANDED-COMPONENTS.md) before writing CSS.
173
-