@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.
Files changed (78) hide show
  1. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js +5 -4
  2. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +6 -2
  4. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  5. package/dist/cjs/hooks/useBaseTableFeatures.js +4 -3
  6. package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
  7. package/dist/cjs/hooks/useTableFeatures.js +12 -2
  8. package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
  9. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +4 -2
  10. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
  11. package/dist/cjs/providers/ErrorContext.js +64 -0
  12. package/dist/cjs/providers/ErrorContext.js.map +1 -0
  13. package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
  14. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
  15. package/dist/cjs/providers/RootAppProvider.js +16 -8
  16. package/dist/cjs/providers/RootAppProvider.js.map +1 -1
  17. package/dist/cjs/providers/SchemaContext.js +7 -2
  18. package/dist/cjs/providers/SchemaContext.js.map +1 -1
  19. package/dist/cjs/providers/index.js +6 -0
  20. package/dist/cjs/providers/index.js.map +1 -1
  21. package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
  22. package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
  23. package/dist/cjs/types/types.js.map +1 -1
  24. package/dist/docs/action_cell.md +21 -8
  25. package/dist/docs/app_config_structure.md +3 -2
  26. package/dist/docs/auto-patterns-guide.md +417 -117
  27. package/dist/docs/bulk_actions.md +20 -7
  28. package/dist/docs/collection_page_actions.md +44 -18
  29. package/dist/docs/custom_overrides.md +318 -71
  30. package/dist/docs/index.md +1 -1
  31. package/dist/docs/installation.md +8 -9
  32. package/dist/docs/introduction.md +3 -2
  33. package/dist/docs/wix_fqdn_custom_data_source.md +111 -54
  34. package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js +4 -3
  35. package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
  36. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +6 -2
  37. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  38. package/dist/esm/hooks/useBaseTableFeatures.js +3 -2
  39. package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
  40. package/dist/esm/hooks/useTableFeatures.js +13 -3
  41. package/dist/esm/hooks/useTableFeatures.js.map +1 -1
  42. package/dist/esm/hooks/useTableGridSwitchFeatures.js +4 -2
  43. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
  44. package/dist/esm/providers/ErrorContext.js +44 -0
  45. package/dist/esm/providers/ErrorContext.js.map +1 -0
  46. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
  47. package/dist/esm/providers/RootAppProvider.js +2 -1
  48. package/dist/esm/providers/RootAppProvider.js.map +1 -1
  49. package/dist/esm/providers/SchemaContext.js +6 -1
  50. package/dist/esm/providers/SchemaContext.js.map +1 -1
  51. package/dist/esm/providers/index.js +1 -0
  52. package/dist/esm/providers/index.js.map +1 -1
  53. package/dist/esm/types/CollectionPageConfig.js.map +1 -1
  54. package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
  55. package/dist/esm/types/types.js.map +1 -1
  56. package/dist/types/components/AutoPatternsEntityPage/Fields/ImageInput.d.ts.map +1 -1
  57. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
  58. package/dist/types/hooks/useBaseTableFeatures.d.ts +1 -0
  59. package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
  60. package/dist/types/hooks/useTableFeatures.d.ts +7 -0
  61. package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
  62. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +1 -0
  63. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
  64. package/dist/types/providers/ErrorContext.d.ts +11 -0
  65. package/dist/types/providers/ErrorContext.d.ts.map +1 -0
  66. package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -0
  67. package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
  68. package/dist/types/providers/RootAppProvider.d.ts.map +1 -1
  69. package/dist/types/providers/SchemaContext.d.ts.map +1 -1
  70. package/dist/types/providers/index.d.ts +1 -0
  71. package/dist/types/providers/index.d.ts.map +1 -1
  72. package/dist/types/types/CollectionPageConfig.d.ts +4 -0
  73. package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
  74. package/dist/types/types/actions/collectionPageActions.d.ts +7 -0
  75. package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
  76. package/dist/types/types/types.d.ts +1 -5
  77. package/dist/types/types/types.d.ts.map +1 -1
  78. package/package.json +14 -14
@@ -4,6 +4,8 @@ When implementing a custom data source based on a Wix Business API FQDN, you'll
4
4
 
5
5
  **⚠️ IMPORTANT**: This guide creates a foundation with helpful comments and unimplemented actions that throw exceptions. The actual data source implementation (CRUD operations) must be completed by you using the appropriate Wix Business API client library.
6
6
 
7
+ **📝 MINIMAL IMPLEMENTATION APPROACH**: This guide focuses on creating a basic, functional dashboard page. Custom overrides (actions, columns, components, etc.) should only be implemented when explicitly requested by the user. A simple dashboard page requires only the core custom data source implementation without any additional overrides.
8
+
7
9
  ## Prerequisites: Required Tools
8
10
 
9
11
  **🛑 CRITICAL**: Before proceeding with this guide, you must have the following tools available:
@@ -85,11 +87,11 @@ This conversion ensures:
85
87
  - **Proper field mapping** between configuration and data source
86
88
  - **Seamless integration** with AutoPatterns components
87
89
 
88
- For the complete SchemaConfig interface, field definitions, and implementation details, refer to the `schema_config` section.
90
+ For the complete SchemaConfig interface, field definitions, and implementation details, refer to the "Schema Config" section.
89
91
 
90
92
  ## Step 4: Set Up Custom Data Source Structure
91
93
 
92
- Follow the complete custom data source implementation guide in the `custom_overrides` section. The key FQDN-specific considerations are:
94
+ Follow the complete custom data source implementation guide in the "Custom Overrides" section. The key FQDN-specific considerations are:
93
95
 
94
96
  1. **Import the client library** identified in Step 2
95
97
  2. **Use the field mappings** from Step 3 in your SchemaConfig
@@ -97,52 +99,75 @@ Follow the complete custom data source implementation guide in the `custom_overr
97
99
 
98
100
  **Important**: The schema actions should contain helpful comments but NOT actual implementations. Each action should throw an error indicating it's unimplemented and needs to be implemented by the user.
99
101
 
100
- For detailed implementation patterns, folder structure, and registration steps, refer to the **Custom Data Sources** section in `custom_overrides`.
102
+ ### Custom Data Source Hook Implementation
101
103
 
102
- ### Example: Unimplemented Actions Structure
104
+ Create your custom data source with the hook pattern:
103
105
 
104
- Here's what your schema actions should look like - containing helpful comments but throwing unimplemented exceptions:
106
+ In `components/customDataSources/myCustomDataSource.ts`:
107
+ ```typescript
108
+ export const myCustomDataSource = async (collectionId: string, context: any) => {
109
+ return {
110
+ id: 'myCustomCollection',
111
+ fields: {
112
+ // Field definitions based on your FQDN schema mapping
113
+ },
114
+ displayField: 'name',
115
+ idField: '_id',
116
+ actions: {
117
+ get: async (entityId: string) => {
118
+ // TODO: Implement using your FQDN client library
119
+ // Example: const result = await yourFQDNClient.getEntity(entityId);
120
+ // Remember to map the response fields from snake_case to camelCase
121
+ throw new Error('get action not implemented - user must implement this method');
122
+ },
123
+ create: async (newEntity: any) => {
124
+ // TODO: Implement using your FQDN client library
125
+ // Example: const result = await yourFQDNClient.createEntity(newEntity);
126
+ // Remember to map the request fields from camelCase to snake_case
127
+ throw new Error('create action not implemented - user must implement this method');
128
+ },
129
+ update: async (updatedEntity: any) => {
130
+ // TODO: Implement using your FQDN client library
131
+ // Example: const result = await yourFQDNClient.updateEntity(updatedEntity);
132
+ // Remember to map the request fields from camelCase to snake_case
133
+ throw new Error('update action not implemented - user must implement this method');
134
+ },
135
+ delete: async (entityId: string) => {
136
+ // TODO: Implement using your FQDN client library
137
+ // Example: await yourFQDNClient.deleteEntity(entityId);
138
+ throw new Error('delete action not implemented - user must implement this method');
139
+ },
140
+ bulkDelete: async (entityIds: string[]) => {
141
+ // TODO: Implement using your FQDN client library
142
+ // Example: await yourFQDNClient.bulkDeleteEntities(entityIds);
143
+ throw new Error('bulkDelete action not implemented - user must implement this method');
144
+ },
145
+ find: async (query: Query, options?: any) => {
146
+ // TODO: Implement using your FQDN client library
147
+ // Example: const result = await yourFQDNClient.queryEntities(query, options);
148
+ // Remember to map the response fields from snake_case to camelCase
149
+ // Must return: { items: any[], total: number }
150
+ throw new Error('find action not implemented - user must implement this method');
151
+ }
152
+ }
153
+ };
154
+ };
155
+ ```
105
156
 
157
+ In `components/customDataSources/index.tsx`:
106
158
  ```typescript
