@wix/agent-skills 1.16.1 → 1.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +72 -8
- package/skills/wix-app/references/CODE_QUALITY.md +0 -1
- package/skills/wix-app/references/DASHBOARD_MODAL.md +21 -14
- package/skills/wix-app/references/DASHBOARD_PAGE.md +30 -184
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +14 -6
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +6 -0
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +172 -0
- package/skills/wix-app/references/dashboard-page/WDS_LAYOUT.md +187 -0
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +32 -2
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +38 -1
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +27 -4
- package/skills/wix-app/references/editor-react-component/FUNCTION-HANDLERS.md +167 -0
- package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +19 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +1 -2
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -2
- package/skills/wix-base44-connector/SKILL.md +185 -0
- package/skills/wix-base44-connector/scripts/utils.js +212 -0
- package/skills/wix-design-system/SKILL.md +19 -15
- package/skills/wix-docs/SKILL.md +75 -1
- package/skills/wix-manage/SKILL.md +16 -18
- package/skills/wix-manage/references/bookings/create-class-service.md +1 -1
- package/skills/wix-manage/references/domains/domain-search-purchase-and-connect.md +2603 -0
- package/skills/wix-manage/references/events/create-wix-event.md +112 -90
- package/skills/wix-manage/references/events/manage-wix-events.md +33 -94
- package/skills/wix-manage/references/rich-content/author-ricos-rich-content.md +182 -5
- package/skills/wix-manage/references/sites/create-headless-site.md +1 -0
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +154 -0
- package/skills/wix-manage/references/sites/read-site-context.md +125 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +273 -0
- package/skills/wix-vibe-headless/install/deploy.cjs +1 -2
- package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +104 -0
- package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +74 -0
- package/skills/wix-vibe-headless/platforms/base44.md +3 -3
- package/skills/wix-vibe-headless/references/blog/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/events/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +1 -1
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +68 -2
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +29 -86
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +3 -8
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +78 -105
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +92 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useVariantOptions.js +76 -0
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +1 -1
- package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +0 -326
- package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +0 -115
- package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +0 -264
- package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +0 -37
- package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +0 -86
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +0 -119
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +0 -103
- package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +0 -76
- package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +0 -82
- package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +0 -89
- package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +0 -124
- package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +0 -91
- package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +0 -71
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +0 -70
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +0 -73
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +0 -98
- package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +0 -278
- package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +0 -94
- package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +0 -43
- package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +0 -66
- package/skills/wix-app/references/auto-patterns-dashboard/views.md +0 -76
- package/skills/wix-app/scripts/generate-auto-patterns.js +0 -510
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +0 -437
- package/skills/wix-manage/references/stores/create-product-from-image.md +0 -1031
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +0 -623
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +0 -106
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Custom Columns Override Rules
|
|
2
|
-
|
|
3
|
-
**REQUIRED**: After creating column files, you MUST update `page.tsx` to register them.
|
|
4
|
-
|
|
5
|
-
## Type Definitions
|
|
6
|
-
```typescript
|
|
7
|
-
interface IColumnValue<T> {
|
|
8
|
-
value: T; // The individual column value
|
|
9
|
-
row: Record<string, any>; // The entire row object containing all field values
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Override Function Signature
|
|
13
|
-
type ColumnOverride<T> = (props: IColumnValue<T>) => React.ReactNode;
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Configuration Schema
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"type": "collectionPage",
|
|
20
|
-
"collectionPage": {
|
|
21
|
-
"components": [
|
|
22
|
-
{
|
|
23
|
-
"layout": [
|
|
24
|
-
{
|
|
25
|
-
"type": "Table",
|
|
26
|
-
"table": {
|
|
27
|
-
"columns": [
|
|
28
|
-
{
|
|
29
|
-
"id": "myCustomColumn" // Matches key in override object
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Validation Logic
|
|
42
|
-
- **IF** overriding a column **THEN** function name MUST match the `column.id` in AppConfig.
|
|
43
|
-
- **IF** needing React hooks (useState, useEffect) **THEN** MUST wrap implementation in a separate React component and return it.
|
|
44
|
-
- **IF** accessing row data **THEN** MUST use exact field IDs from schema as keys on `row` object.
|
|
45
|
-
- **NEVER** use React hooks directly inside the column override function (it is a render function, not a component).
|
|
46
|
-
|
|
47
|
-
## Implementation Rules
|
|
48
|
-
- **MUST** be placed in `components/columns/` folder.
|
|
49
|
-
- **MUST** export a `useColumns` hook from `components/columns/index.tsx`.
|
|
50
|
-
- **MUST** import type `IColumnValue` from `@wix/auto-patterns` for type safety.
|
|
51
|
-
- **MUST** return a ReactNode (JSX) or null.
|
|
52
|
-
|
|
53
|
-
## Canonical Example
|
|
54
|
-
```tsx
|
|
55
|
-
// components/columns/status.tsx
|
|
56
|
-
import type { IColumnValue } from '@wix/auto-patterns';
|
|
57
|
-
import { Badge } from '@wix/design-system';
|
|
58
|
-
|
|
59
|
-
export function status({ value, row }: IColumnValue<string>) {
|
|
60
|
-
// Pure rendering logic - NO HOOKS here
|
|
61
|
-
const skin = value === 'Active' ? 'success' : 'danger';
|
|
62
|
-
return <Badge skin={skin}>{value}</Badge>;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// components/columns/index.tsx
|
|
66
|
-
import { status } from './status';
|
|
67
|
-
export const useColumns = () => ({ status });
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## page.tsx Registration (REQUIRED)
|
|
71
|
-
|
|
72
|
-
**CRITICAL: PRESERVE EXISTING OVERRIDES** - Do NOT remove existing overrides. ADD this new one alongside them.
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
// 1. Add import (keep all existing imports)
|
|
76
|
-
import { useColumns } from './components/columns';
|
|
77
|
-
|
|
78
|
-
// 2. Add hook call (keep all existing hook calls)
|
|
79
|
-
const columns = useColumns();
|
|
80
|
-
|
|
81
|
-
// 3. Add columns to PatternsWizardOverridesProvider value (keep ALL existing overrides)
|
|
82
|
-
```
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Custom Components Override Rules
|
|
2
|
-
|
|
3
|
-
**REQUIRED**: After creating component files, you MUST update `page.tsx` to register them.
|
|
4
|
-
|
|
5
|
-
## Type Definitions
|
|
6
|
-
```typescript
|
|
7
|
-
interface CustomComponentProps {
|
|
8
|
-
form: UseFormReturn; // react-hook-form instance
|
|
9
|
-
entity: Record<string, any>; // Initial entity state (static)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Override Component Signature
|
|
13
|
-
type CustomComponent = React.FC<CustomComponentProps>;
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Configuration Schema
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"layout": [
|
|
20
|
-
{
|
|
21
|
-
"type": "Form",
|
|
22
|
-
"form": {
|
|
23
|
-
"groups": [
|
|
24
|
-
{
|
|
25
|
-
"fields": [
|
|
26
|
-
{
|
|
27
|
-
"id": "myCustomField",
|
|
28
|
-
"type": "custom",
|
|
29
|
-
"componentId": "myCustomComponent" // Matches override key
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Validation Logic
|
|
41
|
-
- **IF** overriding an input field **THEN** MUST use `useController` from `@wix/patterns/form` to bind to form state.
|
|
42
|
-
- **IF** needing reactivity **THEN** MUST use `form.watch()`, NEVER rely on `entity` prop for updates (it is initial state only).
|
|
43
|
-
- **IF** implementing a standalone widget (not input) **THEN** can use `entity` for display-only static data.
|
|
44
|
-
- **NEVER** import `useController` from `react-hook-form` directly; use `@wix/patterns/form`.
|
|
45
|
-
|
|
46
|
-
## Implementation Rules
|
|
47
|
-
- **MUST** be placed in `components/customComponents/` folder.
|
|
48
|
-
- **MUST** export a `useComponents` hook from `components/customComponents/index.tsx`.
|
|
49
|
-
- **MUST** handle form state (invalid, error message, onChange) properly via controller.
|
|
50
|
-
|
|
51
|
-
## Canonical Example
|
|
52
|
-
```tsx
|
|
53
|
-
// components/customComponents/CustomInput.tsx
|
|
54
|
-
import { useController } from '@wix/patterns/form';
|
|
55
|
-
import type { CustomComponentProps } from '@wix/auto-patterns';
|
|
56
|
-
import { Input, FormField } from '@wix/design-system';
|
|
57
|
-
|
|
58
|
-
export const CustomInput: React.FC<CustomComponentProps> = ({ form, entity }) => {
|
|
59
|
-
const { field, fieldState } = useController({
|
|
60
|
-
name: 'title', // Matches schema field ID
|
|
61
|
-
control: form.control,
|
|
62
|
-
defaultValue: entity?.title
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<FormField label="Title" status={fieldState.error ? 'error' : undefined}>
|
|
67
|
-
<Input {...field} />
|
|
68
|
-
</FormField>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// components/customComponents/index.tsx
|
|
73
|
-
import { CustomInput } from './CustomInput';
|
|
74
|
-
export const useComponents = () => ({ CustomInput });
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## page.tsx Registration (REQUIRED)
|
|
78
|
-
|
|
79
|
-
**CRITICAL: PRESERVE EXISTING OVERRIDES** - Do NOT remove existing overrides. ADD this new one alongside them.
|
|
80
|
-
|
|
81
|
-
```tsx
|
|
82
|
-
// 1. Add import (keep all existing imports)
|
|
83
|
-
import { useComponents } from './components/customComponents';
|
|
84
|
-
|
|
85
|
-
// 2. Add hook call (keep all existing hook calls)
|
|
86
|
-
const components = useComponents();
|
|
87
|
-
|
|
88
|
-
// 3. Add components to PatternsWizardOverridesProvider value (keep ALL existing overrides)
|
|
89
|
-
```
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# Custom Entity Header Override Rules
|
|
2
|
-
|
|
3
|
-
**REQUIRED**: After creating header override files, you MUST update `page.tsx` to register them.
|
|
4
|
-
|
|
5
|
-
## Type Definitions
|
|
6
|
-
```typescript
|
|
7
|
-
// Subtitle Override
|
|
8
|
-
type SubtitleResolver = (entity: Record<string, any>) => { text: string };
|
|
9
|
-
|
|
10
|
-
// Badge Override
|
|
11
|
-
interface BadgeObject {
|
|
12
|
-
text: string; // Required: Text to display
|
|
13
|
-
skin?: BadgeSkin; // Optional: Visual styling
|
|
14
|
-
prefixIcon?: React.ReactElement; // Optional: Icon before text (from @wix/wix-ui-icons-common)
|
|
15
|
-
suffixIcon?: React.ReactElement; // Optional: Icon after text (from @wix/wix-ui-icons-common)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type BadgeSkin = 'success' | 'warning' | 'destructive' | 'neutral' | 'premium';
|
|
19
|
-
|
|
20
|
-
type BadgesResolver = (entity: Record<string, any>) => BadgeObject[];
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Configuration Schema
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"entityPage": {
|
|
27
|
-
"title": {
|
|
28
|
-
"text": "Entity Details",
|
|
29
|
-
"badges": {
|
|
30
|
-
"id": "entityPageHeaderBadges" // Must match override key
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"subtitle": {
|
|
34
|
-
"text": "Default subtitle text",
|
|
35
|
-
"id": "entityPageHeaderSubtitle" // Must match override key
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Validation Logic
|
|
42
|
-
- **IF** overriding subtitle **THEN** function MUST return `{ text: string }` object.
|
|
43
|
-
- **IF** overriding badges **THEN** function MUST return array of `BadgeObject` (NOT JSX components).
|
|
44
|
-
- **IF** `badges.id` or `subtitle.id` defined in config **THEN** matching override MUST exist.
|
|
45
|
-
- **IF** logic depends on entity data **THEN** check for field existence (entity might be partial).
|
|
46
|
-
- **IF** `id` in config does not match override key **THEN** override will not render.
|
|
47
|
-
|
|
48
|
-
## Implementation Rules
|
|
49
|
-
- **MUST** be placed in `components/entityPageHeaderSubtitle/` or `components/entityPageHeaderBadges/`.
|
|
50
|
-
- **MUST** export `useEntityPageHeaderSubtitle` / `useEntityPageHeaderBadges` hooks from respective index files.
|
|
51
|
-
- **MUST** be pure functions (no hooks inside the resolver functions).
|
|
52
|
-
- **MUST** ensure `id` in config matches the key in override object exactly.
|
|
53
|
-
- **NEVER** return JSX from badge/subtitle functions (return data objects only).
|
|
54
|
-
|
|
55
|
-
## Canonical Example
|
|
56
|
-
|
|
57
|
-
### 1. Subtitle Override
|
|
58
|
-
```typescript
|
|
59
|
-
// components/entityPageHeaderSubtitle/entityPageHeaderSubtitle.ts
|
|
60
|
-
export const entityPageHeaderSubtitle = (entity: Record<string, any>) => {
|
|
61
|
-
return { text: `Created by ${entity.owner || 'Unknown'} on ${entity.date || 'N/A'}` };
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// components/entityPageHeaderSubtitle/index.ts
|
|
65
|
-
import { entityPageHeaderSubtitle } from './entityPageHeaderSubtitle';
|
|
66
|
-
export const useEntityPageHeaderSubtitle = () => ({ entityPageHeaderSubtitle });
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### 2. Badges Override
|
|
70
|
-
```typescript
|
|
71
|
-
// components/entityPageHeaderBadges/entityPageHeaderBadges.ts
|
|
72
|
-
export const entityPageHeaderBadges = (entity: Record<string, any>) => {
|
|
73
|
-
const badges = [];
|
|
74
|
-
|
|
75
|
-
// Add status badge
|
|
76
|
-
if (entity.isActive) {
|
|
77
|
-
badges.push({ text: 'Active', skin: 'success' });
|
|
78
|
-
} else {
|
|
79
|
-
badges.push({ text: 'Inactive', skin: 'neutral' });
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Add premium badge if applicable
|
|
83
|
-
if (entity.isPremium) {
|
|
84
|
-
badges.push({ text: 'Premium', skin: 'premium' });
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Add warning badge if needed
|
|
88
|
-
if (entity.needsAttention) {
|
|
89
|
-
badges.push({ text: 'Needs Attention', skin: 'warning' });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return badges;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// components/entityPageHeaderBadges/index.ts
|
|
96
|
-
import { entityPageHeaderBadges } from './entityPageHeaderBadges';
|
|
97
|
-
export const useEntityPageHeaderBadges = () => ({ entityPageHeaderBadges });
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## page.tsx Registration (REQUIRED)
|
|
101
|
-
|
|
102
|
-
**CRITICAL: PRESERVE EXISTING OVERRIDES** - Do NOT remove existing overrides. ADD this new one alongside them.
|
|
103
|
-
|
|
104
|
-
### For Subtitle Override:
|
|
105
|
-
```tsx
|
|
106
|
-
// 1. Add import (keep all existing imports)
|
|
107
|
-
import { useEntityPageHeaderSubtitle } from './components/entityPageHeaderSubtitle';
|
|
108
|
-
|
|
109
|
-
// 2. Add hook call (keep all existing hook calls)
|
|
110
|
-
const entityPageHeaderSubtitle = useEntityPageHeaderSubtitle();
|
|
111
|
-
|
|
112
|
-
// 3. Add entityPageHeaderSubtitle to AutoPatternsOverridesProvider value (keep ALL existing overrides)
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### For Badges Override:
|
|
116
|
-
```tsx
|
|
117
|
-
// 1. Add import (keep all existing imports)
|
|
118
|
-
import { useEntityPageHeaderBadges } from './components/entityPageHeaderBadges';
|
|
119
|
-
|
|
120
|
-
// 2. Add hook call (keep all existing hook calls)
|
|
121
|
-
const entityPageHeaderBadges = useEntityPageHeaderBadges();
|
|
122
|
-
|
|
123
|
-
// 3. Add entityPageHeaderBadges to AutoPatternsOverridesProvider value (keep ALL existing overrides)
|
|
124
|
-
```
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# Custom Sections Override Rules
|
|
2
|
-
|
|
3
|
-
**REQUIRED**: After creating section files, you MUST update `page.tsx` to register them.
|
|
4
|
-
|
|
5
|
-
## Type Definitions
|
|
6
|
-
```typescript
|
|
7
|
-
interface Section {
|
|
8
|
-
id: string; // Unique grouping ID
|
|
9
|
-
title: string; // Header text
|
|
10
|
-
primaryAction?: {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
prefixIcon?: React.ReactElement;
|
|
14
|
-
onClick: () => void;
|
|
15
|
-
};
|
|
16
|
-
badge?: {
|
|
17
|
-
visible: boolean;
|
|
18
|
-
skin?: 'light' | 'danger' | 'neutralLight';
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Section Renderer Signature
|
|
23
|
-
type SectionRenderer = (item: any) => Section;
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Configuration Schema
|
|
27
|
-
```json
|
|
28
|
-
{
|
|
29
|
-
"type": "collectionPage",
|
|
30
|
-
"collectionPage": {
|
|
31
|
-
"components": [
|
|
32
|
-
{
|
|
33
|
-
"layout": [
|
|
34
|
-
{
|
|
35
|
-
"type": "Table",
|
|
36
|
-
"table": {
|
|
37
|
-
"sections": {
|
|
38
|
-
"id": "groupByType" // Matches override key
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Validation Logic
|
|
50
|
-
- **IF** `sections.id` is defined **THEN** matching override function MUST exist.
|
|
51
|
-
- **IF** multiple items return same `id` from renderer **THEN** they will be visually grouped.
|
|
52
|
-
- **NEVER** perform heavy computations in renderer; it runs for every item.
|
|
53
|
-
|
|
54
|
-
## Implementation Rules
|
|
55
|
-
- **MUST** be placed in `components/sections/` folder.
|
|
56
|
-
- **MUST** export a `useSections` hook from `components/sections/index.tsx`.
|
|
57
|
-
- **MUST** return a valid `Section` object.
|
|
58
|
-
- **MUST** handle missing fields gracefully (default values).
|
|
59
|
-
|
|
60
|
-
## Canonical Example
|
|
61
|
-
```tsx
|
|
62
|
-
// components/sections/groupByType.ts
|
|
63
|
-
import { Section } from '@wix/patterns';
|
|
64
|
-
|
|
65
|
-
export function groupByType(item: any): Section {
|
|
66
|
-
const type = item.type || 'other';
|
|
67
|
-
return {
|
|
68
|
-
id: type,
|
|
69
|
-
title: type.toUpperCase(),
|
|
70
|
-
badge: { visible: true, skin: 'neutralLight' }
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// components/sections/index.tsx
|
|
75
|
-
import { groupByType } from './groupByType';
|
|
76
|
-
export const useSections = () => ({ groupByType });
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## page.tsx Registration (REQUIRED)
|
|
80
|
-
|
|
81
|
-
**CRITICAL: PRESERVE EXISTING OVERRIDES** - Do NOT remove existing overrides. ADD this new one alongside them.
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
// 1. Add import (keep all existing imports)
|
|
85
|
-
import { useSections } from './components/sections';
|
|
86
|
-
|
|
87
|
-
// 2. Add hook call (keep all existing hook calls)
|
|
88
|
-
const sections = useSections();
|
|
89
|
-
|
|
90
|
-
// 3. Add sections to PatternsWizardOverridesProvider value (keep ALL existing overrides)
|
|
91
|
-
```
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# Custom Slots Override Rules
|
|
2
|
-
|
|
3
|
-
**REQUIRED**: After creating slot files, you MUST update `page.tsx` to register them.
|
|
4
|
-
|
|
5
|
-
## Type Definitions
|
|
6
|
-
```typescript
|
|
7
|
-
// Slot Component Signature
|
|
8
|
-
type SlotComponent = React.FC; // No props passed
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Configuration Schema
|
|
12
|
-
```json
|
|
13
|
-
{
|
|
14
|
-
"type": "collectionPage",
|
|
15
|
-
"collectionPage": {
|
|
16
|
-
"components": [
|
|
17
|
-
{
|
|
18
|
-
"type": "custom",
|
|
19
|
-
"id": "topBanner" // Matches override key
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"type": "collection",
|
|
23
|
-
"collection": { "collectionId": "items" }
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Validation Logic
|
|
31
|
-
- **IF** `type` is `"custom"` in components array **THEN** `id` MUST match a key in the `slots` override object.
|
|
32
|
-
- **IF** implementing a slot **THEN** component MUST NOT expect any props.
|
|
33
|
-
- **NEVER** assume slot position; it renders exactly where placed in the `components` array.
|
|
34
|
-
|
|
35
|
-
## Implementation Rules
|
|
36
|
-
- **MUST** be placed in `components/slots/` folder.
|
|
37
|
-
- **MUST** export a `useSlots` hook from `components/slots/index.tsx`.
|
|
38
|
-
- **MUST** be a standard React Functional Component.
|
|
39
|
-
- **MUST** match the `id` in configuration exactly.
|
|
40
|
-
|
|
41
|
-
## Canonical Example
|
|
42
|
-
```tsx
|
|
43
|
-
// components/slots/TopBanner.tsx
|
|
44
|
-
import { Card, Text } from '@wix/design-system';
|
|
45
|
-
|
|
46
|
-
export const TopBanner = () => (
|
|
47
|
-
<Card>
|
|
48
|
-
<Card.Content>
|
|
49
|
-
<Text>Welcome to the dashboard</Text>
|
|
50
|
-
</Card.Content>
|
|
51
|
-
</Card>
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
// components/slots/index.tsx
|
|
55
|
-
import { TopBanner } from './TopBanner';
|
|
56
|
-
export const useSlots = () => ({ topBanner: TopBanner });
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## page.tsx Registration (REQUIRED)
|
|
60
|
-
|
|
61
|
-
**CRITICAL: PRESERVE EXISTING OVERRIDES** - Do NOT remove existing overrides. ADD this new one alongside them.
|
|
62
|
-
|
|
63
|
-
```tsx
|
|
64
|
-
// 1. Add import (keep all existing imports)
|
|
65
|
-
import { useSlots } from './components/slots';
|
|
66
|
-
|
|
67
|
-
// 2. Add hook call (keep all existing hook calls)
|
|
68
|
-
const slots = useSlots();
|
|
69
|
-
|
|
70
|
-
// 3. Add slots to PatternsWizardOverridesProvider value (keep ALL existing overrides)
|
|
71
|
-
```
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Entity Page Action Rules (Edit Mode)
|
|
2
|
-
|
|
3
|
-
## Type Definitions
|
|
4
|
-
```typescript
|
|
5
|
-
interface EntityPageConfig {
|
|
6
|
-
entityPage: {
|
|
7
|
-
actions: {
|
|
8
|
-
moreActions: (CustomActionItem | DividerItem)[];
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface CustomActionItem {
|
|
14
|
-
id: string; // Matches resolver name
|
|
15
|
-
type: 'custom';
|
|
16
|
-
label: string;
|
|
17
|
-
biName: string; // MANDATORY
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface DividerItem {
|
|
21
|
-
type: 'divider';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Resolver Type
|
|
25
|
-
type CustomEntityPageActionResolver = (params: {
|
|
26
|
-
actionParams: {
|
|
27
|
-
entity: any; // Current entity data
|
|
28
|
-
form: UseFormReturn; // react-hook-form instance
|
|
29
|
-
};
|
|
30
|
-
sdk: AutoPatternsSDK;
|
|
31
|
-
}) => ResolvedAction;
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Validation Logic
|
|
35
|
-
- **IF** mode is `'edit'` **THEN** ONLY `moreActions` is supported (`primaryActions` forbidden).
|
|
36
|
-
- **IF** `type: 'custom'` **THEN** `id` MUST match exported resolver name.
|
|
37
|
-
- **IF** `type: 'divider'` **THEN** NO other properties allowed.
|
|
38
|
-
- **ONLY** `'custom'` and `'divider'` are valid action types in moreActions. There is NO built-in `'duplicate'`, `'copy'`, `'clone'`, `'archive'`, `'export'`, or similar action type.
|
|
39
|
-
- **IF** you need any operation beyond navigation (duplicate, archive, export, share, etc.) **THEN** use `type: 'custom'` with a resolver implementation.
|
|
40
|
-
|
|
41
|
-
## Implementation Rules
|
|
42
|
-
- **MUST** place all custom actions in `moreActions` array for Edit Mode.
|
|
43
|
-
- **MUST** include `biName` for every action.
|
|
44
|
-
- **MUST** return a valid `ResolvedAction` object (see resolved_action.md).
|
|
45
|
-
- **MUST** use `errorHandler` for Wix API calls.
|
|
46
|
-
- **NEVER** use `primaryActions` or `secondaryActions` in Edit Mode.
|
|
47
|
-
|
|
48
|
-
## Canonical Example
|
|
49
|
-
```typescript
|
|
50
|
-
// Config
|
|
51
|
-
{
|
|
52
|
-
moreActions: [
|
|
53
|
-
{ id: 'sendEmail', type: 'custom', label: 'Send Email', biName: 'send-email-action' },
|
|
54
|
-
{ type: 'divider' },
|
|
55
|
-
{ id: 'archive', type: 'custom', label: 'Archive', biName: 'archive-action' }
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// components/actions/sendEmail.tsx (use .tsx because it contains JSX icon)
|
|
60
|
-
export const sendEmail: CustomEntityPageActionResolver = ({ actionParams, sdk }) => {
|
|
61
|
-
return {
|
|
62
|
-
label: 'Send Email',
|
|
63
|
-
icon: <EmailIcon />,
|
|
64
|
-
biName: 'send-email-action',
|
|
65
|
-
onClick: () => {
|
|
66
|
-
// Logic here
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
```
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Entity Page Action Rules (View Mode)
|
|
2
|
-
|
|
3
|
-
## Type Definitions
|
|
4
|
-
```typescript
|
|
5
|
-
interface EntityPageViewActions {
|
|
6
|
-
primaryActions?: ActionGroup;
|
|
7
|
-
secondaryActions?: ActionGroup;
|
|
8
|
-
moreActions?: (CustomActionItem | DividerItem)[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
type ActionGroup = | { type: 'action'; action: { item: ActionItem } } | { type: 'menu'; menu: { label: string; items: (ActionItem | DividerItem)[] } };
|
|
12
|
-
|
|
13
|
-
interface DividerItem {
|
|
14
|
-
type: 'divider';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface ActionItem {
|
|
18
|
-
id: string; // Must match resolver if custom
|
|
19
|
-
label: string;
|
|
20
|
-
type: 'create' | 'custom';
|
|
21
|
-
biName: string; // MANDATORY
|
|
22
|
-
create?: {
|
|
23
|
-
mode: 'page';
|
|
24
|
-
page: { id: string };
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type CustomEntityPageActionResolver = (params: {
|
|
29
|
-
actionParams: { entity: any };
|
|
30
|
-
sdk: AutoPatternsSDK;
|
|
31
|
-
}) => ResolvedAction;
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Validation Logic
|
|
35
|
-
- **IF** mode is `'view'` **THEN** supports `primaryActions`, `secondaryActions`, AND `moreActions`.
|
|
36
|
-
- **IF** action type is `'create'` **THEN** `create` config is **REQUIRED**.
|
|
37
|
-
- **IF** action type is `'custom'` **THEN** resolver implementation is **REQUIRED**.
|
|
38
|
-
|
|
39
|
-
## Implementation Rules
|
|
40
|
-
- **MUST** use `primaryActions` for main workflow (e.g. Create).
|
|
41
|
-
- **MUST** use `secondaryActions` for supporting workflows.
|
|
42
|
-
- **MUST** use `moreActions` for less common/admin tasks.
|
|
43
|
-
- **MUST** check error handling rules: `errorHandler` for Wix APIs, none for external/SDK.
|
|
44
|
-
- **NEVER** manually add "Edit" action; it's automatic if an Edit Mode page exists.
|
|
45
|
-
|
|
46
|
-
## Canonical Example
|
|
47
|
-
```typescript
|
|
48
|
-
{
|
|
49
|
-
primaryActions: {
|
|
50
|
-
type: 'action',
|
|
51
|
-
action: {
|
|
52
|
-
item: {
|
|
53
|
-
id: 'createEntity',
|
|
54
|
-
label: 'Create New',
|
|
55
|
-
type: 'create',
|
|
56
|
-
biName: 'create-entity-action',
|
|
57
|
-
create: {
|
|
58
|
-
mode: 'page',
|
|
59
|
-
page: { id: 'entity-edit-page' }
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
moreActions: [
|
|
65
|
-
{
|
|
66
|
-
id: 'duplicateEntity',
|
|
67
|
-
type: 'custom',
|
|
68
|
-
label: 'Duplicate',
|
|
69
|
-
biName: 'duplicate-entity-action'
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
```
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# Entity Page Rules
|
|
2
|
-
|
|
3
|
-
## Type Definitions
|
|
4
|
-
```typescript
|
|
5
|
-
interface EntityPageConfig {
|
|
6
|
-
type: 'entityPage';
|
|
7
|
-
entityPage: {
|
|
8
|
-
mode?: 'edit' | 'view'; // Default 'edit'
|
|
9
|
-
route: { path: string; params: { id: string } };
|
|
10
|
-
parentPageId: string; // REQUIRED
|
|
11
|
-
collectionId: string;
|
|
12
|
-
entityTypeSource: 'cms' | 'custom';
|
|
13
|
-
title?: {
|
|
14
|
-
text: string;
|
|
15
|
-
badges?: { id: string }; // Dynamic badges override ID
|
|
16
|
-
};
|
|
17
|
-
subtitle?: {
|
|
18
|
-
text: string;
|
|
19
|
-
id?: string; // Dynamic subtitle override ID
|
|
20
|
-
};
|
|
21
|
-
layout?: {
|
|
22
|
-
main: CardLayout[];
|
|
23
|
-
sidebar?: CardLayout[];
|
|
24
|
-
};
|
|
25
|
-
actions?: EntityPageActions; // See Action Rules
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface CardLayout {
|
|
30
|
-
type: 'card';
|
|
31
|
-
card: {
|
|
32
|
-
title?: { text: string };
|
|
33
|
-
children: LayoutContent[];
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type LayoutContent = | { type: 'field'; field: { fieldId: string; span?: number } } | { type: 'container'; container: { children: LayoutContent[]; span?: number } } | { type: 'component'; component: { componentId: string; span?: number } };
|
|
38
|
-
|
|
39
|
-
// Override Types
|
|
40
|
-
type EntityPageHeaderSubtitle = (entity: any) => { text: string };
|
|
41
|
-
type EntityPageHeaderBadges = (entity: any) => {
|
|
42
|
-
text: string;
|
|
43
|
-
skin?: 'success' | 'warning' | 'destructive' | 'neutral' | 'premium';
|
|
44
|
-
prefixIcon?: ReactElement;
|
|
45
|
-
suffixIcon?: ReactElement;
|
|
46
|
-
}[];
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Validation Logic
|
|
50
|
-
- **IF** `mode` is undefined **THEN** defaults to `'edit'`.
|
|
51
|
-
- **IF** `mode: 'edit'` **THEN** only `moreActions` supported.
|
|
52
|
-
- **IF** `mode: 'view'` **THEN** `primaryActions`, `secondaryActions`, `moreActions` supported.
|
|
53
|
-
- **IF** `badges.id` defined **THEN** implementation MUST return array of badge objects.
|
|
54
|
-
- **IF** `subtitle.id` defined **THEN** implementation MUST return `{ text: string }`.
|
|
55
|
-
|
|
56
|
-
## Implementation Rules
|
|
57
|
-
- **MUST** use route format `/[segment]/:entityId` (NEVER `/:entityId`).
|
|
58
|
-
- **MUST** map dynamic parameter in `route.params` (e.g. `{ id: 'entityId' }`).
|
|
59
|
-
- **MUST** register overrides for `badges` and `subtitle` if IDs are used.
|
|
60
|
-
- **MUST** use 12-column grid system for `span` (wraps if > 12).
|
|
61
|
-
- **SHOULD** put primary info in `main` layout, metadata in `sidebar`.
|
|
62
|
-
- **NEVER** return JSX from badge/subtitle functions (return data objects).
|
|
63
|
-
|
|
64
|
-
## Canonical Example
|
|
65
|
-
```typescript
|
|
66
|
-
// Config
|
|
67
|
-
{
|
|
68
|
-
type: 'entityPage',
|
|
69
|
-
entityPage: {
|
|
70
|
-
mode: 'view',
|
|
71
|
-
route: { path: '/pet/:entityId', params: { id: 'entityId' } },
|
|
72
|
-
parentPageId: 'pets-list',
|
|
73
|
-
collectionId: 'pets',
|
|
74
|
-
entityTypeSource: 'cms',
|
|
75
|
-
title: {
|
|
76
|
-
text: 'Pet Details',
|
|
77
|
-
badges: { id: 'petBadges' }
|
|
78
|
-
},
|
|
79
|
-
layout: {
|
|
80
|
-
main: [{
|
|
81
|
-
type: 'card',
|
|
82
|
-
card: {
|
|
83
|
-
title: { text: 'Info' },
|
|
84
|
-
children: [
|
|
85
|
-
{ type: 'field', field: { fieldId: 'name', span: 6 } },
|
|
86
|
-
{ type: 'field', field: { fieldId: 'age', span: 6 } }
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
}]
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Override Implementation
|
|
95
|
-
export const petBadges = (entity) => ([
|
|
96
|
-
{ text: entity.status, skin: entity.status === 'Active' ? 'success' : 'neutral' }
|
|
97
|
-
]);
|
|
98
|
-
```
|