@wix/auto-patterns 1.27.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/dataSourceAdapters/cms/fetchCmsData.js +1 -1
- package/dist/cjs/dataSourceAdapters/cms/fetchCmsData.js.map +1 -1
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js +13 -6
- package/dist/cjs/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/cjs/hooks/useBaseCollectionParams.js +38 -0
- package/dist/cjs/hooks/useBaseCollectionParams.js.map +1 -0
- 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/useCommonCollectionFeatures.js +13 -6
- package/dist/cjs/hooks/useCommonCollectionFeatures.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/useFetchData.js +4 -5
- package/dist/cjs/hooks/useFetchData.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/useGridFeatures.js +6 -26
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +8 -28
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +8 -28
- package/dist/cjs/hooks/useTableGridSwitchFeatures.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/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/fetchData.js +4 -0
- package/dist/cjs/types/fetchData.js.map +1 -0
- package/dist/cjs/types/index.js +6 -0
- package/dist/cjs/types/index.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 +37 -1
- package/dist/docs/app_context.md +45 -0
- package/dist/docs/auto-patterns-guide.md +331 -82
- 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 +22 -36
- package/dist/docs/entity_page.md +10 -10
- package/dist/docs/entity_page_actions.md +11 -4
- package/dist/docs/error_handling.md +135 -0
- package/dist/docs/index.md +8 -0
- package/dist/docs/installation.md +3 -3
- package/dist/docs/resolved_action.md +6 -2
- package/dist/docs/schema_config.md +11 -3
- package/dist/docs/wix_fqdn_custom_data_source.md +51 -9
- 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/dataSourceAdapters/cms/fetchCmsData.js +1 -1
- package/dist/esm/dataSourceAdapters/cms/fetchCmsData.js.map +1 -1
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js +14 -9
- package/dist/esm/hooks/useAutoPatternsOptimisticActions.js.map +1 -1
- package/dist/esm/hooks/useBaseCollectionParams.js +37 -0
- package/dist/esm/hooks/useBaseCollectionParams.js.map +1 -0
- 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/useCommonCollectionFeatures.js +9 -2
- package/dist/esm/hooks/useCommonCollectionFeatures.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/useFetchData.js +2 -2
- package/dist/esm/hooks/useFetchData.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/useGridFeatures.js +6 -29
- package/dist/esm/hooks/useGridFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +8 -31
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +8 -31
- package/dist/esm/hooks/useTableGridSwitchFeatures.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/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/fetchData.js +2 -0
- package/dist/esm/types/fetchData.js.map +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.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/useAutoPatternsOptimisticActions.d.ts +7 -1
- package/dist/types/hooks/useAutoPatternsOptimisticActions.d.ts.map +1 -1
- package/dist/types/hooks/useBaseCollectionParams.d.ts +27 -0
- package/dist/types/hooks/useBaseCollectionParams.d.ts.map +1 -0
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts +4 -3
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useFetchData.d.ts +3 -13
- package/dist/types/hooks/useFetchData.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/providers/{PatternsWizardOverridesContext.d.ts → AutoPatternsOverridesContext.d.ts} +14 -5
- 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/CollectionPageConfig.d.ts +4 -0
- package/dist/types/types/CollectionPageConfig.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/fetchData.d.ts +21 -0
- package/dist/types/types/fetchData.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +12 -7
- 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 +10 -10
- 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
|
@@ -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.
|
|
@@ -89,6 +120,7 @@ export interface AppConfig {
|
|
|
89
120
|
reflectQueryInUrl?: boolean; // Reflects query state (search, filters, sorting) in the browser URL. Default: false
|
|
90
121
|
selectAllScope?: 'page' | 'all'; // Controls "Select All" scope. 'all' selects entire collection, 'page' selects only visible items. Default: 'all'
|
|
91
122
|
selectionUpdateMode?: 'preserve' | 'clear'; // Controls selection behavior when data changes. 'preserve' maintains selections, 'clear' clears them. Default: 'clear'
|
|
123
|
+
paginationMode?: 'cursor' | 'offset'; // Controls pagination strategy and expected find() return shape. 'cursor' => { items, cursor, total? }, 'offset' (default) => { items, hasNext, total? }
|
|
92
124
|
};
|
|
93
125
|
filters?: {
|
|
94
126
|
panelTitle?: string; // Title of the filters panel
|
|
@@ -143,6 +175,7 @@ export interface AppConfig {
|
|
|
143
175
|
type: 'update' | 'delete' | 'custom'; // Action type
|
|
144
176
|
label?: string; // Text displayed for the action
|
|
145
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
|
|
146
179
|
disabled?: boolean; // Whether the action is disabled
|
|
147
180
|
tooltip?: string; // Tooltip text shown on hover
|
|
148
181
|
update?: { // Required when type is 'update'
|
|
@@ -195,6 +228,7 @@ export interface AppConfig {
|
|
|
195
228
|
id: string; // Unique identifier for the bulk action
|
|
196
229
|
type: 'bulkDelete' | 'custom'; // Bulk action type
|
|
197
230
|
label?: string; // Text displayed for the action
|
|
231
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
198
232
|
bulkDelete?: { // Required when type is 'bulkDelete'
|
|
199
233
|
mode: 'modal'; // Currently only 'modal' is supported
|
|
200
234
|
modal: {
|
|
@@ -300,7 +334,7 @@ export interface AppConfig {
|
|
|
300
334
|
} |
|
|
301
335
|
{
|
|
302
336
|
type: 'custom'; // Component type for custom slot components
|
|
303
|
-
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
|
|
304
338
|
}
|
|
305
339
|
]; // End of components array
|
|
306
340
|
};
|
|
@@ -332,6 +366,7 @@ export interface AppConfig {
|
|
|
332
366
|
id: string;
|
|
333
367
|
type: 'create' | 'custom';
|
|
334
368
|
label?: string;
|
|
369
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
335
370
|
create?: { // Required when type is 'create'
|
|
336
371
|
mode: 'page';
|
|
337
372
|
page: {
|
|
@@ -354,6 +389,7 @@ export interface AppConfig {
|
|
|
354
389
|
id: string;
|
|
355
390
|
type: 'custom';
|
|
356
391
|
label?: string;
|
|
392
|
+
biName: string; // MANDATORY: Business intelligence name for analytics tracking
|
|
357
393
|
}[];
|
|
358
394
|
};
|
|
359
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.
|