107
- actions: {
108
- get: async (entityId: string) => {
109
- // TODO: Implement using your FQDN client library
110
- // Example: const result = await yourFQDNClient.getEntity(entityId);
111
- // Remember to map the response fields from snake_case to camelCase
112
- throw new Error('get action not implemented - user must implement this method');
113
- },
114
- create: async (newEntity: any) => {
115
- // TODO: Implement using your FQDN client library
116
- // Example: const result = await yourFQDNClient.createEntity(newEntity);
117
- // Remember to map the request fields from camelCase to snake_case
118
- throw new Error('create action not implemented - user must implement this method');
119
- },
120
- update: async (updatedEntity: any) => {
121
- // TODO: Implement using your FQDN client library
122
- // Example: const result = await yourFQDNClient.updateEntity(updatedEntity);
123
- // Remember to map the request fields from camelCase to snake_case
124
- throw new Error('update action not implemented - user must implement this method');
125
- },
126
- delete: async (entityId: string) => {
127
- // TODO: Implement using your FQDN client library
128
- // Example: await yourFQDNClient.deleteEntity(entityId);
129
- throw new Error('delete action not implemented - user must implement this method');
130
- },
131
- bulkDelete: async (entityIds: string[]) => {
132
- // TODO: Implement using your FQDN client library
133
- // Example: await yourFQDNClient.bulkDeleteEntities(entityIds);
134
- throw new Error('bulkDelete action not implemented - user must implement this method');
135
- },
136
- find: async (query: Query, options?: any) => {
137
- // TODO: Implement using your FQDN client library
138
- // Example: const result = await yourFQDNClient.queryEntities(query, options);
139
- // Remember to map the response fields from snake_case to camelCase
140
- // Must return: { items: any[], total: number }
141
- throw new Error('find action not implemented - user must implement this method');
142
- }
143
- }
159
+ import { myCustomDataSource } from './myCustomDataSource';
160
+
161
+ export const useCustomDataSources = () => {
162
+ // You can access React context and other hooks here
163
+ return {
164
+ myCustomDataSource
165
+ };
166
+ };
144
167
  ```
145
168
 
169
+ For detailed implementation patterns, folder structure, and registration steps, refer to the **Custom Data Sources** section in "Custom Overrides".
170
+
146
171
  ## Step 5: Update AppConfig
147
172
 
148
173
  Configure your AppConfig to use the custom data source by setting:
@@ -161,24 +186,53 @@ Configure your AppConfig to use the custom data source by setting:
161
186
  }
162
187
  ```
163
188
 
164
- For complete AppConfig structure, configuration rules, and advanced options, refer to the `app_config_structure` section.
189
+ For complete AppConfig structure, configuration rules, and advanced options, refer to the "App Config Structure" section.
190
+
191
+ ## Step 6: Register Custom Data Source
192
+
193
+ In your main page component, use the hook to register your custom data source:
194
+
195
+ ```tsx
196
+ import { useCustomDataSources } from '../components/customDataSources';
197
+
198
+ export default function YourPage() {
199
+ const customDataSources = useCustomDataSources();
200
+
201
+ return (
202
+ <PatternsWizardOverridesProvider value={{ customDataSources }}>
203
+ <AutoPatternsApp configuration={config} />
204
+ </PatternsWizardOverridesProvider>
205
+ );
206
+ }
207
+ ```
208
+
209
+ ## Step 7: Implement Custom Actions (Only if Explicitly Requested)
165
210
 
166
- ## Step 6: Implement Custom Actions (Optional)
211
+ **⚠️ IMPORTANT**: Custom actions should only be implemented when the user explicitly requests them. A basic dashboard page with standard CRUD operations does not require custom actions.
167
212
 
168
- If you need custom actions for your FQDN-based data source, follow the action implementation patterns from the `custom_overrides` section. Your custom actions will have access to the same SDK utilities, but remember that they will need to interact with your FQDN-based API directly since the SchemaConfig actions from Step 4 are left unimplemented for you to complete.
213
+ If the user specifically requests custom actions for your FQDN-based data source, follow the action implementation patterns from the "Custom Overrides" section. Your custom actions will have access to the same SDK utilities, but remember that they will need to interact with your FQDN-based API directly since the SchemaConfig actions from Step 4 are left unimplemented for you to complete.
169
214
 
170
215
  ## FQDN-Specific Implementation Checklist
171
216
 
217
+ ### Core Requirements (Always Required)
172
218
  ✅ **Schema Extraction**: Used fqdn_schema tool to understand entity structure
173
219
  ✅ **Client Library**: Used client_lib tool to identify correct SDK package
174
220
  ✅ **Field Mapping**: Mapped FQDN field types to AutoPatterns field types
175
221
  ✅ **⚠️ CRITICAL: Field ID Conversion**: Converted individual field segments from snake_case to camelCase while preserving field path structure in SchemaConfig and AppConfig
176
222
  ✅ **AppConfig Update**: Set `entityTypeSource: "custom"` and provided custom.id
177
- ✅ **Custom Data Source Structure**: Followed `custom_overrides` section for folder structure and registration
223
+ ✅ **Custom Data Source Structure**: Followed "Custom Overrides" section for folder structure and registration
224
+ ✅ **Hook Implementation**: Created useCustomDataSources hook for accessing React context
178
225
  ✅ **⚠️ CRITICAL: Unimplemented Actions**: All schema actions contain helpful comments but throw unimplemented exceptions - **user must implement these actions themselves**
179
226
 
227
+ ### Optional Enhancements (Only When Explicitly Requested)
228
+ ⚠️ **Custom Actions**: Only implement if user specifically requests custom actions beyond standard CRUD
229
+ ⚠️ **Column Overrides**: Only implement if user requests custom column rendering
230
+ ⚠️ **Custom Components**: Only implement if user requests custom entity page components
231
+ ⚠️ **Bulk Operations**: Only implement if user requests custom bulk actions beyond standard bulk delete
232
+
180
233
  ## Common FQDN-Specific Pitfalls to Avoid
181
234
 
235
+ - **⚠️ CRITICAL: Implementing Unnecessary Overrides**: Do NOT implement custom actions, column overrides, or custom components unless explicitly requested by the user - a basic dashboard page only needs the core custom data source
182
236
  - **⚠️ CRITICAL: Inconsistent Field ID Casing**: Failing to convert individual field segments from snake_case to camelCase while preserving field path structure in SchemaConfig and AppConfig - this is the most common mistake and will cause field mapping failures
183
237
  - **⚠️ CRITICAL: Implementing Actions**: DO NOT implement the schema actions - they should contain helpful comments and throw unimplemented exceptions for the user to complete
184
238
  - **Mismatched Field Types**: Ensure FQDN field types are correctly mapped to AutoPatterns types
@@ -186,16 +240,19 @@ If you need custom actions for your FQDN-based data source, follow the action im
186
240
  - **ID Field Confusion**: Ensure the idField matches what your FQDN API actually uses (often `_id` for Wix APIs)
187
241
  - **Display Field Selection**: Choose a display field that provides meaningful identification from your FQDN schema
188
242
  - **Custom Data Source ID Mismatch**: Ensure the custom.id in AppConfig matches your custom data source identifier
