@wix/auto-patterns 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +19 -58
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +48 -0
- package/dist/cjs/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +11 -7
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/cjs/components/ModalRenderer.js +1 -1
- package/dist/cjs/components/ModalRenderer.js.map +1 -1
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +5 -0
- package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js +2 -2
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/cjs/hooks/useBaseSDK.js +1 -1
- package/dist/cjs/hooks/useBaseSDK.js.map +1 -1
- package/dist/cjs/hooks/useColumns.js +1 -1
- package/dist/cjs/hooks/useColumns.js.map +1 -1
- package/dist/cjs/hooks/useEmptyStates.js +1 -1
- package/dist/cjs/hooks/useEmptyStates.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js +2 -2
- package/dist/cjs/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/cjs/hooks/useFilters.js +2 -2
- package/dist/cjs/hooks/useFilters.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +2 -2
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/providers/{PatternsWizardOverridesContext.js → AutoPatternsOverridesContext.js} +14 -11
- package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -0
- package/dist/cjs/providers/SchemaContext.js +24 -7
- package/dist/cjs/providers/SchemaContext.js.map +1 -1
- package/dist/cjs/providers/index.js +4 -4
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/BaseSDK.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/cjs/utils/actions/resolveAction.js +2 -1
- package/dist/cjs/utils/actions/resolveAction.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/cjs/utils/vibe.js +11 -0
- package/dist/cjs/utils/vibe.js.map +1 -0
- package/dist/docs/action_cell.md +18 -8
- package/dist/docs/app_config_structure.md +36 -1
- package/dist/docs/app_context.md +45 -0
- package/dist/docs/auto-patterns-guide.md +180 -64
- package/dist/docs/bulk_actions.md +10 -5
- package/dist/docs/collection_page.md +1 -1
- package/dist/docs/collection_page_actions.md +16 -9
- package/dist/docs/custom_overrides.md +21 -21
- package/dist/docs/entity_page.md +10 -10
- package/dist/docs/entity_page_actions.md +11 -4
- package/dist/docs/index.md +4 -0
- package/dist/docs/installation.md +3 -3
- package/dist/docs/resolved_action.md +6 -2
- package/dist/docs/wix_fqdn_custom_data_source.md +2 -2
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +2 -25
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +2 -2
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js +29 -0
- package/dist/esm/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +2 -2
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +2 -2
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +5 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/esm/components/ModalRenderer.js +2 -2
- package/dist/esm/components/ModalRenderer.js.map +1 -1
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +4 -0
- package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js +2 -2
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/esm/hooks/useBaseSDK.js +2 -2
- package/dist/esm/hooks/useBaseSDK.js.map +1 -1
- package/dist/esm/hooks/useColumns.js +2 -2
- package/dist/esm/hooks/useColumns.js.map +1 -1
- package/dist/esm/hooks/useEmptyStates.js +2 -2
- package/dist/esm/hooks/useEmptyStates.js.map +1 -1
- package/dist/esm/hooks/useEntityPageHeaderTexts.js +2 -2
- package/dist/esm/hooks/useEntityPageHeaderTexts.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +2 -2
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +2 -2
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/providers/AutoPatternsOverridesContext.js +19 -0
- package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -0
- package/dist/esm/providers/SchemaContext.js +23 -6
- package/dist/esm/providers/SchemaContext.js.map +1 -1
- package/dist/esm/providers/index.js +1 -1
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/BaseSDK.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/esm/utils/actions/resolveAction.js +2 -1
- package/dist/esm/utils/actions/resolveAction.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/esm/utils/vibe.js +6 -0
- package/dist/esm/utils/vibe.js.map +1 -0
- package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts +3 -0
- package/dist/types/components/AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
- package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts +2 -1
- package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/providers/{PatternsWizardOverridesContext.d.ts → AutoPatternsOverridesContext.d.ts} +12 -4
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -0
- package/dist/types/providers/SchemaContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -1
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/types/BaseSDK.d.ts +2 -2
- package/dist/types/types/BaseSDK.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +1 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +7 -2
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/actions/resolveAction.d.ts +1 -0
- package/dist/types/utils/actions/resolveAction.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -0
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/dist/types/utils/vibe.d.ts +2 -0
- package/dist/types/utils/vibe.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/cjs/dataSourceAdapters/factory.js +0 -14
- package/dist/cjs/dataSourceAdapters/factory.js.map +0 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +0 -1
- package/dist/esm/dataSourceAdapters/factory.js +0 -10
- package/dist/esm/dataSourceAdapters/factory.js.map +0 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js +0 -15
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +0 -1
- package/dist/types/dataSourceAdapters/factory.d.ts +0 -3
- package/dist/types/dataSourceAdapters/factory.d.ts.map +0 -1
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +0 -1
package/dist/docs/action_cell.md
CHANGED
|
@@ -144,6 +144,7 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
144
144
|
})
|
|
145
145
|
});
|
|
146
146
|
},
|
|
147
|
+
biName: 'download-pet-details-action' // MANDATORY: For analytics tracking
|
|
147
148
|
};
|
|
148
149
|
};
|
|
149
150
|
```
|
|
@@ -168,10 +169,11 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
168
169
|
"id": "downloadPetDetails", // MUST match the function name exactly
|
|
169
170
|
"type": "custom", // REQUIRED: Must be exactly "custom"
|
|
170
171
|
"label": "Download Details", // Optional: Displayed text
|
|
172
|
+
"biName": "download-pet-details-action" // MANDATORY: Analytics tracking identifier
|
|
171
173
|
}
|
|
172
174
|
```
|
|
173
175
|
|
|
174
|
-
5. Register your action in the `
|
|
176
|
+
5. Register your action in the `AutoPatternsOverridesProvider`:
|
|
175
177
|
```typescript
|
|
176
178
|
import { useActions } from '../components/actions';
|
|
177
179
|
|
|
@@ -179,9 +181,9 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
179
181
|
const actions = useActions();
|
|
180
182
|
|
|
181
183
|
return (
|
|
182
|
-
<
|
|
184
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
183
185
|
<AutoPatternsApp configuration={config} />
|
|
184
|
-
</
|
|
186
|
+
</AutoPatternsOverridesProvider>
|
|
185
187
|
);
|
|
186
188
|
}
|
|
187
189
|
```
|
|
@@ -196,13 +198,21 @@ Custom actions execute JavaScript code that you define. These actions receive pa
|
|
|
196
198
|
|
|
197
199
|
1. `id` must:
|
|
198
200
|
- Match exactly the function name of the custom action implementation
|
|
199
|
-
- Be registered in the `actions` property of your `
|
|
201
|
+
- Be registered in the `actions` property of your `AutoPatternsOverridesProvider`
|
|
200
202
|
- Follow JavaScript identifier naming rules (camelCase recommended)
|
|
201
203
|
|
|
202
|
-
2.
|
|
203
|
-
-
|
|
204
|
+
2. `biName` must:
|
|
205
|
+
- Be included in every action configuration (MANDATORY)
|
|
206
|
+
- Use descriptive, kebab-case naming (e.g., "download-pet-details-action")
|
|
207
|
+
- Be unique across the application
|
|
208
|
+
- Follow the pattern: `{action-purpose}-action`
|
|
209
|
+
- Enable analytics tracking for user interactions
|
|
210
|
+
|
|
211
|
+
2. The implementation must return a `ResolvedAction` object with:
|
|
212
|
+
- `label`: Text displayed for the action
|
|
204
213
|
- `icon`: An Icon component from "@wix/wix-ui-icons-common"
|
|
205
214
|
- `onClick`: Handler function for the action
|
|
215
|
+
- `biName`: Business intelligence name for analytics tracking. Must match the `biName` in your action configuration (required)
|
|
206
216
|
- `hidden` (optional): Boolean to hide the action when true
|
|
207
217
|
|
|
208
218
|
3. The implementation must:
|
|
@@ -238,13 +248,13 @@ Follow this decision process when implementing ActionCell:
|
|
|
238
248
|
- Complex, full-entity edits → Use `mode: "page"` to navigate to entity page
|
|
239
249
|
|
|
240
250
|
6. **Custom Implementation**:
|
|
241
|
-
- For `custom` actions, you must provide implementations in your code and register them with `
|
|
251
|
+
- For `custom` actions, you must provide implementations in your code and register them with `AutoPatternsOverridesProvider`
|
|
242
252
|
|
|
243
253
|
### ActionCell Validation Checklist
|
|
244
254
|
|
|
245
255
|
AI agents should verify these requirements before generating ActionCell configurations:
|
|
246
256
|
|
|
247
|
-
✓ ActionCell is placed
|
|
257
|
+
✓ ActionCell is placed at the collection component level (`collectionPage.components[*].actionCell`) as a sibling to `collection`, `layout`, etc. — NOT inside `table` or `grid`
|
|
248
258
|
✓ Each action has a unique `id` and correct `type` value
|
|
249
259
|
✓ Each action type only includes its required field(s)
|
|
250
260
|
✓ Update page action refers to a valid entity page ID
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# AppConfig Structure
|
|
2
2
|
|
|
3
|
+
## ⚠️ CRITICAL REQUIREMENT: Mandatory `biName` Property
|
|
4
|
+
|
|
5
|
+
**Every action configuration in auto-patterns MUST include a `biName` property.** This is not optional - it's a mandatory requirement for all auto-patterns applications.
|
|
6
|
+
|
|
7
|
+
### Why `biName` is Mandatory:
|
|
8
|
+
- **Analytics Tracking**: Enables tracking of user interactions with actions
|
|
9
|
+
- **Feature Usage**: Helps understand which features are most/least used
|
|
10
|
+
- **User Behavior**: Provides insights into user workflows and preferences
|
|
11
|
+
- **Business Intelligence**: Supports data-driven decision making
|
|
12
|
+
- **A/B Testing**: Enables testing different action configurations
|
|
13
|
+
- **Compliance**: Required for proper application monitoring and reporting
|
|
14
|
+
|
|
15
|
+
### `biName` Requirements:
|
|
16
|
+
- **MUST be included** in every action configuration
|
|
17
|
+
- **Use descriptive, kebab-case naming** (e.g., "toggle-vaccination-action")
|
|
18
|
+
- **Must be unique** across the application
|
|
19
|
+
- **Follow the pattern**: `{action-purpose}-action`
|
|
20
|
+
|
|
21
|
+
### Example:
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"id": "toggleVaccination",
|
|
25
|
+
"type": "custom",
|
|
26
|
+
"label": "Toggle Vaccination",
|
|
27
|
+
"biName": "toggle-vaccination-action" // MANDATORY
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
3
31
|
## Configuration Rules
|
|
4
32
|
|
|
5
33
|
- **Configuration must come only from a TypeScript file** - never inline or from other sources
|
|
@@ -24,6 +52,8 @@
|
|
|
24
52
|
- **Missing action type properties**: Not including `create`, `update`, `delete`, or `bulkDelete` properties when required by the action type
|
|
25
53
|
- **Including wrong action properties**: Adding properties from different action types in the same action configuration
|
|
26
54
|
- **Action type mismatches**: Using action cell types in collection actions, or bulk action types in regular actions
|
|
55
|
+
- **Missing `biName` property**: Every action configuration MUST include a `biName` property for analytics tracking
|
|
56
|
+
- **Generic `biName` values**: Using generic names like "action" or "button" instead of descriptive, kebab-case names
|
|
27
57
|
|
|
28
58
|
```ts
|
|
29
59
|
export interface AppConfig {
|
|
@@ -50,6 +80,7 @@ export interface AppConfig {
|
|
|
50
80
|
id: string; // Unique identifier for the action
|
|
51
81
|
type: 'create' | 'custom'; // Action type
|
|
52
82
|
label?: string; // Text displayed for the action
|
|
83
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
53
84
|
collection: {
|
|
54
85
|
collectionId: string; // ID of the Wix Data collection
|
|
55
86
|
entityTypeSource: 'cms' | 'custom'; // Data source type.
|
|
@@ -144,6 +175,7 @@ export interface AppConfig {
|
|
|
144
175
|
type: 'update' | 'delete' | 'custom'; // Action type
|
|
145
176
|
label?: string; // Text displayed for the action
|
|
146
177
|
skin?: string; // Visual appearance of the action button (see Action Button Skin Values section)
|
|
178
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
147
179
|
disabled?: boolean; // Whether the action is disabled
|
|
148
180
|
tooltip?: string; // Tooltip text shown on hover
|
|
149
181
|
update?: { // Required when type is 'update'
|
|
@@ -196,6 +228,7 @@ export interface AppConfig {
|
|
|
196
228
|
id: string; // Unique identifier for the bulk action
|
|
197
229
|
type: 'bulkDelete' | 'custom'; // Bulk action type
|
|
198
230
|
label?: string; // Text displayed for the action
|
|
231
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
199
232
|
bulkDelete?: { // Required when type is 'bulkDelete'
|
|
200
233
|
mode: 'modal'; // Currently only 'modal' is supported
|
|
201
234
|
modal: {
|
|
@@ -301,7 +334,7 @@ export interface AppConfig {
|
|
|
301
334
|
} |
|
|
302
335
|
{
|
|
303
336
|
type: 'custom'; // Component type for custom slot components
|
|
304
|
-
id: string; // Unique identifier that maps to a custom React component provided through
|
|
337
|
+
id: string; // Unique identifier that maps to a custom React component provided through AutoPatternsOverridesProvider slots
|
|
305
338
|
}
|
|
306
339
|
]; // End of components array
|
|
307
340
|
};
|
|
@@ -333,6 +366,7 @@ export interface AppConfig {
|
|
|
333
366
|
id: string;
|
|
334
367
|
type: 'create' | 'custom';
|
|
335
368
|
label?: string;
|
|
369
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
336
370
|
create?: { // Required when type is 'create'
|
|
337
371
|
mode: 'page';
|
|
338
372
|
page: {
|
|
@@ -355,6 +389,7 @@ export interface AppConfig {
|
|
|
355
389
|
id: string;
|
|
356
390
|
type: 'custom';
|
|
357
391
|
label?: string;
|
|
392
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
358
393
|
}[];
|
|
359
394
|
};
|
|
360
395
|
parentPageId?: string; // ID of the parent collection page
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# AppContext
|
|
2
|
+
|
|
3
|
+
The AppContext feature allows you to add components outside the main AutoPatternsApp flow while still accessing the collection data.
|
|
4
|
+
|
|
5
|
+
## 1. Adding Components as Children
|
|
6
|
+
|
|
7
|
+
Components that need to be rendered outside the main AutoPatternsApp interface (such as modals or side panels) should be passed as children:
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { AutoPatternsApp } from '@wix/auto-patterns';
|
|
11
|
+
import { MyModal } from './MyModal';
|
|
12
|
+
import { MySidePanel } from './MySidePanel';
|
|
13
|
+
|
|
14
|
+
<AutoPatternsApp configuration={config}>
|
|
15
|
+
<MyModal />
|
|
16
|
+
<MySidePanel />
|
|
17
|
+
</AutoPatternsApp>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
These children components are typically:
|
|
21
|
+
- **Modals** - for custom actions, forms, or dialogs
|
|
22
|
+
- **Side Panels** - for additional information or controls
|
|
23
|
+
- **Overlay Components** - that need to appear on top of the main interface
|
|
24
|
+
|
|
25
|
+
## 2. Accessing Collection Data
|
|
26
|
+
|
|
27
|
+
Use the `useAppContext` hook to access the current collection items from within your child components:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import { useAppContext } from '@wix/auto-patterns';
|
|
32
|
+
|
|
33
|
+
export const MyModal: React.FC = () => {
|
|
34
|
+
const { items } = useAppContext();
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<p>Current collection has {items.length} items</p>
|
|
39
|
+
{/* Your modal content */}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The `items` array contains the current filtered and paginated collection data that matches what's displayed in the table/grid.
|