@wix/auto-patterns 1.19.0 → 1.21.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/AutoPatternsEntityPage/Fields/ImageInput.js +5 -4
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +6 -2
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/cjs/hooks/useBaseTableFeatures.js +4 -3
- package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +12 -2
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +4 -2
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/cjs/providers/ErrorContext.js +64 -0
- package/dist/cjs/providers/ErrorContext.js.map +1 -0
- package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/cjs/providers/RootAppProvider.js +16 -8
- package/dist/cjs/providers/RootAppProvider.js.map +1 -1
- package/dist/cjs/providers/SchemaContext.js +7 -2
- package/dist/cjs/providers/SchemaContext.js.map +1 -1
- package/dist/cjs/providers/index.js +6 -0
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/docs/action_cell.md +21 -8
- package/dist/docs/app_config_structure.md +3 -2
- package/dist/docs/auto-patterns-guide.md +417 -117
- package/dist/docs/bulk_actions.md +20 -7
- package/dist/docs/collection_page_actions.md +44 -18
- package/dist/docs/custom_overrides.md +318 -71
- package/dist/docs/index.md +1 -1
- package/dist/docs/installation.md +8 -9
- package/dist/docs/introduction.md +3 -2
- package/dist/docs/wix_fqdn_custom_data_source.md +111 -54
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js +4 -3
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +6 -2
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/esm/hooks/useBaseTableFeatures.js +3 -2
- package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +13 -3
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +4 -2
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/esm/providers/ErrorContext.js +44 -0
- package/dist/esm/providers/ErrorContext.js.map +1 -0
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/esm/providers/RootAppProvider.js +2 -1
- package/dist/esm/providers/RootAppProvider.js.map +1 -1
- package/dist/esm/providers/SchemaContext.js +6 -1
- package/dist/esm/providers/SchemaContext.js.map +1 -1
- package/dist/esm/providers/index.js +1 -0
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/ImageInput.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
- package/dist/types/hooks/useBaseTableFeatures.d.ts +1 -0
- package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts +7 -0
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +1 -0
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/providers/ErrorContext.d.ts +11 -0
- package/dist/types/providers/ErrorContext.d.ts.map +1 -0
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -0
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
- package/dist/types/providers/RootAppProvider.d.ts.map +1 -1
- package/dist/types/providers/SchemaContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/index.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/collectionPageActions.d.ts +7 -0
- package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +1 -5
- package/dist/types/types/types.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -59,7 +59,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
59
59
|
├── page.tsx
|
|
60
60
|
└── components/
|
|
61
61
|
└── actions/
|
|
62
|
-
├── index.tsx // Exports
|
|
62
|
+
├── index.tsx // Exports useActions hook
|
|
63
63
|
└── bulkExportPets.tsx // Your custom bulk action
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -121,10 +121,17 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
121
121
|
|
|
122
122
|
3. Export your action in `actions/index.tsx`:
|
|
123
123
|
```typescript
|
|
124
|
-
|
|
124
|
+
import { bulkExportPets } from './bulkExportPets';
|
|
125
|
+
|
|
126
|
+
export const useActions = () => {
|
|
127
|
+
// You can access React context and other hooks here
|
|
128
|
+
return {
|
|
129
|
+
bulkExportPets
|
|
130
|
+
};
|
|
131
|
+
};
|
|
125
132
|
```
|
|
126
133
|
|
|
127
|
-
4. Configure the action in your
|
|
134
|
+
4. Configure the action in your TypeScript configuration:
|
|
128
135
|
```json
|
|
129
136
|
{
|
|
130
137
|
"id": "bulkExportPets", // MUST match the function name exactly
|
|
@@ -135,11 +142,17 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
|
|
|
135
142
|
|
|
136
143
|
5. Register your action in the `PatternsWizardOverridesProvider`:
|
|
137
144
|
```typescript
|
|
138
|
-
import
|
|
145
|
+
import { useActions } from '../components/actions';
|
|
146
|
+
|
|
147
|
+
export default function YourPage() {
|
|
148
|
+
const actions = useActions();
|
|
139
149
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
150
|
+
return (
|
|
151
|
+
<PatternsWizardOverridesProvider value={{ actions }}>
|
|
152
|
+
<AutoPatternsApp configuration={config} />
|
|
153
|
+
</PatternsWizardOverridesProvider>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
143
156
|
```
|
|
144
157
|
|
|
145
158
|
### Key Points for Custom Bulk Actions:
|
|
@@ -56,7 +56,7 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
56
56
|
├── page.tsx
|
|
57
57
|
└── components/
|
|
58
58
|
└── actions/
|
|
59
|
-
├── index.tsx // Exports
|
|
59
|
+
├── index.tsx // Exports useActions hook
|
|
60
60
|
└── exportCollection.tsx // Your custom collection action
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -103,10 +103,17 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
103
103
|
|
|
104
104
|
3. Export your action in `actions/index.tsx`:
|
|
105
105
|
```typescript
|
|
106
|
-
|
|
106
|
+
import { exportCollection } from './exportCollection';
|
|
107
|
+
|
|
108
|
+
export const useActions = () => {
|
|
109
|
+
// You can access React context and other hooks here
|
|
110
|
+
return {
|
|
111
|
+
exportCollection
|
|
112
|
+
};
|
|
113
|
+
};
|
|
107
114
|
```
|
|
108
115
|
|
|
109
|
-
4. Configure the action in your
|
|
116
|
+
4. Configure the action in your TypeScript configuration:
|
|
110
117
|
```json
|
|
111
118
|
{
|
|
112
119
|
"id": "exportCollection", // MUST match the function name exactly
|
|
@@ -121,11 +128,17 @@ Custom collection page actions execute JavaScript code that you define for colle
|
|
|
121
128
|
|
|
122
129
|
5. Register your action in the `PatternsWizardOverridesProvider`:
|
|
123
130
|
```typescript
|
|
124
|
-
import
|
|
131
|
+
import { useActions } from '../components/actions';
|
|
125
132
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
export default function YourPage() {
|
|
134
|
+
const actions = useActions();
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<PatternsWizardOverridesProvider value={{ actions }}>
|
|
138
|
+
<AutoPatternsApp configuration={config} />
|
|
139
|
+
</PatternsWizardOverridesProvider>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
129
142
|
```
|
|
130
143
|
|
|
131
144
|
## Key Points for Custom Collection Page Actions:
|
|
@@ -165,7 +178,7 @@ Row click actions are configured at the table level using the `onRowClick` prope
|
|
|
165
178
|
|
|
166
179
|
### Implementation Requirements
|
|
167
180
|
|
|
168
|
-
⚠️ **CRITICAL**: When you configure `onRowClick` in your
|
|
181
|
+
⚠️ **CRITICAL**: When you configure `onRowClick` in your TypeScript configuration, you MUST provide a complete working implementation. The Auto Patterns framework cannot function without it.
|
|
169
182
|
|
|
170
183
|
Custom row click actions use the `CustomActionCollectionPageActionOnRowClickResolver` type and MUST return a `ResolvedAction` object with all required properties:
|
|
171
184
|
|
|
@@ -243,7 +256,18 @@ export const openSidePanel: CustomActionCollectionPageActionOnRowClickResolver =
|
|
|
243
256
|
};
|
|
244
257
|
```
|
|
245
258
|
|
|
246
|
-
**Step 2:
|
|
259
|
+
**Step 2: Export your action in `actions/index.tsx`**:
|
|
260
|
+
```typescript
|
|
261
|
+
import { openSidePanel } from './openSidePanel';
|
|
262
|
+
|
|
263
|
+
export const useActions = () => {
|
|
264
|
+
return {
|
|
265
|
+
openSidePanel
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Step 3: Configure in TypeScript**:
|
|
247
271
|
```json
|
|
248
272
|
{
|
|
249
273
|
"type": "Table",
|
|
@@ -257,17 +281,19 @@ export const openSidePanel: CustomActionCollectionPageActionOnRowClickResolver =
|
|
|
257
281
|
}
|
|
258
282
|
```
|
|
259
283
|
|
|
260
|
-
**Step
|
|
284
|
+
**Step 4: Register in `PatternsWizardOverridesProvider`**:
|
|
261
285
|
```typescript
|
|
262
|
-
|
|
263
|
-
export * from './openSidePanel';
|
|
286
|
+
import { useActions } from '../components/actions';
|
|
264
287
|
|
|
265
|
-
|
|
266
|
-
|
|
288
|
+
export default function YourPage() {
|
|
289
|
+
const actions = useActions();
|
|
267
290
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
291
|
+
return (
|
|
292
|
+
<PatternsWizardOverridesProvider value={{ actions }}>
|
|
293
|
+
<AutoPatternsApp configuration={config} />
|
|
294
|
+
</PatternsWizardOverridesProvider>
|
|
295
|
+
);
|
|
296
|
+
}
|
|
271
297
|
```
|
|
272
298
|
|
|
273
299
|
#### 2. Direct Data Manipulation
|
|
@@ -314,7 +340,7 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
|
|
|
314
340
|
- You can still navigate to the entity page programmatically if needed using the SDK navigation utilities
|
|
315
341
|
|
|
316
342
|
### Key Points for Custom Row Click Actions:
|
|
317
|
-
- **MANDATORY IMPLEMENTATION**: If you configure `onRowClick` in
|
|
343
|
+
- **MANDATORY IMPLEMENTATION**: If you configure `onRowClick` in TypeScript configuration, you MUST provide a complete working implementation - the framework cannot function without it
|
|
318
344
|
- The action `id` in the configuration MUST exactly match the function name exported from your actions folder
|
|
319
345
|
- The implementation must use the `CustomActionCollectionPageActionOnRowClickResolver` type
|
|
320
346
|
- **Required Return Object**: Must return an object with `label`, `icon`, and `onClick` properties - all are required
|