@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
|
@@ -119,6 +119,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
119
119
|
})
|
|
120
120
|
});
|
|
121
121
|
},
|
|
122
|
+
biName: 'bulk-export-pets-action' // MANDATORY: For analytics tracking
|
|
122
123
|
};
|
|
123
124
|
};
|
|
124
125
|
```
|
|
@@ -141,10 +142,11 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
141
142
|
"id": "bulkExportPets", // MUST match the function name exactly
|
|
142
143
|
"type": "custom", // REQUIRED: Must be exactly "custom"
|
|
143
144
|
"label": "Export Selected", // Optional: Displayed text
|
|
145
|
+
"biName": "bulk-export-pets-action" // MANDATORY: Analytics tracking identifier
|
|
144
146
|
}
|
|
145
147
|
```
|
|
146
148
|
|
|
147
|
-
5. Register your action in the `
|
|
149
|
+
5. Register your action in the `AutoPatternsOverridesProvider`:
|
|
148
150
|
```typescript
|
|
149
151
|
import { useActions } from '../components/actions';
|
|
150
152
|
|
|
@@ -152,9 +154,9 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
152
154
|
const actions = useActions();
|
|
153
155
|
|
|
154
156
|
return (
|
|
155
|
-
<
|
|
157
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
156
158
|
<AutoPatternsApp configuration={config} />
|
|
157
|
-
</
|
|
159
|
+
</AutoPatternsOverridesProvider>
|
|
158
160
|
);
|
|
159
161
|
}
|
|
160
162
|
```
|
|
@@ -171,7 +173,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
171
173
|
|
|
172
174
|
1. `id` must:
|
|
173
175
|
- Match exactly the function name of the custom bulk action implementation
|
|
174
|
-
- Be registered in the `actions` property of your `
|
|
176
|
+
- Be registered in the `actions` property of your `AutoPatternsOverridesProvider`
|
|
175
177
|
- Follow JavaScript identifier naming rules (camelCase recommended)
|
|
176
178
|
|
|
177
179
|
2. The implementation must return a `ResolvedAction`:
|
|
@@ -261,7 +263,7 @@ Follow this decision process when implementing Bulk Action Toolbar:
|
|
|
261
263
|
- Less common bulk operations → Place in `secondaryActions` array
|
|
262
264
|
|
|
263
265
|
3. **Custom Implementation**:
|
|
264
|
-
- For `custom` bulk actions, you must provide implementations in your code and register them with `
|
|
266
|
+
- For `custom` bulk actions, you must provide implementations in your code and register them with `AutoPatternsOverridesProvider`
|
|
265
267
|
|
|
266
268
|
### Bulk Action Toolbar Validation Checklist
|
|
267
269
|
|
|
@@ -276,3 +278,6 @@ AI agents should verify these requirements before generating Bulk Action Toolbar
|
|
|
276
278
|
✓ Primary actions use `action`/`menu` structure with proper `action` or `menu` properties
|
|
277
279
|
✓ Secondary actions are an array that can include dividers
|
|
278
280
|
✓ Menu items within primary actions is array that can include dividers
|
|
281
|
+
✓ **MANDATORY**: Every action configuration MUST include a `biName` property for analytics tracking
|
|
282
|
+
✓ **MANDATORY**: `biName` must use descriptive, kebab-case naming (e.g., "bulk-export-pets-action")
|
|
283
|
+
✓ **MANDATORY**: `biName` must be unique across the application and follow the pattern `bulk-{action}-action`
|
|
@@ -26,7 +26,7 @@ The `layout` array contains the rendering components for the collection. Each la
|
|
|
26
26
|
1. **Table Layout Item** (`type: 'Table'`):
|
|
27
27
|
* `table` field contains table-specific configuration
|
|
28
28
|
* Used for displaying collection in a **table view**
|
|
29
|
-
* Includes columns,
|
|
29
|
+
* Includes columns, bulkActionToolbar, etc.
|
|
30
30
|
|
|
31
31
|
2. **Grid Layout Item** (`type: 'Grid'`):
|
|
32
32
|
* `grid` field contains grid-specific configuration
|
|
@@ -34,7 +34,7 @@ In addition to these common properties, each action item must specify a `type` w
|
|
|
34
34
|
### 2. `type: "custom"`
|
|
35
35
|
* **Purpose**: Executes custom JavaScript logic defined in your application's overrides.
|
|
36
36
|
* **Details**:
|
|
37
|
-
* The `custom` object in the configuration is typically empty. The functionality is determined by a custom action resolver function that you implement and register in the `actions` section of your `
|
|
37
|
+
* The `custom` object in the configuration is typically empty. The functionality is determined by a custom action resolver function that you implement and register in the `actions` section of your `AutoPatternsOverridesProvider`. The `id` of this action item must exactly match the name (key) of the registered custom action resolver. The resolver will receive parameters including `collectionId`.
|
|
38
38
|
|
|
39
39
|
### 3. `type: "divider"`
|
|
40
40
|
* **Purpose**: Creates a visual separator between action groups in menus and lists.
|
|
@@ -123,6 +123,7 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
123
123
|
"id": "exportCollection", // MUST match the function name exactly
|
|
124
124
|
"type": "custom", // REQUIRED: Must be exactly "custom"
|
|
125
125
|
"label": "Export Collection", // Optional: Displayed text
|
|
126
|
+
"biName": "export-collection-action", // MANDATORY: Analytics tracking identifier
|
|
126
127
|
"collection": {
|
|
127
128
|
"collectionId": "WixPets",
|
|
128
129
|
"entityTypeSource": "cms"
|
|
@@ -130,7 +131,7 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
130
131
|
}
|
|
131
132
|
```
|
|
132
133
|
|
|
133
|
-
5. Register your action in the `
|
|
134
|
+
5. Register your action in the `AutoPatternsOverridesProvider`:
|
|
134
135
|
```typescript
|
|
135
136
|
import { useActions } from '../components/actions';
|
|
136
137
|
|
|
@@ -138,9 +139,9 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
138
139
|
const actions = useActions();
|
|
139
140
|
|
|
140
141
|
return (
|
|
141
|
-
<
|
|
142
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
142
143
|
<AutoPatternsApp configuration={config} />
|
|
143
|
-
</
|
|
144
|
+
</AutoPatternsOverridesProvider>
|
|
144
145
|
);
|
|
145
146
|
}
|
|
146
147
|
```
|
|
@@ -212,6 +213,7 @@ export const handleRowClick: CustomActionCollectionPageActionOnRowClickResolver
|
|
|
212
213
|
|
|
213
214
|
// Your custom logic...
|
|
214
215
|
},
|
|
216
|
+
biName: 'view-details-action' // MANDATORY: For analytics tracking
|
|
215
217
|
};
|
|
216
218
|
};
|
|
217
219
|
```
|
|
@@ -247,6 +249,7 @@ export const openSidePanel: CustomActionCollectionPageActionOnRowClickResolver =
|
|
|
247
249
|
// Or use a modal service/context that you've set up
|
|
248
250
|
// modalService.openSidePanel(item);
|
|
249
251
|
},
|
|
252
|
+
biName: 'open-side-panel-action' // MANDATORY: For analytics tracking
|
|
250
253
|
};
|
|
251
254
|
};
|
|
252
255
|
```
|
|
@@ -276,7 +279,7 @@ export const useActions = () => {
|
|
|
276
279
|
}
|
|
277
280
|
```
|
|
278
281
|
|
|
279
|
-
**Step 4: Register in `
|
|
282
|
+
**Step 4: Register in `AutoPatternsOverridesProvider`**:
|
|
280
283
|
```typescript
|
|
281
284
|
import { useActions } from '../components/actions';
|
|
282
285
|
|
|
@@ -284,9 +287,9 @@ export default function YourPage() {
|
|
|
284
287
|
const actions = useActions();
|
|
285
288
|
|
|
286
289
|
return (
|
|
287
|
-
<
|
|
290
|
+
<AutoPatternsOverridesProvider value={{ actions }}>
|
|
288
291
|
<AutoPatternsApp configuration={config} />
|
|
289
|
-
</
|
|
292
|
+
</AutoPatternsOverridesProvider>
|
|
290
293
|
);
|
|
291
294
|
}
|
|
292
295
|
```
|
|
@@ -323,6 +326,7 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
323
326
|
})
|
|
324
327
|
});
|
|
325
328
|
},
|
|
329
|
+
biName: 'quick-toggle-action' // MANDATORY: For analytics tracking
|
|
326
330
|
};
|
|
327
331
|
};
|
|
328
332
|
```
|
|
@@ -346,7 +350,7 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
346
350
|
- The implementation must use the `CustomActionCollectionPageActionOnRowClickResolver` type
|
|
347
351
|
- **Required Return Object**: Must return a `ResolvedAction` object - see [ResolvedAction Reference](./resolved_action.md)
|
|
348
352
|
- Access the clicked item's data through `actionParams.item`
|
|
349
|
-
- The implementation must be exported as a named export and registered in your `
|
|
353
|
+
- The implementation must be exported as a named export and registered in your `AutoPatternsOverridesProvider`
|
|
350
354
|
- When `onRowClick` is configured, the default navigation to entity page is completely disabled
|
|
351
355
|
- **Complete Setup Required**: You need to create the action file, export it in the index, and register it in the provider - missing any step will cause errors
|
|
352
356
|
|
|
@@ -364,7 +368,10 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
364
368
|
✓ Divider actions use `{ "type": "divider" }` format and require no additional properties.
|
|
365
369
|
✓ If `onRowClick` is configured in table layout, it must have a valid `id` and `type: "custom"`.
|
|
366
370
|
✓ **CRITICAL**: Custom row click actions must have corresponding implementations registered in the `actions` override - configuration without implementation will cause errors.
|
|
367
|
-
✓ Custom row click action implementations must return
|
|
371
|
+
✓ Custom row click action implementations must return a `ResolvedAction` object with `label`, `icon`, `onClick`, and `biName` properties - all are required. See [ResolvedAction Reference](./resolved_action.md) for complete field documentation.
|
|
368
372
|
✓ Custom row click action implementations must be exported as named exports and included in the actions index file.
|
|
369
373
|
✓ `onRowClick` is optional - when not configured, rows navigate to entity page by default.
|
|
370
374
|
✓ **IMPORTANT**: Configuring `onRowClick` completely disables default navigation - you must handle all row click logic in your custom implementation.
|
|
375
|
+
✓ **MANDATORY**: Every action configuration MUST include a `biName` property for analytics tracking.
|
|
376
|
+
✓ **MANDATORY**: `biName` must use descriptive, kebab-case naming (e.g., "export-collection-action").
|
|
377
|
+
✓ **MANDATORY**: `biName` must be unique across the application and follow the pattern `{action-purpose}-action`.
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
## Override Rules
|
|
4
4
|
|
|
5
5
|
- **Custom overrides are restricted to the defined areas only** - attempting to override or modify any other aspect of `AutoPatternsApp` is prohibited and can cause unexpected behavior
|
|
6
|
-
- **Always verify override implementation** - when implementing custom overrides, you MUST ensure they are correctly imported and passed to the `
|
|
6
|
+
- **Always verify override implementation** - when implementing custom overrides, you MUST ensure they are correctly imported and passed to the `AutoPatternsOverridesProvider`
|
|
7
7
|
- **CRITICAL: Error handling for custom actions** - Custom actions that make external API calls (using `fetch()`, `axios`, etc.) should NOT use `errorHandler.withErrorHandler`. Only Wix HTTP requests (httpClient from @wix/essentials, Wix APIs like wix/data and wix/stores, and httpClient.fetchWithAuth()) require errorHandler wrapping. See the "Error Handling for HTTP Requests" section for details.
|
|
8
8
|
|
|
9
|
-
The `
|
|
9
|
+
The `AutoPatternsOverridesProvider` allows you to inject custom code to override default behaviors or add additional functionality. Below are the areas where overrides can be applied:
|
|
10
10
|
|
|
11
11
|
> **Note:** These are the only areas where overrides are supported. Avoid attempting to override or modify other parts of the system, as this is not supported and may lead to unexpected behavior.
|
|
12
12
|
|
|
@@ -81,9 +81,9 @@ export default function YourPage() {
|
|
|
81
81
|
const entityPageHeaderBadges = useEntityPageHeaderBadges();
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
|
-
<
|
|
84
|
+
<AutoPatternsOverridesProvider value={{ actions, columns, slots, sections, components, modals, customDataSources, entityPageHeaderSubtitle, entityPageHeaderBadges }}>
|
|
85
85
|
<AutoPatternsApp configuration={config} />
|
|
86
|
-
</
|
|
86
|
+
</AutoPatternsOverridesProvider>
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
```
|
|
@@ -103,7 +103,7 @@ For example:
|
|
|
103
103
|
- Adding a new subtitle override → Update `../components/entityPageHeaderSubtitle/index.tsx` to include the new subtitle in the `useEntityPageHeaderSubtitle` hook
|
|
104
104
|
- Adding a new badges override → Update `../components/entityPageHeaderBadges/index.tsx` to include the new badges in the `useEntityPageHeaderBadges` hook
|
|
105
105
|
|
|
106
|
-
Without updating the hook index files, your implementations won't be available to the `
|
|
106
|
+
Without updating the hook index files, your implementations won't be available to the `AutoPatternsOverridesProvider`.
|
|
107
107
|
|
|
108
108
|
## Common Override Mistakes to Avoid
|
|
109
109
|
|
|
@@ -348,9 +348,9 @@ export default function YourPage() {
|
|
|
348
348
|
const columns = useColumns();
|
|
349
349
|
|
|
350
350
|
return (
|
|
351
|
-
<
|
|
351
|
+
<AutoPatternsOverridesProvider value={{ columns }}>
|
|
352
352
|
<AutoPatternsApp configuration={config} />
|
|
353
|
-
</
|
|
353
|
+
</AutoPatternsOverridesProvider>
|
|
354
354
|
);
|
|
355
355
|
}
|
|
356
356
|
```
|
|
@@ -368,7 +368,7 @@ your-page/
|
|
|
368
368
|
├── fullName.tsx // Calculated column
|
|
369
369
|
└── date.tsx // Enhanced formatting with row context
|
|
370
370
|
|
|
371
|
-
|
|
371
|
+
AutoPatternsOverridesProvider
|
|
372
372
|
└── value.columns (from useColumns hook)
|
|
373
373
|
├── name
|
|
374
374
|
├── petInfo
|
|
@@ -525,9 +525,9 @@ export default function YourPage() {
|
|
|
525
525
|
const components = useComponents();
|
|
526
526
|
|
|
527
527
|
return (
|
|
528
|
-
<
|
|
528
|
+
<AutoPatternsOverridesProvider value={{ components }}>
|
|
529
529
|
<AutoPatternsApp configuration={config} />
|
|
530
|
-
</
|
|
530
|
+
</AutoPatternsOverridesProvider>
|
|
531
531
|
);
|
|
532
532
|
}
|
|
533
533
|
```
|
|
@@ -656,7 +656,7 @@ your-page/
|
|
|
656
656
|
│ ├── combinedNameFields.tsx // Multiple fields override
|
|
657
657
|
│ └── infoCard.tsx // Standalone component
|
|
658
658
|
|
|
659
|
-
|
|
659
|
+
AutoPatternsOverridesProvider
|
|
660
660
|
└── value.components (from useComponents hook)
|
|
661
661
|
├── customNameField
|
|
662
662
|
├── combinedNameFields
|
|
@@ -726,7 +726,7 @@ To enable sections, add the `sections` configuration to your table configuration
|
|
|
726
726
|
|
|
727
727
|
### Custom Data Source Hook Structure
|
|
728
728
|
|
|
729
|
-
Custom data sources are implemented through the `useCustomDataSources` hook in your `
|
|
729
|
+
Custom data sources are implemented through the `useCustomDataSources` hook in your `AutoPatternsOverridesProvider`:
|
|
730
730
|
|
|
731
731
|
```tsx
|
|
732
732
|
import { useCustomDataSources } from '../components/customDataSources';
|
|
@@ -735,9 +735,9 @@ export default function YourPage() {
|
|
|
735
735
|
const customDataSources = useCustomDataSources();
|
|
736
736
|
|
|
737
737
|
return (
|
|
738
|
-
<
|
|
738
|
+
<AutoPatternsOverridesProvider value={{ customDataSources }}>
|
|
739
739
|
<AutoPatternsApp configuration={config} />
|
|
740
|
-
</
|
|
740
|
+
</AutoPatternsOverridesProvider>
|
|
741
741
|
);
|
|
742
742
|
}
|
|
743
743
|
```
|
|
@@ -853,9 +853,9 @@ export default function YourPage() {
|
|
|
853
853
|
const customDataSources = useCustomDataSources();
|
|
854
854
|
|
|
855
855
|
return (
|
|
856
|
-
<
|
|
856
|
+
<AutoPatternsOverridesProvider value={{ customDataSources }}>
|
|
857
857
|
<AutoPatternsApp configuration={config} />
|
|
858
|
-
</
|
|
858
|
+
</AutoPatternsOverridesProvider>
|
|
859
859
|
);
|
|
860
860
|
}
|
|
861
861
|
```
|
|
@@ -864,7 +864,7 @@ export default function YourPage() {
|
|
|
864
864
|
|
|
865
865
|
### Creating Section Renderers
|
|
866
866
|
|
|
867
|
-
Section renderers are functions that determine how to group items and what information to display in section headers. They must be provided through the `
|
|
867
|
+
Section renderers are functions that determine how to group items and what information to display in section headers. They must be provided through the `AutoPatternsOverridesProvider`.
|
|
868
868
|
|
|
869
869
|
#### Function Signature
|
|
870
870
|
|
|
@@ -990,9 +990,9 @@ import * as sections from './components/sections';
|
|
|
990
990
|
import * as columns from './components/columns';
|
|
991
991
|
import * as actions from './components/actions';
|
|
992
992
|
|
|
993
|
-
<
|
|
993
|
+
<AutoPatternsOverridesProvider value={{ sections, columns, actions }}>
|
|
994
994
|
<AutoPatternsApp configuration={config} />
|
|
995
|
-
</
|
|
995
|
+
</AutoPatternsOverridesProvider>
|
|
996
996
|
```
|
|
997
997
|
|
|
998
998
|
### Important Notes
|
|
@@ -1138,9 +1138,9 @@ export default function YourPage() {
|
|
|
1138
1138
|
const slots = useSlots();
|
|
1139
1139
|
|
|
1140
1140
|
return (
|
|
1141
|
-
<
|
|
1141
|
+
<AutoPatternsOverridesProvider value={{ slots }}>
|
|
1142
1142
|
<AutoPatternsApp configuration={config} />
|
|
1143
|
-
</
|
|
1143
|
+
</AutoPatternsOverridesProvider>
|
|
1144
1144
|
);
|
|
1145
1145
|
}
|
|
1146
1146
|
```
|
package/dist/docs/entity_page.md
CHANGED
|
@@ -22,7 +22,7 @@ When a user asks to "add badges to the entity page", understand that they want:
|
|
|
22
22
|
1. **Custom component overrides** - NOT direct configuration in JSON
|
|
23
23
|
2. **Function that returns badge objects** - NOT JSX components
|
|
24
24
|
3. **Badge properties** like `text`, `skin`, `prefixIcon`, etc.
|
|
25
|
-
4. **Registration in
|
|
25
|
+
4. **Registration in AutoPatternsOverridesProvider** under `entityPageHeaderBadges`
|
|
26
26
|
|
|
27
27
|
**Example Request**: "Add 2 badges with random skins and text 'wow'"
|
|
28
28
|
**Correct Implementation**: Create a function that returns `[{text: 'wow', skin: 'success'}, {text: 'wow', skin: 'premium'}]`
|
|
@@ -116,7 +116,7 @@ const Index: FC = () => {
|
|
|
116
116
|
const entityPageHeaderSubtitle = useEntityPageHeaderSubtitle();
|
|
117
117
|
|
|
118
118
|
return (
|
|
119
|
-
<
|
|
119
|
+
<AutoPatternsOverridesProvider
|
|
120
120
|
value={{
|
|
121
121
|
// ... other overrides
|
|
122
122
|
entityPageHeaderSubtitle: {
|
|
@@ -125,7 +125,7 @@ const Index: FC = () => {
|
|
|
125
125
|
}}
|
|
126
126
|
>
|
|
127
127
|
<WixPetsPage />
|
|
128
|
-
</
|
|
128
|
+
</AutoPatternsOverridesProvider>
|
|
129
129
|
);
|
|
130
130
|
};
|
|
131
131
|
```
|
|
@@ -176,16 +176,16 @@ export const myFunction = (entity) => { ... }
|
|
|
176
176
|
|
|
177
177
|
### Integration
|
|
178
178
|
|
|
179
|
-
Register your subtitle override in the `
|
|
179
|
+
Register your subtitle override in the `AutoPatternsOverridesProvider`:
|
|
180
180
|
|
|
181
181
|
```typescript
|
|
182
|
-
<
|
|
182
|
+
<AutoPatternsOverridesProvider value={{
|
|
183
183
|
entityPageHeaderSubtitle: {
|
|
184
184
|
mySubtitleOverride,
|
|
185
185
|
},
|
|
186
186
|
}}>
|
|
187
187
|
<AutoPatternsApp configuration={config} />
|
|
188
|
-
</
|
|
188
|
+
</AutoPatternsOverridesProvider>
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
## Entity Page Dynamic Badges
|
|
@@ -218,7 +218,7 @@ When implementing badges for entity pages, understand these key points:
|
|
|
218
218
|
1. **Badges are CUSTOM COMPONENT OVERRIDES** - NOT direct configuration
|
|
219
219
|
2. **Badge function returns an ARRAY of badge objects** - NOT JSX components
|
|
220
220
|
3. **Each badge object has properties** like `text`, `skin`, `prefixIcon`, etc.
|
|
221
|
-
4. **Must be registered in
|
|
221
|
+
4. **Must be registered in AutoPatternsOverridesProvider** under `entityPageHeaderBadges`
|
|
222
222
|
|
|
223
223
|
### Complete Implementation Guide
|
|
224
224
|
|
|
@@ -273,7 +273,7 @@ const Index: FC = () => {
|
|
|
273
273
|
const entityPageHeaderBadges = useEntityPageHeaderBadges();
|
|
274
274
|
|
|
275
275
|
return (
|
|
276
|
-
<
|
|
276
|
+
<AutoPatternsOverridesProvider
|
|
277
277
|
value={{
|
|
278
278
|
// ... other overrides
|
|
279
279
|
entityPageHeaderSubtitle: {
|
|
@@ -285,7 +285,7 @@ const Index: FC = () => {
|
|
|
285
285
|
}}
|
|
286
286
|
>
|
|
287
287
|
<WixPetsPage />
|
|
288
|
-
</
|
|
288
|
+
</AutoPatternsOverridesProvider>
|
|
289
289
|
);
|
|
290
290
|
};
|
|
291
291
|
```
|
|
@@ -327,7 +327,7 @@ src/dashboard/
|
|
|
327
327
|
|
|
328
328
|
1. **❌ DON'T return JSX components** - Return badge objects instead
|
|
329
329
|
2. **❌ DON'T use direct configuration** - Use custom component overrides
|
|
330
|
-
3. **❌ DON'T forget to register in
|
|
330
|
+
3. **❌ DON'T forget to register in AutoPatternsOverridesProvider**
|
|
331
331
|
5. **❌ DON'T forget to export from index.ts** - Must export the function
|
|
332
332
|
|
|
333
333
|
|
|
@@ -21,18 +21,21 @@ Entity pages in **edit mode** support not only built-in actions (such as "Save"
|
|
|
21
21
|
{
|
|
22
22
|
"id": "sendEmail",
|
|
23
23
|
"type": "custom",
|
|
24
|
-
"label": "Send Email"
|
|
24
|
+
"label": "Send Email",
|
|
25
|
+
"biName": "send-email-action"
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
"id": "exportData",
|
|
28
29
|
"type": "custom",
|
|
29
|
-
"label": "Export Data"
|
|
30
|
+
"label": "Export Data",
|
|
31
|
+
"biName": "export-data-action"
|
|
30
32
|
},
|
|
31
33
|
{ "type": "divider" },
|
|
32
34
|
{
|
|
33
35
|
"id": "archiveEntity",
|
|
34
36
|
"type": "custom",
|
|
35
|
-
"label": "Archive"
|
|
37
|
+
"label": "Archive",
|
|
38
|
+
"biName": "archive-entity-action"
|
|
36
39
|
}
|
|
37
40
|
]
|
|
38
41
|
}
|
|
@@ -59,6 +62,7 @@ export const myMoreAction: CustomEntityPageActionResolver = (params) => {
|
|
|
59
62
|
onClick: () => {
|
|
60
63
|
// Your custom logic here
|
|
61
64
|
},
|
|
65
|
+
biName: 'my-more-action' // MANDATORY: For analytics tracking
|
|
62
66
|
};
|
|
63
67
|
};
|
|
64
68
|
```
|
|
@@ -84,9 +88,12 @@ export const myMoreAction: CustomEntityPageActionResolver = (params) => {
|
|
|
84
88
|
✓ Each action in `moreActions` has a unique `id` and correct `type` value
|
|
85
89
|
✓ Each action type only includes its required field(s)
|
|
86
90
|
✓ Custom actions match implementations in overrides
|
|
87
|
-
✓ The resolver is exported and registered in the `actions` property of your `
|
|
91
|
+
✓ The resolver is exported and registered in the `actions` property of your `AutoPatternsOverridesProvider`
|
|
88
92
|
✓ The function signature matches `CustomEntityPageActionResolver`
|
|
89
93
|
✓ The returned object is a `ResolvedAction` (see [ResolvedAction Reference](./resolved_action.md))
|
|
94
|
+
✓ **MANDATORY**: Every action configuration MUST include a `biName` property for analytics tracking
|
|
95
|
+
✓ **MANDATORY**: `biName` must use descriptive, kebab-case naming (e.g., "send-email-action")
|
|
96
|
+
✓ **MANDATORY**: `biName` must be unique across the application and follow the pattern `{action-purpose}-action`
|
|
90
97
|
|
|
91
98
|
---
|
|
92
99
|
|
package/dist/docs/index.md
CHANGED
|
@@ -66,6 +66,10 @@ This index maps user requests to the appropriate section IDs for fetching releva
|
|
|
66
66
|
**Topics**: Package installation, setup process, component integration, provider setup
|
|
67
67
|
**Keywords**: installation, setup, getting started, initial setup, package installation, dependencies, component integration, provider setup
|
|
68
68
|
|
|
69
|
+
### ID: `app_context`
|
|
70
|
+
**Topics**: AppContext feature, accessing collection data, useAppContext hook, children components, modals, side panels
|
|
71
|
+
**Keywords**: AppContext, useAppContext, collection data access, children, modals, side panels, overlay components, outside main interface
|
|
72
|
+
|
|
69
73
|
### ID: `custom_overrides`
|
|
70
74
|
**Topics**: Customization, overrides, custom components, column customization, folder structure
|
|
71
75
|
**Keywords**: customization, custom functionality, overrides, extending functionality, custom components, custom rendering, column overrides, folder structure, organization, row data access
|
|
@@ -56,7 +56,7 @@ import React, { type FC } from 'react';
|
|
|
56
56
|
import { WixDesignSystemProvider } from '@wix/design-system';
|
|
57
57
|
import '@wix/design-system/styles.global.css';
|
|
58
58
|
import { WixPatternsProvider } from '@wix/patterns/provider';
|
|
59
|
-
import {
|
|
59
|
+
import { AutoPatternsOverridesProvider, AutoPatternsApp } from '@wix/auto-patterns';
|
|
60
60
|
import { withDashboard } from '@wix/patterns';
|
|
61
61
|
|
|
62
62
|
import { config } from './MyCollectionConfig.patterns';
|
|
@@ -65,9 +65,9 @@ const Index: FC = () => {
|
|
|
65
65
|
return (
|
|
66
66
|
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
|
|
67
67
|
<WixPatternsProvider>
|
|
68
|
-
<
|
|
68
|
+
<AutoPatternsOverridesProvider value={{ }}>
|
|
69
69
|
<AutoPatternsApp configuration={config} />
|
|
70
|
-
</
|
|
70
|
+
</AutoPatternsOverridesProvider>
|
|
71
71
|
</WixPatternsProvider>
|
|
72
72
|
</WixDesignSystemProvider>
|
|
73
73
|
);
|
|
@@ -19,6 +19,7 @@ export interface ResolvedAction {
|
|
|
19
19
|
hidden?: boolean;
|
|
20
20
|
tooltip?: string;
|
|
21
21
|
skin?: string;
|
|
22
|
+
biName?: string;
|
|
22
23
|
}
|
|
23
24
|
```
|
|
24
25
|
|
|
@@ -29,6 +30,7 @@ export interface ResolvedAction {
|
|
|
29
30
|
- **`label`** (string): Text displayed in the button or menu item.
|
|
30
31
|
- **`icon`** (IconElement): An icon component, typically from `@wix/wix-ui-icons-common`. Example: `icon: <Delete />`.
|
|
31
32
|
- **`onClick`** (function): Handler function invoked when the user triggers the action. Can be async.
|
|
33
|
+
- **`biName`** (string): Business intelligence name for analytics tracking. Used to identify the action in analytics and reporting systems. The value should match the `biName` specified in your action configuration.
|
|
32
34
|
|
|
33
35
|
### Optional Fields
|
|
34
36
|
|
|
@@ -52,7 +54,8 @@ return {
|
|
|
52
54
|
icon: <Add />,
|
|
53
55
|
onClick: () => {
|
|
54
56
|
// Your action logic here
|
|
55
|
-
}
|
|
57
|
+
},
|
|
58
|
+
biName: 'create-action' // MANDATORY: For analytics tracking
|
|
56
59
|
};
|
|
57
60
|
```
|
|
58
61
|
|
|
@@ -75,7 +78,8 @@ return {
|
|
|
75
78
|
disabled: total === 0,
|
|
76
79
|
tooltip: total === 0 ? 'Select at least one item to export' : undefined,
|
|
77
80
|
hidden: !userHasExportPermission,
|
|
78
|
-
skin: 'premium'
|
|
81
|
+
skin: 'premium',
|
|
82
|
+
biName: 'export_selected_items' // MANDATORY: For analytics tracking
|
|
79
83
|
};
|
|
80
84
|
```
|
|
81
85
|
|
|
@@ -259,9 +259,9 @@ export default function YourPage() {
|
|
|
259
259
|
const customDataSources = useCustomDataSources();
|
|
260
260
|
|
|
261
261
|
return (
|
|
262
|
-
<
|
|
262
|
+
<AutoPatternsOverridesProvider value={{ customDataSources }}>
|
|
263
263
|
<AutoPatternsApp configuration={config} />
|
|
264
|
-
</
|
|
264
|
+
</AutoPatternsOverridesProvider>
|
|
265
265
|
);
|
|
266
266
|
}
|
|
267
267
|
```
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { CollectionPage } from '@wix/patterns/page';
|
|
3
3
|
import { AutoPatternsCollectionPageContent } from '../AutoPatternsCollectionPageContent';
|
|
4
4
|
import { useCollectionPageActions } from '../../hooks/useCollectionPageActions';
|
|
5
|
-
import {
|
|
6
|
-
import { useAppConfigContext } from '../../providers';
|
|
5
|
+
import { AutoPatternsCollectionPageFooter } from '../AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter';
|
|
7
6
|
export const AutoPatternsCollectionPage = _ref => {
|
|
8
7
|
let {
|
|
9
8
|
configuration
|
|
@@ -12,31 +11,9 @@ export const AutoPatternsCollectionPage = _ref => {
|
|
|
12
11
|
title,
|
|
13
12
|
subtitle
|
|
14
13
|
} = configuration;
|
|
15
|
-
const {
|
|
16
|
-
layout
|
|
17
|
-
} = useAppConfigContext();
|
|
18
14
|
const actions = useCollectionPageActions({
|
|
19
15
|
collectionPageActions: configuration.actions
|
|
20
16
|
});
|
|
21
|
-
|
|
22
|
-
// This is temporary until we have support on it on CollectionPage component of WixPatterns
|
|
23
|
-
if (layout === 'panel') {
|
|
24
|
-
return /*#__PURE__*/React.createElement(SidePanel, {
|
|
25
|
-
skin: "floating",
|
|
26
|
-
width: "360px"
|
|
27
|
-
}, /*#__PURE__*/React.createElement(SidePanel.Header, {
|
|
28
|
-
title: "Manage Content"
|
|
29
|
-
}), /*#__PURE__*/React.createElement(SidePanel.Content, {
|
|
30
|
-
noPadding: true,
|
|
31
|
-
stretchVertically: true
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
33
|
-
direction: "vertical",
|
|
34
|
-
width: "100%",
|
|
35
|
-
height: "490px"
|
|
36
|
-
}, /*#__PURE__*/React.createElement(AutoPatternsCollectionPageContent, {
|
|
37
|
-
configuration: configuration
|
|
38
|
-
}))));
|
|
39
|
-
}
|
|
40
17
|
return /*#__PURE__*/React.createElement(CollectionPage, {
|
|
41
18
|
height: "100vh",
|
|
42
19
|
dataHook: "auto-patterns-page"
|
|
@@ -47,6 +24,6 @@ export const AutoPatternsCollectionPage = _ref => {
|
|
|
47
24
|
secondaryActions: actions.secondaryActions
|
|
48
25
|
}), /*#__PURE__*/React.createElement(CollectionPage.Content, null, /*#__PURE__*/React.createElement(AutoPatternsCollectionPageContent, {
|
|
49
26
|
configuration: configuration
|
|
50
|
-
})));
|
|
27
|
+
})), /*#__PURE__*/React.createElement(CollectionPage.Footer, null, /*#__PURE__*/React.createElement(AutoPatternsCollectionPageFooter, null)));
|
|
51
28
|
};
|
|
52
29
|
//# sourceMappingURL=AutoPatternsCollectionPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","CollectionPage","AutoPatternsCollectionPageContent","useCollectionPageActions","
|
|
1
|
+
{"version":3,"names":["React","CollectionPage","AutoPatternsCollectionPageContent","useCollectionPageActions","AutoPatternsCollectionPageFooter","AutoPatternsCollectionPage","_ref","configuration","title","subtitle","actions","collectionPageActions","createElement","height","dataHook","Header","primaryAction","primaryActions","secondaryActions","Content","Footer"],"sources":["../../../../src/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.tsx"],"sourcesContent":["import React from 'react';\nimport { CollectionPage } from '@wix/patterns/page';\nimport { AutoPatternsCollectionPageContent } from '../AutoPatternsCollectionPageContent';\nimport { CollectionPageConfig } from '../../types/CollectionPageConfig';\nimport { useCollectionPageActions } from '../../hooks/useCollectionPageActions';\nimport { AutoPatternsCollectionPageFooter } from '../AutoPatternsCollectionPageFooter/AutoPatternsCollectionPageFooter';\n\nexport interface AutoPatternsCollectionPageProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPage: React.FC<\n AutoPatternsCollectionPageProps\n> = ({ configuration }) => {\n const { title, subtitle } = configuration;\n\n const actions = useCollectionPageActions({\n collectionPageActions: configuration.actions,\n });\n\n return (\n <CollectionPage height=\"100vh\" dataHook=\"auto-patterns-page\">\n <CollectionPage.Header\n title={title}\n subtitle={subtitle}\n primaryAction={actions.primaryActions}\n secondaryActions={actions.secondaryActions}\n />\n <CollectionPage.Content>\n <AutoPatternsCollectionPageContent configuration={configuration} />\n </CollectionPage.Content>\n <CollectionPage.Footer>\n <AutoPatternsCollectionPageFooter />\n </CollectionPage.Footer>\n </CollectionPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,iCAAiC,QAAQ,sCAAsC;AAExF,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,gCAAgC,QAAQ,sEAAsE;AAMvH,OAAO,MAAMC,0BAEZ,GAAGC,IAAA,IAAuB;EAAA,IAAtB;IAAEC;EAAc,CAAC,GAAAD,IAAA;EACpB,MAAM;IAAEE,KAAK;IAAEC;EAAS,CAAC,GAAGF,aAAa;EAEzC,MAAMG,OAAO,GAAGP,wBAAwB,CAAC;IACvCQ,qBAAqB,EAAEJ,aAAa,CAACG;EACvC,CAAC,CAAC;EAEF,oBACEV,KAAA,CAAAY,aAAA,CAACX,cAAc;IAACY,MAAM,EAAC,OAAO;IAACC,QAAQ,EAAC;EAAoB,gBAC1Dd,KAAA,CAAAY,aAAA,CAACX,cAAc,CAACc,MAAM;IACpBP,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBO,aAAa,EAAEN,OAAO,CAACO,cAAe;IACtCC,gBAAgB,EAAER,OAAO,CAACQ;EAAiB,CAC5C,CAAC,eACFlB,KAAA,CAAAY,aAAA,CAACX,cAAc,CAACkB,OAAO,qBACrBnB,KAAA,CAAAY,aAAA,CAACV,iCAAiC;IAACK,aAAa,EAAEA;EAAc,CAAE,CAC5C,CAAC,eACzBP,KAAA,CAAAY,aAAA,CAACX,cAAc,CAACmB,MAAM,qBACpBpB,KAAA,CAAAY,aAAA,CAACR,gCAAgC,MAAE,CACd,CACT,CAAC;AAErB,CAAC","ignoreList":[]}
|
package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useAutoPatternsOverridesContext } from '../../providers';
|
|
3
3
|
import { AutoPatternsCollectionComponent } from '../AutoPatternsCollectionComponent/AutoPatternsCollectionComponent';
|
|
4
4
|
export const AutoPatternsCollectionPageContent = _ref => {
|
|
5
5
|
let {
|
|
@@ -8,7 +8,7 @@ export const AutoPatternsCollectionPageContent = _ref => {
|
|
|
8
8
|
const {
|
|
9
9
|
components
|
|
10
10
|
} = configuration;
|
|
11
|
-
const overrides =
|
|
11
|
+
const overrides = useAutoPatternsOverridesContext();
|
|
12
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, components.map((component, index) => {
|
|
13
13
|
if (component.type === 'collection') {
|
|
14
14
|
return /*#__PURE__*/React.createElement(AutoPatternsCollectionComponent, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useAutoPatternsOverridesContext","AutoPatternsCollectionComponent","AutoPatternsCollectionPageContent","_ref","configuration","components","overrides","createElement","Fragment","map","component","index","type","key","collection","collectionId","_overrides$slots","CustomComponent","slots","id","filter","Boolean"],"sources":["../../../../src/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.tsx"],"sourcesContent":["import React from 'react';\nimport { CollectionPageConfig } from '../../types';\nimport { useAutoPatternsOverridesContext } from '../../providers';\nimport { AutoPatternsCollectionComponent } from '../AutoPatternsCollectionComponent/AutoPatternsCollectionComponent';\n\nexport interface AutoPatternsCollectionPageContentProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPageContent = ({\n configuration,\n}: AutoPatternsCollectionPageContentProps) => {\n const { components } = configuration;\n const overrides = useAutoPatternsOverridesContext();\n\n return (\n <>\n {components\n .map((component, index) => {\n if (component.type === 'collection') {\n return (\n <AutoPatternsCollectionComponent\n key={`collection-${component.collection.collectionId}-${index}`}\n component={component}\n index={index}\n />\n );\n } else if (component.type === 'custom') {\n const CustomComponent = overrides?.slots?.[component.id];\n\n if (!CustomComponent) {\n return null;\n }\n\n return <CustomComponent key={`custom-${component.id}-${index}`} />;\n }\n\n return null;\n })\n .filter(Boolean)}\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,+BAA+B,QAAQ,iBAAiB;AACjE,SAASC,+BAA+B,QAAQ,oEAAoE;AAMpH,OAAO,MAAMC,iCAAiC,GAAGC,IAAA,IAEH;EAAA,IAFI;IAChDC;EACsC,CAAC,GAAAD,IAAA;EACvC,MAAM;IAAEE;EAAW,CAAC,GAAGD,aAAa;EACpC,MAAME,SAAS,GAAGN,+BAA+B,CAAC,CAAC;EAEnD,oBACED,KAAA,CAAAQ,aAAA,CAAAR,KAAA,CAAAS,QAAA,QACGH,UAAU,CACRI,GAAG,CAAC,CAACC,SAAS,EAAEC,KAAK,KAAK;IACzB,IAAID,SAAS,CAACE,IAAI,KAAK,YAAY,EAAE;MACnC,oBACEb,KAAA,CAAAQ,aAAA,CAACN,+BAA+B;QAC9BY,GAAG,EAAE,cAAcH,SAAS,CAACI,UAAU,CAACC,YAAY,IAAIJ,KAAK,EAAG;QAChED,SAAS,EAAEA,SAAU;QACrBC,KAAK,EAAEA;MAAM,CACd,CAAC;IAEN,CAAC,MAAM,IAAID,SAAS,CAACE,IAAI,KAAK,QAAQ,EAAE;MAAA,IAAAI,gBAAA;MACtC,MAAMC,eAAe,GAAGX,SAAS,aAAAU,gBAAA,GAATV,SAAS,CAAEY,KAAK,qBAAhBF,gBAAA,CAAmBN,SAAS,CAACS,EAAE,CAAC;MAExD,IAAI,CAACF,eAAe,EAAE;QACpB,OAAO,IAAI;MACb;MAEA,oBAAOlB,KAAA,CAAAQ,aAAA,CAACU,eAAe;QAACJ,GAAG,EAAE,UAAUH,SAAS,CAACS,EAAE,IAAIR,KAAK;MAAG,CAAE,CAAC;IACpE;IAEA,OAAO,IAAI;EACb,CAAC,CAAC,CACDS,MAAM,CAACC,OAAO,CACjB,CAAC;AAEP,CAAC","ignoreList":[]}
|