243
+ - **Hook Registration**: Don't forget to register the custom data source through the useCustomDataSources hook
244
+
245
+ For general implementation pitfalls, refer to the "Custom Overrides" section.
189
246
 
190
- For general implementation pitfalls, refer to the `custom_overrides` section.
247
+ ## Advanced Customization (Only When Explicitly Requested)
191
248
 
192
- ## Advanced Customization
249
+ **⚠️ IMPORTANT**: The following customizations should only be implemented when the user explicitly requests them. A basic dashboard page does not require these advanced features.
193
250
 
194
- For advanced customization options, refer to these section IDs:
195
- - `collection_page_actions` - For custom collection-level actions
196
- - `action_cell` - For custom row-level actions
197
- - `bulk_actions` - For custom bulk operations
198
- - `entity_page_actions` - For custom entity-level actions
199
- - `custom_overrides` - For column overrides and custom components
251
+ For advanced customization options when specifically requested, refer to these sections:
252
+ - "Collection Page Actions" - For custom collection-level actions
253
+ - "Action Cell" - For custom row-level actions
254
+ - "Bulk Actions" - For custom bulk operations
255
+ - "Entity Page Actions" - For custom entity-level actions
256
+ - "Custom Overrides" - For column overrides and custom components
200
257
 
201
258
  By following these steps, you'll successfully implement a custom data source that integrates seamlessly with AutoPatternsApp while leveraging Wix Business APIs through their FQDNs.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FormField, ImageViewer } from '@wix/design-system';
3
- import { useEntityPageContext, useSelector, useWixPatternsContainer } from '@wix/patterns';
3
+ import { useEntityPageContext, useIsMobile, useSelector, useWixPatternsContainer } from '@wix/patterns';
4
4
  import { useController } from '@wix/patterns/form';
5
5
  import { getImageUrl } from '../../../utils/media/getImageUrl';
6
6
  import { dashboard } from '@wix/dashboard';
@@ -15,6 +15,7 @@ export const ImageInput = props => {
15
15
  ...container
16
16
  } = useWixPatternsContainer();
17
17
  useSelector(() => container.initTask.status);
18
+ const isMobile = useIsMobile();
18
19
  const pageState = useEntityPageContext();
19
20
  async function openMedia() {
20
21
  try {
@@ -53,8 +54,8 @@ export const ImageInput = props => {
53
54
  }, /*#__PURE__*/React.createElement(ImageViewer, {
54
55
  imageUrl: imageUrl,
55
56
  dataHook: `image-${field.id}`,
56
- onAddImage: () => openMedia(),
57
- onUpdateImage: () => openMedia(),
57
+ onAddImage: isMobile ? undefined : () => openMedia(),
58
+ onUpdateImage: isMobile ? undefined : () => openMedia(),
58
59
  updateImageInfo: t('cairo.replace-image.tooltip'),
59
60
  removeImageInfo: t('cairo.remove-image.tooltip'),
60
61
  addImageInfo: t('cairo.add-image.tooltip'),
@@ -1 +1 @@
1
- {"version":3,"names":["React","FormField","ImageViewer","useEntityPageContext","useSelector","useWixPatternsContainer","useController","getImageUrl","dashboard","ImageInput","props","_pageState$entity","_field$validation2","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","pageState","openMedia","_chosenMediaItems$ite","chosenMediaItems","openMediaManager","multiSelect","category","newImage","items","media","image","controller","onChange","error","console","name","id","control","form","defaultValue","entity","rules","validate","value","_field$validation","validation","required","undefined","imageUrl","createElement","label","displayName","fieldState","statusMessage","message","onAddImage","onUpdateImage","updateImageInfo","removeImageInfo","addImageInfo","height","width","fit","onRemoveImage"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ImageInput.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, ImageViewer } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport {\n useEntityPageContext,\n useSelector,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { getImageUrl } from '../../../utils/media/getImageUrl';\nimport { dashboard } from '@wix/dashboard';\n\nexport interface ImageInputProps extends BaseInputProps<string> {}\n\nexport const ImageInput = (props: ImageInputProps) => {\n const { field, dataHook } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const pageState = useEntityPageContext();\n\n async function openMedia() {\n try {\n const chosenMediaItems = await dashboard.openMediaManager({\n multiSelect: false,\n category: 'IMAGE',\n });\n\n const newImage = chosenMediaItems?.items[0]?.media?.image?.image;\n\n controller.field.onChange(newImage);\n } catch (error) {\n console.error('Error opening Media Manager or no files selected:', error);\n }\n }\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n rules: {\n validate: (value) => {\n if (\n field.validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n }\n\n return true;\n },\n },\n });\n\n const imageUrl =\n controller.field.value && getImageUrl(controller.field.value);\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n status={controller.fieldState.error ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n dataHook={dataHook}\n >\n <ImageViewer\n imageUrl={imageUrl}\n dataHook={`image-${field.id}`}\n onAddImage={() => openMedia()}\n onUpdateImage={() => openMedia()}\n updateImageInfo={t('cairo.replace-image.tooltip')}\n removeImageInfo={t('cairo.remove-image.tooltip')}\n addImageInfo={t('cairo.add-image.tooltip')}\n height=\"120px\"\n width=\"25%\"\n fit=\"cover\"\n onRemoveImage={() => controller.field.onChange(null)}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAE3D,SACEC,oBAAoB,EACpBC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,WAAW,QAAQ,kCAAkC;AAC9D,SAASC,SAAS,QAAQ,gBAAgB;AAI1C,OAAO,MAAMC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AE;IAC3C4C,MAAM,EAAC,OAAO;IACdC,KAAK,EAAC,KAAK;IACXC,GAAG,EAAC,OAAO;IACXC,aAAa,EAAEA,CAAA,KAAMhC,UAAU,CAAClB,KAAK,CAACmB,QAAQ,CAAC,IAAI;EAAE,CACtD,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","FormField","ImageViewer","useEntityPageContext","useIsMobile","useSelector","useWixPatternsContainer","useController","getImageUrl","dashboard","ImageInput","props","_pageState$entity","_field$validation2","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","isMobile","pageState","openMedia","_chosenMediaItems$ite","chosenMediaItems","openMediaManager","multiSelect","category","newImage","items","media","image","controller","onChange","error","console","name","id","control","form","defaultValue","entity","rules","validate","value","_field$validation","validation","required","undefined","imageUrl","createElement","label","displayName","fieldState","statusMessage","message","onAddImage","onUpdateImage","updateImageInfo","removeImageInfo","addImageInfo","height","width","fit","onRemoveImage"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ImageInput.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, ImageViewer } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport {\n useEntityPageContext,\n useIsMobile,\n useSelector,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { getImageUrl } from '../../../utils/media/getImageUrl';\nimport { dashboard } from '@wix/dashboard';\n\nexport interface ImageInputProps extends BaseInputProps<string> {}\n\nexport const ImageInput = (props: ImageInputProps) => {\n const { field, dataHook } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n const isMobile = useIsMobile();\n const pageState = useEntityPageContext();\n\n async function openMedia() {\n try {\n const chosenMediaItems = await dashboard.openMediaManager({\n multiSelect: false,\n category: 'IMAGE',\n });\n\n const newImage = chosenMediaItems?.items[0]?.media?.image?.image;\n\n controller.field.onChange(newImage);\n } catch (error) {\n console.error('Error opening Media Manager or no files selected:', error);\n }\n }\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n rules: {\n validate: (value) => {\n if (\n field.validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n }\n\n return true;\n },\n },\n });\n\n const imageUrl =\n controller.field.value && getImageUrl(controller.field.value);\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n status={controller.fieldState.error ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n dataHook={dataHook}\n >\n <ImageViewer\n imageUrl={imageUrl}\n dataHook={`image-${field.id}`}\n onAddImage={isMobile ? undefined : () => openMedia()}\n onUpdateImage={isMobile ? undefined : () => openMedia()}\n updateImageInfo={t('cairo.replace-image.tooltip')}\n removeImageInfo={t('cairo.remove-image.tooltip')}\n addImageInfo={t('cairo.add-image.tooltip')}\n height=\"120px\"\n width=\"25%\"\n fit=\"cover\"\n onRemoveImage={() => controller.field.onChange(null)}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAE3D,SACEC,oBAAoB,EACpBC,WAAW,EACXC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,WAAW,QAAQ,kCAAkC;AAC9D,SAASC,SAAS,QAAQ,gBAAgB;AAI1C,OAAO,MAAMC,UAAU,GAAIC,KAAsB,IAAK;EAAA,IAAAC,iBAAA,EAAAC,kBAAA,EAAAC,qBAAA;EACpD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGL,KAAK;EAEjC,MAAM;IAAEM,SAAS,EAAEC,CAAC;IAAE,GAAGC;EAAU,CAAC,GAAGb,uBAAuB,CAAC,CAAC;EAChED,WAAW,CAAC,MAAMc,SAAS,CAACC,QAAQ,CAACC,MAAM,CAAC;EAC5C,MAAMC,QAAQ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7 +17,9 @@ export const AutoPatternsTable = _ref => {
17
17
  bulkActionToolbar,
18
18
  onRowClick,
19
19
  stickyColumns,
20
- stickySelectionColumn
20
+ stickySelectionColumn,
21
+ showTitleBar,
22
+ sections
21
23
  } = useTableFeatures(configuration);
22
24
  return /*#__PURE__*/React.createElement(Table, {
23
25
  dataHook: "auto-patterns-table",
@@ -33,7 +35,9 @@ export const AutoPatternsTable = _ref => {
33
35
  onRowClick: onRowClick,
34
36
  horizontalScroll: true,
35
37
  stickyColumns: stickyColumns,
36
- stickySelectionColumn: stickySelectionColumn
38
+ stickySelectionColumn: stickySelectionColumn,
39
+ showTitleBar: showTitleBar,
40
+ sections: sections
37
41
  });
38
42
  };
39
43
  //# sourceMappingURL=AutoPatternsTable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Table","useTableFeatures","AutoPatternsTable","_ref","configuration","state","columns","customColumns","search","title","emptyState","filters","actionCell","bulkActionToolbar","onRowClick","stickyColumns","stickySelectionColumn","createElement","dataHook","horizontalScroll"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n bulkActionToolbar,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n } = useTableFeatures(configuration);\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n customColumns={customColumns}\n actionCell={actionCell}\n filters={filters}\n emptyState={emptyState}\n bulkActionToolbar={bulkActionToolbar}\n onRowClick={onRowClick}\n horizontalScroll\n stickyColumns={stickyColumns}\n stickySelectionColumn={stickySelectionColumn}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,eAAe;AAErC,SAASC,gBAAgB,QAAQ,aAAa;AAM9C,OAAO,MAAMC,iBAAiB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAChCC;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IACJE,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,iBAAiB;IACjBC,UAAU;IACVC,aAAa;IACbC;EACF,CAAC,GAAGf,gBAAgB,CAACG,aAAa,CAAC;EAEnC,oBACEL,KAAA,CAAAkB,aAAA,CAACjB,KAAK;IACJkB,QAAQ,EAAC,qBAAqB;IAC9BV,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbJ,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBC,aAAa,EAAEA,aAAc;IAC7BK,UAAU,EAAEA,UAAW;IACvBD,OAAO,EAAEA,OAAQ;IACjBD,UAAU,EAAEA,UAAW;IACvBG,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBK,gBAAgB;IAChBJ,aAAa,EAAEA,aAAc;IAC7BC,qBAAqB,EAAEA;EAAsB,CAC9C,CAAC;AAEN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Table","useTableFeatures","AutoPatternsTable","_ref","configuration","state","columns","customColumns","search","title","emptyState","filters","actionCell","bulkActionToolbar","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","sections","createElement","dataHook","horizontalScroll"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n bulkActionToolbar,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n } = useTableFeatures(configuration);\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n customColumns={customColumns}\n actionCell={actionCell}\n filters={filters}\n emptyState={emptyState}\n bulkActionToolbar={bulkActionToolbar}\n onRowClick={onRowClick}\n horizontalScroll\n stickyColumns={stickyColumns}\n stickySelectionColumn={stickySelectionColumn}\n showTitleBar={showTitleBar}\n sections={sections}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,eAAe;AAErC,SAASC,gBAAgB,QAAQ,aAAa;AAM9C,OAAO,MAAMC,iBAAiB,GAAGC,IAAA,IAEI;EAAA,IAFH;IAChCC;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IACJE,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,iBAAiB;IACjBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZC;EACF,CAAC,GAAGjB,gBAAgB,CAACG,aAAa,CAAC;EAEnC,oBACEL,KAAA,CAAAoB,aAAA,CAACnB,KAAK;IACJoB,QAAQ,EAAC,qBAAqB;IAC9BZ,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbJ,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBC,aAAa,EAAEA,aAAc;IAC7BK,UAAU,EAAEA,UAAW;IACvBD,OAAO,EAAEA,OAAQ;IACjBD,UAAU,EAAEA,UAAW;IACvBG,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBO,gBAAgB;IAChBN,aAAa,EAAEA,aAAc;IAC7BC,qBAAqB,EAAEA,qBAAsB;IAC7CC,YAAY,EAAEA,YAAa;IAC3BC,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -21,14 +21,15 @@ export const useBaseTableFeatures = configuration => {
21
21
  });
22
22
  const stickyColumns = configuration.stickyColumns;
23
23
  const stickySelectionColumn = !!stickyColumns; // Sticky selection column is true if stickyColumns is positive number
24
-
24
+ const showTitleBar = configuration.showTitleBar ?? true;
25
25
  return {
26
26
  columns,
27
27
  visibleFieldIds,
28
28
  onRowClick,
29
29
  customColumns: (_configuration$custom = configuration.customColumns) != null && _configuration$custom.enabled ? /*#__PURE__*/React.createElement(CustomColumns, null) : undefined,
30
30
  stickyColumns,
31
- stickySelectionColumn
31
+ stickySelectionColumn,
32
+ showTitleBar
32
33
  };
33
34
  };
34
35
  //# sourceMappingURL=useBaseTableFeatures.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","useColumns","CustomColumns","useCollectionPageOnRowClickActions","useNavigation","useBaseTableFeatures","configuration","_configuration$custom","navigateToEntityPage","columns","visibleFieldIds","map","column","id","entityPageId","onRowClickOverride","collectionPageOnRowClickActions","onRowClick","collectionId","collection","item","stickyColumns","stickySelectionColumn","customColumns","enabled","createElement","undefined"],"sources":["../../../src/hooks/useBaseTableFeatures.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { TableConfig } from '../types';\nimport { useColumns } from './useColumns';\nimport { CustomColumns } from '@wix/patterns';\nimport { useCollectionPageOnRowClickActions } from './useCollectionPageOnRowClickActions';\nimport { useNavigation } from './useNavigationUtils';\n\nexport const useBaseTableFeatures = (configuration: TableConfig) => {\n const { navigateToEntityPage } = useNavigation();\n const columns = useColumns(configuration.columns);\n const visibleFieldIds = useMemo(\n () => configuration.columns.map((column) => column.id),\n [configuration],\n );\n\n const entityPageId = configuration.entityPageId;\n\n const onRowClickOverride = useCollectionPageOnRowClickActions({\n collectionPageOnRowClickActions: configuration.onRowClick,\n collectionId: configuration.collection.collectionId,\n });\n\n const onRowClick = configuration.onRowClick\n ? onRowClickOverride\n : (item: any) =>\n navigateToEntityPage({\n item,\n entityPageId,\n });\n\n const stickyColumns = configuration.stickyColumns;\n const stickySelectionColumn = !!stickyColumns; // Sticky selection column is true if stickyColumns is positive number\n\n return {\n columns,\n visibleFieldIds,\n onRowClick,\n customColumns: configuration.customColumns?.enabled ? (\n <CustomColumns />\n ) : undefined,\n stickyColumns,\n stickySelectionColumn,\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,kCAAkC,QAAQ,sCAAsC;AACzF,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,OAAO,MAAMC,oBAAoB,GAAIC,aAA0B,IAAK;EAAA,IAAAC,qBAAA;EAClE,MAAM;IAAEC;EAAqB,CAAC,GAAGJ,aAAa,CAAC,CAAC;EAChD,MAAMK,OAAO,GAAGR,UAAU,CAACK,aAAa,CAACG,OAAO,CAAC;EACjD,MAAMC,eAAe,GAAGV,OAAO,CAC7B,MAAMM,aAAa,CAACG,OAAO,CAACE,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,EAAE,CAAC,EACtD,CAACP,aAAa,CAChB,CAAC;EAED,MAAMQ,YAAY,GAAGR,aAAa,CAACQ,YAAY;EAE/C,MAAMC,kBAAkB,GAAGZ,kCAAkC,CAAC;IAC5Da,+BAA+B,EAAEV,aAAa,CAACW,UAAU;IACzDC,YAAY,EAAEZ,aAAa,CAACa,UAAU,CAACD;EACzC,CAAC,CAAC;EAEF,MAAMD,UAAU,GAAGX,aAAa,CAACW,UAAU,GACvCF,kBAAkB,GACjBK,IAAS,IACRZ,oBAAoB,CAAC;IACnBY,IAAI;IACJN;EACF,CAAC,CAAC;EAER,MAAMO,aAAa,GAAGf,aAAa,CAACe,aAAa;EACjD,MAAMC,qBAAqB,GAAG,CAAC,CAACD,aAAa,CAAC,CAAC;;EAE/C,OAAO;IACLZ,OAAO;IACPC,eAAe;IACfO,UAAU;IACVM,aAAa,EAAE,CAAAhB,qBAAA,GAAAD,aAAa,CAACiB,aAAa,aAA3BhB,qBAAA,CAA6BiB,OAAO,gBACjDzB,KAAA,CAAA0B,aAAA,CAACvB,aAAa,MAAE,CAAC,GACfwB,SAAS;IACbL,aAAa;IACbC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","useColumns","CustomColumns","useCollectionPageOnRowClickActions","useNavigation","useBaseTableFeatures","configuration","_configuration$custom","navigateToEntityPage","columns","visibleFieldIds","map","column","id","entityPageId","onRowClickOverride","collectionPageOnRowClickActions","onRowClick","collectionId","collection","item","stickyColumns","stickySelectionColumn","showTitleBar","customColumns","enabled","createElement","undefined"],"sources":["../../../src/hooks/useBaseTableFeatures.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { TableConfig } from '../types';\nimport { useColumns } from './useColumns';\nimport { CustomColumns } from '@wix/patterns';\nimport { useCollectionPageOnRowClickActions } from './useCollectionPageOnRowClickActions';\nimport { useNavigation } from './useNavigationUtils';\n\nexport const useBaseTableFeatures = (configuration: TableConfig) => {\n const { navigateToEntityPage } = useNavigation();\n const columns = useColumns(configuration.columns);\n const visibleFieldIds = useMemo(\n () => configuration.columns.map((column) => column.id),\n [configuration],\n );\n\n const entityPageId = configuration.entityPageId;\n\n const onRowClickOverride = useCollectionPageOnRowClickActions({\n collectionPageOnRowClickActions: configuration.onRowClick,\n collectionId: configuration.collection.collectionId,\n });\n\n const onRowClick = configuration.onRowClick\n ? onRowClickOverride\n : (item: any) =>\n navigateToEntityPage({\n item,\n entityPageId,\n });\n\n const stickyColumns = configuration.stickyColumns;\n const stickySelectionColumn = !!stickyColumns; // Sticky selection column is true if stickyColumns is positive number\n const showTitleBar = configuration.showTitleBar ?? true;\n\n return {\n columns,\n visibleFieldIds,\n onRowClick,\n customColumns: configuration.customColumns?.enabled ? (\n <CustomColumns />\n ) : undefined,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,kCAAkC,QAAQ,sCAAsC;AACzF,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,OAAO,MAAMC,oBAAoB,GAAIC,aAA0B,IAAK;EAAA,IAAAC,qBAAA;EAClE,MAAM;IAAEC;EAAqB,CAAC,GAAGJ,aAAa,CAAC,CAAC;EAChD,MAAMK,OAAO,GAAGR,UAAU,CAACK,aAAa,CAACG,OAAO,CAAC;EACjD,MAAMC,eAAe,GAAGV,OAAO,CAC7B,MAAMM,aAAa,CAACG,OAAO,CAACE,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,EAAE,CAAC,EACtD,CAACP,aAAa,CAChB,CAAC;EAED,MAAMQ,YAAY,GAAGR,aAAa,CAACQ,YAAY;EAE/C,MAAMC,kBAAkB,GAAGZ,kCAAkC,CAAC;IAC5Da,+BAA+B,EAAEV,aAAa,CAACW,UAAU;IACzDC,YAAY,EAAEZ,aAAa,CAACa,UAAU,CAACD;EACzC,CAAC,CAAC;EAEF,MAAMD,UAAU,GAAGX,aAAa,CAACW,UAAU,GACvCF,kBAAkB,GACjBK,IAAS,IACRZ,oBAAoB,CAAC;IACnBY,IAAI;IACJN;EACF,CAAC,CAAC;EAER,MAAMO,aAAa,GAAGf,aAAa,CAACe,aAAa;EACjD,MAAMC,qBAAqB,GAAG,CAAC,CAACD,aAAa,CAAC,CAAC;EAC/C,MAAME,YAAY,GAAGjB,aAAa,CAACiB,YAAY,IAAI,IAAI;EAEvD,OAAO;IACLd,OAAO;IACPC,eAAe;IACfO,UAAU;IACVO,aAAa,EAAE,CAAAjB,qBAAA,GAAAD,aAAa,CAACkB,aAAa,aAA3BjB,qBAAA,CAA6BkB,OAAO,gBACjD1B,KAAA,CAAA2B,aAAA,CAACxB,aAAa,MAAE,CAAC,GACfyB,SAAS;IACbN,aAAa;IACbC,qBAAqB;IACrBC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,11 +1,13 @@
1
1
  import { useFetchData } from './useFetchData';
2
- import { useTableCollection } from '@wix/patterns';
2
+ import { TableSections, useTableCollection } from '@wix/patterns';
3
3
  import { useCommonCollectionFeatures } from './useCommonCollectionFeatures';
4
4
  import { useFilters } from './useFilters';
5
5
  import { useSchema } from '../providers/SchemaContext';
6
6
  import { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';
7
7
  import { useBaseTableFeatures } from './useBaseTableFeatures';
8
+ import { usePatternsWizardOverridesContext } from '../providers/PatternsWizardOverridesContext';
8
9
  export const useTableFeatures = configuration => {
10
+ var _configuration$sectio, _overrides$sections;
9
11
  const {
10
12
  collectionId,
11
13
  limit,
@@ -24,7 +26,8 @@ export const useTableFeatures = configuration => {
24
26
  columns,
25
27
  onRowClick,
26
28
  stickyColumns,
27
- stickySelectionColumn
29
+ stickySelectionColumn,
30
+ showTitleBar
28
31
  } = useBaseTableFeatures(configuration);
29
32
  const {
30
33
  fetchData
@@ -33,6 +36,7 @@ export const useTableFeatures = configuration => {
33
36
  filterFieldMapping
34
37
  });
35
38
  const schema = useSchema();
39
+ const overrides = usePatternsWizardOverridesContext();
36
40
  const state = useTableCollection({
37
41
  queryName: `${collectionId}`,
38
42
  itemKey: item => item[schema.idField],
@@ -56,6 +60,10 @@ export const useTableFeatures = configuration => {
56
60
  ...configuration,
57
61
  optimisticActions
58
62
  });
63
+ const sections = (_configuration$sectio = configuration.sections) != null && _configuration$sectio.id && overrides != null && (_overrides$sections = overrides.sections) != null && _overrides$sections[configuration.sections.id] ? {
64
+ renderSection: overrides.sections[configuration.sections.id],
65
+ TableSections
66
+ } : undefined;
59
67
  return {
60
68
  ...commonFeatures,
61
69
  state,
@@ -65,7 +73,9 @@ export const useTableFeatures = configuration => {
65
73
  customColumns,
66
74
  onRowClick,
67
75
  stickyColumns,
68
- stickySelectionColumn
76
+ stickySelectionColumn,
77
+ showTitleBar,
78
+ sections
69
79
  };
70
80
  };
71
81
  //# sourceMappingURL=useTableFeatures.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useFetchData","useTableCollection","useCommonCollectionFeatures","useFilters","useSchema","useAutoPatternsOptimisticActions","useBaseTableFeatures","useTableFeatures","configuration","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","fetchData","searchableFieldIds","schema","state","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","_ref","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","commonFeatures"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = configuration.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const schema = useSchema();\n\n const state = useTableCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,kBAAkB,QAAQ,eAAe;AAClD,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,gCAAgC,QAAQ,oCAAoC;AACrF,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,OAAO,MAAMC,gBAAgB,GAAIC,aAA0B,IAAK;EAC9D,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,GAAGL,aAAa,CAACM,UAAU;EAE5B,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAGd,UAAU,CACvEK,aAAa,CAACU,OAChB,CAAC;EACD,MAAM;IACJC,aAAa;IACbC,eAAe;IACfC,OAAO;IACPC,UAAU;IACVC,aAAa;IACbC;EACF,CAAC,GAAGlB,oBAAoB,CAACE,aAAa,CAAC;EAEvC,MAAM;IAAEiB;EAAU,CAAC,GAAGzB,YAAY,CAAC;IACjC0B,kBAAkB,EAAEN,eAAe;IACnCH;EACF,CAAC,CAAC;EAEF,MAAMU,MAAM,GAAGvB,SAAS,CAAC,CAAC;EAE1B,MAAMwB,KAAK,GAAG3B,kBAAkB,CAAM;IACpC4B,SAAS,EAAE,GAAGpB,YAAY,EAAE;IAC5BqB,OAAO,EAAGC,IAAI,IAAKA,IAAI,CAACJ,MAAM,CAACK,OAAO,CAAC;IACvCC,QAAQ,EAAGF,IAAI,IAAKA,IAAI,CAACJ,MAAM,CAACO,YAAY,CAAC;IAC7ChB,OAAO,EAAEF,aAAa;IACtBmB,gBAAgB,EAAGJ,IAAI,IAAKA,IAAI,CAACK,cAAc;IAC/CC,iBAAiB,EAAEC,IAAA;MAAA,IAAC;QAAEC;MAAI,CAAC,GAAAD,IAAA;MAAA,OAAKE,MAAM,CAACD,GAAG,CAAC;IAAA;IAC3Cd,SAAS;IACTf,KAAK;IACL+B,iBAAiB,EAAE9B,iBAAiB;IACpC+B,yBAAyB,EAAE9B,cAAc,KAAK,MAAM;IACpD+B,wBAAwB,EAAE9B;EAC5B,CAAC,CAAC;EAEF,MAAM+B,iBAAiB,GAAGvC,gCAAgC,CACxDI,YAAY,EACZmB,KAAK,CAACd,UACR,CAAC;EAED,MAAM+B,cAAc,GAAG3C,2BAA2B,CAAC;IACjD,GAAGM,aAAa;IAChBoC;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGC,cAAc;IACjBjB,KAAK;IACLP,OAAO;IACPH,OAAO,EAAEH,eAAe;IACxB6B,iBAAiB;IACjBzB,aAAa;IACbG,UAAU;IACVC,aAAa;IACbC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useFetchData","TableSections","useTableCollection","useCommonCollectionFeatures","useFilters","useSchema","useAutoPatternsOptimisticActions","useBaseTableFeatures","usePatternsWizardOverridesContext","useTableFeatures","configuration","_configuration$sectio","_overrides$sections","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","fetchData","searchableFieldIds","schema","overrides","state","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","_ref","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","commonFeatures","sections","id","renderSection","undefined"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { TableSections, useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { usePatternsWizardOverridesContext } from '../providers/PatternsWizardOverridesContext';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = configuration.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const schema = useSchema();\n const overrides = usePatternsWizardOverridesContext();\n\n const state = useTableCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n optimisticActions,\n });\n\n const sections =\n configuration.sections?.id &&\n overrides?.sections?.[configuration.sections.id]\n ? {\n renderSection: overrides.sections[configuration.sections.id],\n TableSections,\n }\n : undefined;\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,eAAe;AACjE,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,gCAAgC,QAAQ,oCAAoC;AACrF,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,iCAAiC,QAAQ,6CAA6C;AAE/F,OAAO,MAAMC,gBAAgB,GAAIC,aAA0B,IAAK;EAAA,IAAAC,qBAAA,EAAAC,mBAAA;EAC9D,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,GAAGP,aAAa,CAACQ,UAAU;EAE5B,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAGjB,UAAU,CACvEM,aAAa,CAACY,OAChB,CAAC;EACD,MAAM;IACJC,aAAa;IACbC,eAAe;IACfC,OAAO;IACPC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC;EACF,CAAC,GAAGtB,oBAAoB,CAACG,aAAa,CAAC;EAEvC,MAAM;IAAEoB;EAAU,CAAC,GAAG9B,YAAY,CAAC;IACjC+B,kBAAkB,EAAEP,eAAe;IACnCH;EACF,CAAC,CAAC;EAEF,MAAMW,MAAM,GAAG3B,SAAS,CAAC,CAAC;EAC1B,MAAM4B,SAAS,GAAGzB,iCAAiC,CAAC,CAAC;EAErD,MAAM0B,KAAK,GAAGhC,kBAAkB,CAAM;IACpCiC,SAAS,EAAE,GAAGtB,YAAY,EAAE;IAC5BuB,OAAO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 export const useTableGridSwitchFeatures = config => {
32
32
  columns: tableColumns,
33
33
  onRowClick,
34
34
  stickyColumns,
35
- stickySelectionColumn
35
+ stickySelectionColumn,
36
+ showTitleBar
36
37
  } = useBaseTableFeatures(config);
37
38
  const {
38
39
  fetchData: tableFetchData
@@ -77,7 +78,8 @@ export const useTableGridSwitchFeatures = config => {
77
78
  // Grid specific features
78
79
  imagePlacement,
79
80
  preset,
80
- renderItem
81
+ renderItem,
82
+ showTitleBar
81
83
  };
82
84
  };
83
85
  //# sourceMappingURL=useTableGridSwitchFeatures.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useFetchData","useTableGridSwitchCollection","useCommonCollectionFeatures","useFilters","useSchema","useAutoPatternsOptimisticActions","useBaseGridFeatures","useBaseTableFeatures","useTableGridSwitchFeatures","config","schema","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","fetchData","tableFetchData","searchableFieldIds","Array","from","Set","state","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","_ref","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","commonFeatures","horizontalScroll"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const schema = useSchema();\n\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = config.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n } = useBaseTableFeatures(config);\n\n const { fetchData: tableFetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const state = useTableGridSwitchCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData: tableFetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,4BAA4B,QAAQ,eAAe;AAC5D,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,gCAAgC,QAAQ,oCAAoC;AACrF,SAASC,mBAAmB,QAAQ,u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IAAA;MAAA,OAAKE,MAAM,CAACD,GAAG,CAAC;IAAA;IAC3CjB,SAAS,EAAEC,cAAc;IACzBtB,KAAK;IACLwC,iBAAiB,EAAEvC,iBAAiB;IACpCwC,yBAAyB,EAAEvC,cAAc,KAAK,MAAM;IACpDwC,wBAAwB,EAAEvC;EAC5B,CAAC,CAAC;EAEF,MAAMwC,iBAAiB,GAAGlD,gCAAgC,CACxDM,YAAY,EACZ4B,KAAK,CAACvB,UACR,CAAC;EAED,MAAMwC,cAAc,GAAGtD,2BAA2B,CAAC;IACjD,GAAGO,MAAM;IACT8C;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGC,cAAc;IACjBjB,KAAK;IACLX,OAAO,EAAEC,YAAY;IACrBT,OAAO,EAAEH,eAAe;IACxBsC,iBAAiB;IACjB7B,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrByB,gBAAgB,EAAE,IAAI;IACtB;IACAnC,cAAc;IACdD,MAAM;IACNI;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useFetchData","useTableGridSwitchCollection","useCommonCollectionFeatures","useFilters","useSchema","useAutoPatternsOptimisticActions","useBaseGridFeatures","useBaseTableFeatures","useTableGridSwitchFeatures","config","schema","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filterFieldMapping","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","fetchData","tableFetchData","searchableFieldIds","Array","from","Set","state","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","_ref","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","commonFeatures","horizontalScroll"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const schema = useSchema();\n\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = config.collection;\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(config);\n\n const { fetchData: tableFetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const state = useTableGridSwitchCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData: tableFetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horiz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EAAE,GAAG9B,YAAY,EAAE;IAC5B+B,OAAO,EAAGC,IAAI,IAAKA,IAAI,CAACjC,MAAM,CAACkC,OAAO,CAAC;IACvCC,QAAQ,EAAGF,IAAI,IAAKA,IAAI,CAACjC,MAAM,CAACoC,YAAY,CAAC;IAC7C1B,OAAO,EAAEF,aAAa;IACtB6B,gBAAgB,EAAGJ,IAAI,IAAKA,IAAI,CAACK,cAAc;IAC/CC,iBAAiB,EAAEC,IAAA;MAAA,IAAC;QAAEC;MAAI,CAAC,GAAAD,IAAA;MAAA,OAAKE,MAAM,CAACD,GAAG,CAAC;IAAA;IAC3CjB,SAAS,EAAEC,cAAc;IACzBvB,KAAK;IACLyC,iBAAiB,EAAExC,iBAAiB;IACpCyC,yBAAyB,EAAExC,cAAc,KAAK,MAAM;IACpDyC,wBAAwB,EAAExC;EAC5B,CAAC,CAAC;EAEF,MAAMyC,iBAAiB,GAAGnD,gCAAgC,CACxDM,YAAY,EACZ6B,KAAK,CAACxB,UACR,CAAC;EAED,MAAMyC,cAAc,GAAGvD,2BAA2B,CAAC;IACjD,GAAGO,MAAM;IACT+C;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGC,cAAc;IACjBjB,KAAK;IACLZ,OAAO,EAAEC,YAAY;IACrBT,OAAO,EAAEH,eAAe;IACxBuC,iBAAiB;IACjB9B,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrB0B,gBAAgB,EAAE,IAAI;IACtB;IACApC,cAAc;IACdD,MAAM;IACNI,UAAU;IACVQ;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ import React, { createContext, useContext, useState, useCallback } from 'react';
2
+ import { PageErrorState } from '@wix/patterns';
3
+ const ErrorContext = /*#__PURE__*/createContext(undefined);
4
+ export const ErrorProvider = _ref => {
5
+ let {
6
+ children
7
+ } = _ref;
8
+ const [errorState, setErrorState] = useState({
9
+ hasError: false,
10
+ error: null
11
+ });
12
+ const showError = useCallback(error => {
13
+ const errorObj = typeof error === 'string' ? new Error(error) : error;
14
+ setErrorState({
15
+ hasError: true,
16
+ error: errorObj
17
+ });
18
+ }, []);
19
+ const clearError = useCallback(() => {
20
+ setErrorState({
21
+ hasError: false,
22
+ error: null
23
+ });
24
+ }, []);
25
+ if (errorState.hasError && errorState.error) {
26
+ return /*#__PURE__*/React.createElement(PageErrorState, {
27
+ subtitle: errorState.error.message
28
+ });
29
+ }
30
+ return /*#__PURE__*/React.createElement(ErrorContext.Provider, {
31
+ value: {
32
+ showError,
33
+ clearError
34
+ }
35
+ }, children);
36
+ };
37
+ export const useError = () => {
38
+ const context = useContext(ErrorContext);
39
+ if (!context) {
40
+ throw new Error('useError must be used within an ErrorProvider');
41
+ }
42
+ return context;
43
+ };
44
+ //# sourceMappingURL=ErrorContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","createContext","useContext","useState","useCallback","PageErrorState","ErrorContext","undefined","ErrorProvider","_ref","children","errorState","setErrorState","hasError","error","showError","errorObj","Error","clearError","createElement","subtitle","message","Provider","value","useError","context"],"sources":["../../../src/providers/ErrorContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useContext,\n useState,\n useCallback,\n ReactNode,\n} from 'react';\nimport { PageErrorState } from '@wix/patterns';\n\ninterface ErrorState {\n hasError: boolean;\n error: Error | null;\n}\n\ninterface ErrorContextType {\n showError: (error: Error) => void;\n clearError: () => void;\n}\n\nconst ErrorContext = createContext<ErrorContextType | undefined>(undefined);\n\nexport const ErrorProvider: React.FC<{ children: ReactNode }> = ({\n children,\n}) => {\n const [errorState, setErrorState] = useState<ErrorState>({\n hasError: false,\n error: null,\n });\n\n const showError = useCallback((error: Error | string) => {\n const errorObj = typeof error === 'string' ? new Error(error) : error;\n setErrorState({\n hasError: true,\n error: errorObj,\n });\n }, []);\n\n const clearError = useCallback(() => {\n setErrorState({\n hasError: false,\n error: null,\n });\n }, []);\n\n if (errorState.hasError && errorState.error) {\n return <PageErrorState subtitle={errorState.error.message} />;\n }\n\n return (\n <ErrorContext.Provider value={{ showError, clearError }}>\n {children}\n </ErrorContext.Provider>\n );\n};\n\nexport const useError = (): ErrorContextType => {\n const context = useContext(ErrorContext);\n if (!context) {\n throw new Error('useError must be used within an ErrorProvider');\n }\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,QAAQ,EACRC,WAAW,QAEN,OAAO;AACd,SAASC,cAAc,QAAQ,eAAe;AAY9C,MAAMC,YAAY,gBAAGL,aAAa,CAA+BM,SAAS,CAAC;AAE3E,OAAO,MAAMC,aAAgD,GAAGC,IAAA,IAE1D;EAAA,IAF2D;IAC/DC;EACF,CAAC,GAAAD,IAAA;EACC,MAAM,CAACE,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAAa;IACvDU,QAAQ,EAAE,KAAK;IACfC,KAAK,EAAE;EACT,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAGX,WAAW,CAAEU,KAAqB,IAAK;IACvD,MAAME,QAAQ,GAAG,OAAOF,KAAK,KAAK,QAAQ,GAAG,IAAIG,KAAK,CAACH,KAAK,CAAC,GAAGA,KAAK;IACrEF,aAAa,CAAC;MACZC,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAEE;IACT,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,UAAU,GAAGd,WAAW,CAAC,MAAM;IACnCQ,aAAa,CAAC;MACZC,QAAQ,EAAE,KAAK;MACfC,KAAK,EAAE;IACT,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,IAAIH,UAAU,CAACE,QAAQ,IAAIF,UAAU,CAACG,KAAK,EAAE;IAC3C,oBAAOd,KAAA,CAAAmB,aAAA,CAACd,cAAc;MAACe,QAAQ,EAAET,UAAU,CAACG,KAAK,CAACO;IAAQ,CAAE,CAAC;EAC/D;EAEA,oBACErB,KAAA,CAAAmB,aAAA,CAACb,YAAY,CAACgB,QAAQ;IAACC,KAAK,EAAE;MAAER,SAAS;MAAEG;IAAW;EAAE,GACrDR,QACoB,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMc,QAAQ,GAAGA,CAAA,KAAwB;EAC9C,MAAMC,OAAO,GAAGvB,UAAU,CAACI,YAAY,CAAC;EACxC,IAAI,CAACmB,OAAO,EAAE;IACZ,MAAM,IAAIR,KAAK,CAAC,+CAA+C,CAAC;EAClE;EACA,OAAOQ,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","createContext","useContext","PatternsWizardOverridesContext","undefined","PatternsWizardOverridesProvider","_ref","children","value","createElement","Provider","usePatternsWizardOverridesContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n EntityPageMoreActionsActionParams,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { CustomActionParams, ResolvedAction } from '../utils/actions/types';\nimport {\n CollectionPageActionOnRowClickParams,\n CollectionPageActionParams,\n} from '../types/actions/collectionPageActions';\nimport { ActionCellActionParams } from '../types/actions/actionCell';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n (\n props: CustomActionParams<\n | EntityPageMoreActionsActionParams\n | CollectionPageActionParams\n | ActionCellActionParams\n | CollectionPageActionOnRowClickParams\n >,\n ) => ResolvedAction\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n HeaderAddon?: React.FC;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext);\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAmB,OAAO;AAsCnE,MAAMC,8BAA8B,gBAAGF,aAAa,CAElDG,SAAS,CAAC;AAEZ,OAAO,MAAMC,+BAGX,GAAGC,IAAA,IAAyB;EAAA,IAAxB;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAAF,IAAA;EACvB,oBACEN,KAAA,CAAAS,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA;EAAM,GACnDD,QACsC,CAAC;AAE9C,CAAC;AAED,OAAO,MAAMI,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAOT,UAAU,CAACC,8BAA8B,CAAC;AACnD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","createContext","useContext","PatternsWizardOverridesContext","undefined","PatternsWizardOverridesProvider","_ref","children","value","createElement","Provider","usePatternsWizardOverridesContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n EntityPageMoreActionsActionParams,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section } from '@wix/patterns';\n\nimport { CustomActionParams, ResolvedAction } from '../utils/actions/types';\nimport {\n CollectionPageActionOnRowClickParams,\n CollectionPageActionParams,\n} from '../types/actions/collectionPageActions';\nimport { ActionCellActionParams } from '../types/actions/actionCell';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n (\n props: CustomActionParams<\n | EntityPageMoreActionsActionParams\n | CollectionPageActionParams\n | ActionCellActionParams\n | CollectionPageActionOnRowClickParams\n >,\n ) => ResolvedAction\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n HeaderAddon?: React.FC;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n sections?: Record<string, (item: any) => Section>;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext);\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAmB,OAAO;AAyCnE,MAAMC,8BAA8B,gBAAGF,aAAa,CAElDG,SAAS,CAAC;AAEZ,OAAO,MAAMC,+BAGX,GAAGC,IAAA,IAAyB;EAAA,IAAxB;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAAF,IAAA;EACvB,oBACEN,KAAA,CAAAS,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA;EAAM,GACnDD,QACsC,CAAC;AAE9C,CAAC;AAED,OAAO,MAAMI,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAOT,UAAU,CAACC,8BAA8B,CAAC;AACnD,CAAC","ignoreList":[]}
@@ -3,6 +3,7 @@ import { AppConfigProvider } from './AppConfigContext';
3
3
  import { ModalProvider } from './ModalContext';
4
4
  import { SchemaRegistryProvider } from './SchemaRegistryContext';
5
5
  import { OptimisticActionsProvider } from './OptimisticActionsContext';
6
+ import { ErrorProvider } from './ErrorContext';
6
7
  export const RootAppProvider = _ref => {
7
8
  let {
8
9
  appConfig,
@@ -10,6 +11,6 @@ export const RootAppProvider = _ref => {
10
11
  } = _ref;
11
12
  return /*#__PURE__*/React.createElement(AppConfigProvider, {
12
13
  appConfig: appConfig
13
- }, /*#__PURE__*/React.createElement(SchemaRegistryProvider, null, /*#__PURE__*/React.createElement(OptimisticActionsProvider, null, /*#__PURE__*/React.createElement(ModalProvider, null, children))));
14
+ }, /*#__PURE__*/React.createElement(ErrorProvider, null, /*#__PURE__*/React.createElement(SchemaRegistryProvider, null, /*#__PURE__*/React.createElement(OptimisticActionsProvider, null, /*#__PURE__*/React.createElement(ModalProvider, null, children)))));
14
15
  };
15
16
  //# sourceMappingURL=RootAppProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","AppConfigProvider","ModalProvider","SchemaRegistryProvider","OptimisticActionsProvider","RootAppProvider","_ref","appConfig","children","createElement"],"sources":["../../../src/providers/RootAppProvider.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { AppConfig } from '../types';\nimport { AppConfigProvider } from './AppConfigContext';\nimport { ModalProvider } from './ModalContext';\nimport { SchemaRegistryProvider } from './SchemaRegistryContext';\nimport { OptimisticActionsProvider } from './OptimisticActionsContext';\n\nexport const RootAppProvider = ({\n appConfig,\n children,\n}: {\n appConfig: AppConfig;\n children: ReactNode;\n}) => {\n return (\n <AppConfigProvider appConfig={appConfig}>\n <SchemaRegistryProvider>\n <OptimisticActionsProvider>\n <ModalProvider>{children}</ModalProvider>\n </OptimisticActionsProvider>\n </SchemaRegistryProvider>\n </AppConfigProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AAExC,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,yBAAyB,QAAQ,4BAA4B;AAEtE,OAAO,MAAMC,eAAe,GAAGC,IAAA,IAMzB;EAAA,IAN0B;IAC9BC,SAAS;IACTC;EAIF,CAAC,GAAAF,IAAA;EACC,oBACEN,KAAA,CAAAS,aAAA,CAACR,iBAAiB;IAACM,SAAS,EAAEA;EAAU,gBACtCP,KAAA,CAAAS,aAAA,CAACN,sBAAsB,qBACrBH,KAAA,CAAAS,aAAA,CAACL,yBAAyB,qBACxBJ,KAAA,CAAAS,aAAA,CAACP,aAAa,QAAEM,QAAwB,CACf,CACL,CACP,CAAC;AAExB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","AppConfigProvider","ModalProvider","SchemaRegistryProvider","OptimisticActionsProvider","ErrorProvider","RootAppProvider","_ref","appConfig","children","createElement"],"sources":["../../../src/providers/RootAppProvider.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { AppConfig } from '../types';\nimport { AppConfigProvider } from './AppConfigContext';\nimport { ModalProvider } from './ModalContext';\nimport { SchemaRegistryProvider } from './SchemaRegistryContext';\nimport { OptimisticActionsProvider } from './OptimisticActionsContext';\nimport { ErrorProvider } from './ErrorContext';\n\nexport const RootAppProvider = ({\n appConfig,\n children,\n}: {\n appConfig: AppConfig;\n children: ReactNode;\n}) => {\n return (\n <AppConfigProvider appConfig={appConfig}>\n <ErrorProvider>\n <SchemaRegistryProvider>\n <OptimisticActionsProvider>\n <ModalProvider>{children}</ModalProvider>\n </OptimisticActionsProvider>\n </SchemaRegistryProvider>\n </ErrorProvider>\n </AppConfigProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AAExC,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,yBAAyB,QAAQ,4BAA4B;AACtE,SAASC,aAAa,QAAQ,gBAAgB;AAE9C,OAAO,MAAMC,eAAe,GAAGC,IAAA,IAMzB;EAAA,IAN0B;IAC9BC,SAAS;IACTC;EAIF,CAAC,GAAAF,IAAA;EACC,oBACEP,KAAA,CAAAU,aAAA,CAACT,iBAAiB;IAACO,SAAS,EAAEA;EAAU,gBACtCR,KAAA,CAAAU,aAAA,CAACL,aAAa,qBACZL,KAAA,CAAAU,aAAA,CAACP,sBAAsB,qBACrBH,KAAA,CAAAU,aAAA,CAACN,yBAAyB,qBACxBJ,KAAA,CAAAU,aAAA,CAACR,aAAa,QAAEO,QAAwB,CACf,CACL,CACX,CACE,CAAC;AAExB,CAAC","ignoreList":[]}