@wix/auto-patterns 1.14.0 → 1.16.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 (203) hide show
  1. package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +17 -6
  2. package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsCollectionPageContent/SkeletonCollection.js +34 -0
  4. package/dist/cjs/components/AutoPatternsCollectionPageContent/SkeletonCollection.js.map +1 -0
  5. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +1 -0
  6. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  7. package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js +198 -0
  8. package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js.map +1 -0
  9. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +14 -5
  10. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  11. package/dist/cjs/components/filters/DynamicCollectionFilter.js +5 -11
  12. package/dist/cjs/components/filters/DynamicCollectionFilter.js.map +1 -1
  13. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +51 -88
  14. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  15. package/dist/cjs/dataSourceAdapters/cms/fetchCmsData.js +43 -0
  16. package/dist/cjs/dataSourceAdapters/cms/fetchCmsData.js.map +1 -0
  17. package/dist/cjs/dataSourceAdapters/cms/filterUtils.js +15 -15
  18. package/dist/cjs/dataSourceAdapters/cms/filterUtils.js.map +1 -1
  19. package/dist/cjs/dataSourceAdapters/cms/sortUtils.js +2 -2
  20. package/dist/cjs/dataSourceAdapters/cms/sortUtils.js.map +1 -1
  21. package/dist/cjs/dataSourceAdapters/factory.js +0 -20
  22. package/dist/cjs/dataSourceAdapters/factory.js.map +1 -1
  23. package/dist/cjs/hooks/useActionCell.js +0 -6
  24. package/dist/cjs/hooks/useActionCell.js.map +1 -1
  25. package/dist/cjs/hooks/useBaseTableFeatures.js +7 -2
  26. package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
  27. package/dist/cjs/hooks/useBulkActionToolbar.js +1 -7
  28. package/dist/cjs/hooks/useBulkActionToolbar.js.map +1 -1
  29. package/dist/cjs/hooks/useCollectionPageActions.js +2 -8
  30. package/dist/cjs/hooks/useCollectionPageActions.js.map +1 -1
  31. package/dist/cjs/hooks/useCollectionPageOnRowClickActions.js +49 -0
  32. package/dist/cjs/hooks/useCollectionPageOnRowClickActions.js.map +1 -0
  33. package/dist/cjs/hooks/useFetchData.js +9 -29
  34. package/dist/cjs/hooks/useFetchData.js.map +1 -1
  35. package/dist/cjs/hooks/useFilters.js +2 -2
  36. package/dist/cjs/hooks/useFilters.js.map +1 -1
  37. package/dist/cjs/hooks/useGridFeatures.js +3 -4
  38. package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
  39. package/dist/cjs/hooks/useTableFeatures.js +3 -4
  40. package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
  41. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +3 -4
  42. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
  43. package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
  44. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
  45. package/dist/cjs/providers/SchemaContext.js +32 -8
  46. package/dist/cjs/providers/SchemaContext.js.map +1 -1
  47. package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
  48. package/dist/cjs/types/EntityPageConfig.js.map +1 -1
  49. package/dist/cjs/types/actions/actionCell.js.map +1 -1
  50. package/dist/cjs/types/actions/base.js.map +1 -1
  51. package/dist/cjs/types/actions/bulkActions.js.map +1 -1
  52. package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
  53. package/dist/cjs/types/index.js +6 -0
  54. package/dist/cjs/types/index.js.map +1 -1
  55. package/dist/cjs/types/providers.js +4 -0
  56. package/dist/cjs/types/providers.js.map +1 -0
  57. package/dist/cjs/types/types.js.map +1 -1
  58. package/dist/cjs/utils/actions/index.js +0 -6
  59. package/dist/cjs/utils/actions/index.js.map +1 -1
  60. package/dist/cjs/utils/actions/types.js.map +1 -1
  61. package/dist/docs/action_cell.md +214 -0
  62. package/dist/docs/app_config_structure.md +355 -0
  63. package/dist/docs/auto-patterns-guide.md +2447 -0
  64. package/dist/docs/bulk_actions.md +266 -0
  65. package/dist/docs/collection_page.md +54 -0
  66. package/dist/docs/collection_page_actions.md +343 -0
  67. package/dist/docs/custom_overrides.md +511 -0
  68. package/dist/docs/entity_page.md +104 -0
  69. package/dist/docs/entity_page_actions.md +92 -0
  70. package/dist/docs/index.md +76 -0
  71. package/dist/docs/installation.md +55 -0
  72. package/dist/docs/introduction.md +74 -0
  73. package/dist/docs/pages_configuration.md +129 -0
  74. package/dist/docs/recipe-bulk-operations.md +1352 -0
  75. package/dist/docs/recipe-crud-operations.md +786 -0
  76. package/dist/docs/recipe-customization.md +1702 -0
  77. package/dist/docs/recipe-first-dashboard.md +794 -0
  78. package/dist/docs/sdk_and_schema.md +215 -0
  79. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +7 -2
  80. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  81. package/dist/esm/components/AutoPatternsCollectionPageContent/SkeletonCollection.js +21 -0
  82. package/dist/esm/components/AutoPatternsCollectionPageContent/SkeletonCollection.js.map +1 -0
  83. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -1
  84. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  85. package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js +91 -0
  86. package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js.map +1 -0
  87. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +5 -2
  88. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  89. package/dist/esm/components/filters/DynamicCollectionFilter.js +4 -10
  90. package/dist/esm/components/filters/DynamicCollectionFilter.js.map +1 -1
  91. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +54 -88
  92. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  93. package/dist/esm/dataSourceAdapters/cms/fetchCmsData.js +42 -0
  94. package/dist/esm/dataSourceAdapters/cms/fetchCmsData.js.map +1 -0
  95. package/dist/esm/dataSourceAdapters/cms/filterUtils.js +15 -15
  96. package/dist/esm/dataSourceAdapters/cms/filterUtils.js.map +1 -1
  97. package/dist/esm/dataSourceAdapters/cms/sortUtils.js +2 -2
  98. package/dist/esm/dataSourceAdapters/cms/sortUtils.js.map +1 -1
  99. package/dist/esm/dataSourceAdapters/factory.js +1 -21
  100. package/dist/esm/dataSourceAdapters/factory.js.map +1 -1
  101. package/dist/esm/hooks/useActionCell.js +1 -7
  102. package/dist/esm/hooks/useActionCell.js.map +1 -1
  103. package/dist/esm/hooks/useBaseTableFeatures.js +6 -1
  104. package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
  105. package/dist/esm/hooks/useBulkActionToolbar.js +1 -7
  106. package/dist/esm/hooks/useBulkActionToolbar.js.map +1 -1
  107. package/dist/esm/hooks/useCollectionPageActions.js +1 -7
  108. package/dist/esm/hooks/useCollectionPageActions.js.map +1 -1
  109. package/dist/esm/hooks/useCollectionPageOnRowClickActions.js +45 -0
  110. package/dist/esm/hooks/useCollectionPageOnRowClickActions.js.map +1 -0
  111. package/dist/esm/hooks/useFetchData.js +9 -29
  112. package/dist/esm/hooks/useFetchData.js.map +1 -1
  113. package/dist/esm/hooks/useFilters.js +2 -2
  114. package/dist/esm/hooks/useFilters.js.map +1 -1
  115. package/dist/esm/hooks/useGridFeatures.js +3 -4
  116. package/dist/esm/hooks/useGridFeatures.js.map +1 -1
  117. package/dist/esm/hooks/useTableFeatures.js +3 -4
  118. package/dist/esm/hooks/useTableFeatures.js.map +1 -1
  119. package/dist/esm/hooks/useTableGridSwitchFeatures.js +3 -4
  120. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
  121. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
  122. package/dist/esm/providers/SchemaContext.js +31 -7
  123. package/dist/esm/providers/SchemaContext.js.map +1 -1
  124. package/dist/esm/types/CollectionPageConfig.js.map +1 -1
  125. package/dist/esm/types/EntityPageConfig.js.map +1 -1
  126. package/dist/esm/types/actions/actionCell.js.map +1 -1
  127. package/dist/esm/types/actions/base.js.map +1 -1
  128. package/dist/esm/types/actions/bulkActions.js.map +1 -1
  129. package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
  130. package/dist/esm/types/index.js +1 -0
  131. package/dist/esm/types/index.js.map +1 -1
  132. package/dist/esm/types/providers.js +2 -0
  133. package/dist/esm/types/providers.js.map +1 -0
  134. package/dist/esm/types/types.js.map +1 -1
  135. package/dist/esm/utils/actions/index.js +0 -2
  136. package/dist/esm/utils/actions/index.js.map +1 -1
  137. package/dist/esm/utils/actions/types.js.map +1 -1
  138. package/dist/types/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.d.ts.map +1 -1
  139. package/dist/types/components/AutoPatternsCollectionPageContent/SkeletonCollection.d.ts +5 -0
  140. package/dist/types/components/AutoPatternsCollectionPageContent/SkeletonCollection.d.ts.map +1 -0
  141. package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts +7 -0
  142. package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts.map +1 -0
  143. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
  144. package/dist/types/components/filters/DynamicCollectionFilter.d.ts.map +1 -1
  145. package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts +1 -10
  146. package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts.map +1 -1
  147. package/dist/types/dataSourceAdapters/cms/fetchCmsData.d.ts +13 -0
  148. package/dist/types/dataSourceAdapters/cms/fetchCmsData.d.ts.map +1 -0
  149. package/dist/types/dataSourceAdapters/cms/filterUtils.d.ts +9 -7
  150. package/dist/types/dataSourceAdapters/cms/filterUtils.d.ts.map +1 -1
  151. package/dist/types/dataSourceAdapters/cms/sortUtils.d.ts +2 -2
  152. package/dist/types/dataSourceAdapters/cms/sortUtils.d.ts.map +1 -1
  153. package/dist/types/dataSourceAdapters/factory.d.ts +1 -11
  154. package/dist/types/dataSourceAdapters/factory.d.ts.map +1 -1
  155. package/dist/types/hooks/useActionCell.d.ts.map +1 -1
  156. package/dist/types/hooks/useBaseTableFeatures.d.ts +1 -1
  157. package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
  158. package/dist/types/hooks/useBulkActionToolbar.d.ts.map +1 -1
  159. package/dist/types/hooks/useCollectionPageActions.d.ts.map +1 -1
  160. package/dist/types/hooks/useCollectionPageOnRowClickActions.d.ts +7 -0
  161. package/dist/types/hooks/useCollectionPageOnRowClickActions.d.ts.map +1 -0
  162. package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
  163. package/dist/types/hooks/useFetchData.d.ts +13 -7
  164. package/dist/types/hooks/useFetchData.d.ts.map +1 -1
  165. package/dist/types/hooks/useFilters.d.ts +1 -1
  166. package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
  167. package/dist/types/hooks/useTableFeatures.d.ts +1 -1
  168. package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
  169. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +1 -1
  170. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
  171. package/dist/types/providers/PatternsWizardOverridesContext.d.ts +4 -5
  172. package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
  173. package/dist/types/providers/SchemaContext.d.ts +4 -4
  174. package/dist/types/providers/SchemaContext.d.ts.map +1 -1
  175. package/dist/types/types/CollectionPageConfig.d.ts +4 -8
  176. package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
  177. package/dist/types/types/EntityPageConfig.d.ts +3 -4
  178. package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
  179. package/dist/types/types/actions/actionCell.d.ts +2 -2
  180. package/dist/types/types/actions/actionCell.d.ts.map +1 -1
  181. package/dist/types/types/actions/base.d.ts +0 -7
  182. package/dist/types/types/actions/base.d.ts.map +1 -1
  183. package/dist/types/types/actions/bulkActions.d.ts +2 -2
  184. package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
  185. package/dist/types/types/actions/collectionPageActions.d.ts +10 -2
  186. package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
  187. package/dist/types/types/index.d.ts +1 -0
  188. package/dist/types/types/index.d.ts.map +1 -1
  189. package/dist/types/types/providers.d.ts +11 -0
  190. package/dist/types/types/providers.d.ts.map +1 -0
  191. package/dist/types/types/types.d.ts +25 -1
  192. package/dist/types/types/types.d.ts.map +1 -1
  193. package/dist/types/utils/actions/index.d.ts +0 -2
  194. package/dist/types/utils/actions/index.d.ts.map +1 -1
  195. package/dist/types/utils/actions/types.d.ts +1 -4
  196. package/dist/types/utils/actions/types.d.ts.map +1 -1
  197. package/package.json +21 -16
  198. package/dist/cjs/utils/actions/customModalAction.js +0 -22
  199. package/dist/cjs/utils/actions/customModalAction.js.map +0 -1
  200. package/dist/esm/utils/actions/customModalAction.js +0 -17
  201. package/dist/esm/utils/actions/customModalAction.js.map +0 -1
  202. package/dist/types/utils/actions/customModalAction.d.ts +0 -5
  203. package/dist/types/utils/actions/customModalAction.d.ts.map +0 -1
@@ -0,0 +1,355 @@
1
+ # AppConfig Structure
2
+
3
+ ## ⚠️ Configuration Rules
4
+
5
+ - **Configuration must come only from a JSON file** - never inline or from other sources
6
+ - **DO NOT fill optional fields unless explicitly requested** - leave optional properties undefined to avoid unnecessary complexity
7
+ - **After each configuration change, verify that the configuration strictly aligns with the structure described below** - any configuration entries not defined in this structure must be removed
8
+ - **When generating config for the first time, select up to 3 columns from the schema that best represent the entity**
9
+
10
+ ## ⚠️ Common Configuration Mistakes to Avoid
11
+
12
+ - Adding more than two pages
13
+ - Mixing page types in a single configuration
14
+ - Including undefined optional fields
15
+ - Selecting too many initial columns
16
+ - Not designating exactly one page as `appMainPage: true`
17
+ - Missing or inconsistent page relationships (parentPageId/entityPageId)
18
+ - Setting `stickyColumns` to invalid values (negative, zero, or exceeding column count)
19
+
20
+ ```ts
21
+ export interface AppConfig {
22
+ pages: {
23
+ id: string; // Page unique identifier (must be unique across the app)
24
+ type: 'collectionPage' | 'entityPage'; // Defines page type
25
+ appMainPage?: boolean; // Designates this page as the main page (exactly one page must have this set to true)
26
+ collectionPage?: {
27
+ route: {
28
+ path: string; // Route path for the collection page (e.g., '/')
29
+ };
30
+ title: {
31
+ text: string; // Main page title
32
+ hideTotal?: boolean; // Hide total items in header. Default: true
33
+ };
34
+ subtitle?: {
35
+ text: string; // Optional page subtitle
36
+ };
37
+ actions?: { // Defines page-level actions for the collection page
38
+ primaryActions?: {
39
+ type: 'action' | 'menu'; // Type of primary actions layout
40
+ action?: { // Required when type is 'action'
41
+ item: {
42
+ id: string; // Unique identifier for the action
43
+ type: 'create' | 'custom'; // Action type
44
+ label?: string; // Text displayed for the action
45
+ collection: {
46
+ collectionId: string; // ID of the Wix Data collection
47
+ entityTypeSource: 'cms'; // Data source type. Always 'cms'
48
+ };
49
+ create?: { // Required when type is 'create'
50
+ mode: 'page'; // Create mode
51
+ page: {
52
+ id: string; // Entity page ID to navigate to for creation
53
+ };
54
+ };
55
+ };
56
+ };
57
+ menu?: { // Required when type is 'menu'
58
+ label: string; // Label for the group
59
+ items: {}[]; // Array of action configurations, same structure as action.item, can include dividers
60
+ };
61
+ };
62
+ secondaryActions?: {
63
+ type: 'action' | 'menu'; // Type of secondary actions layout, same structure as primaryActions
64
+ action?: {}; // Same structure as primaryActions.action
65
+ menu?: {}; // Same structure as primaryActions.menu
66
+ };
67
+ };
68
+ components: [
69
+ {
70
+ entityPageId?: string; // ID of the entity page to navigate to when clicking a row
71
+ collection: {
72
+ collectionId: string; // ID of the Wix Data collection
73
+ entityTypeSource: 'cms'; // Data source type. Always 'cms'
74
+ reflectQueryInUrl?: boolean; // Reflects query state (search, filters, sorting) in the browser URL. Default: false
75
+ selectAllScope?: 'page' | 'all'; // Controls "Select All" scope. 'all' selects entire collection, 'page' selects only visible items. Default: 'all'
76
+ selectionUpdateMode?: 'preserve' | 'clear'; // Controls selection behavior when data changes. 'preserve' maintains selections, 'clear' clears them. Default: 'clear'
77
+ };
78
+ filters?: {
79
+ panelTitle?: string; // Title of the filters panel
80
+ items: {
81
+ id: string; // Unique identifier for the filter item
82
+ fieldId: string; // ID of the field to filter by (must be a valid type: NUMBER, DATETIME, BOOLEAN, ARRAY, ARRAY_STRING)
83
+ displayName?: string; // Display name of the filter item
84
+ openByDefault?: boolean; // Whether the filter item is open by default in the panel (accordion is open)
85
+ sectionTitle?: string; // Title of the filter section. Required if more than one section exists to prevent confusion
86
+ tagLabel?: string; // Label shown in Tag component in the table/grid when the filter is applied (e.g., "Age: 7")
87
+ numberConfig?: {
88
+ min?: number; // Minimum value
89
+ max?: number; // Maximum value
90
+ allowedDecimals?: true; // Decimal precision allowed
91
+ };
92
+ dateConfig?: {
93
+ mode?: 'ONLY_PREDEFINED' | 'ONLY_CUSTOM' | 'COMBINE'; // Determines filter behavior
94
+ presets?: (
95
+ | 'SEVEN_DAYS'
96
+ | 'FOURTEEN_DAYS'
97
+ | 'MONTH'
98
+ | 'TODAY'
99
+ | 'TOMORROW'
100
+ | 'NEXT_THREE_DAYS'
101
+ | 'NEXT_SEVEN_DAYS'
102
+ | 'NEXT_THIRTY_DAYS'
103
+ )[]; // Shown only if mode includes predefined presets (COMBINE or ONLY_PREDEFINED)
104
+ includeTime?: boolean; // Whether to allow time selection. Default is true
105
+ };
106
+ booleanConfig?: {
107
+ trueLabel?: string; // Label shown for the true value
108
+ falseLabel?: string; // Label shown for the false value
109
+ };
110
+ enumConfig?: {
111
+ options: {
112
+ value: string; // Enum option value
113
+ label: string; // Enum option label
114
+ }[];
115
+ selectionMode: 'single' | 'multiple'; // Selection behavior
116
+ optionType?:
117
+ | 'checkbox'
118
+ | 'inlineCheckbox'
119
+ | 'radio'
120
+ | 'select'; // Option rendering style
121
+ };
122
+ }[];
123
+ };
124
+ actionCell?: {
125
+ primaryAction?: {
126
+ item: {
127
+ id: string; // Unique identifier for the action
128
+ type: 'update' | 'delete' | 'custom'; // Action type
129
+ label?: string; // Text displayed for the action
130
+ disabled?: boolean; // Whether the action is disabled
131
+ tooltip?: string; // Tooltip text shown on hover
132
+ update?: { // Required when type is 'update'
133
+ mode: 'page'; // Update mode
134
+ page?: { // Required when mode is 'page'
135
+ id: string; // Entity page ID to navigate to
136
+ };
137
+ };
138
+ delete?: { // Required when type is 'delete'
139
+ mode: 'modal'; // Currently only 'modal' is supported
140
+ modal: {
141
+ title?: {
142
+ text: string; // Modal title
143
+ };
144
+ description?: {
145
+ text: string; // Modal description
146
+ };
147
+ actions?: {
148
+ submit?: {
149
+ text: string; // Submit button text
150
+ };
151
+ cancel?: {
152
+ text: string; // Cancel button text
153
+ };
154
+ };
155
+ feedback?: {
156
+ successToast?: {
157
+ text: string; // Success message
158
+ };
159
+ errorToast?: {
160
+ text: string; // Error message
161
+ };
162
+ };
163
+ };
164
+ };
165
+ };
166
+ };
167
+ secondaryActions?: {
168
+ items: {}[]; // Array of action configurations, same structure as primaryAction.item, can include dividers
169
+ inlineCount?: number; // How many secondary actions to show inline before showing popover
170
+ inlineAlwaysVisible?: boolean; // Whether to always show inline actions (not just on hover)
171
+ };
172
+ };
173
+ bulkActionToolbar?: {
174
+ primaryActions?: ({
175
+ type: 'action' | 'menu'; // Type of bulk action item
176
+ action?: { // Required when type is 'action'
177
+ item: {
178
+ id: string; // Unique identifier for the bulk action
179
+ type: 'bulkDelete' | 'custom'; // Bulk action type
180
+ label?: string; // Text displayed for the action
181
+ bulkDelete?: { // Required when type is 'bulkDelete'
182
+ mode: 'modal'; // Currently only 'modal' is supported
183
+ modal: {
184
+ title?: {
185
+ text: string; // Modal title
186
+ };
187
+ description?: {
188
+ text: string; // Modal description
189
+ };
190
+ actions?: {
191
+ submit?: {
192
+ text: string; // Submit button text
193
+ };
194
+ cancel?: {
195
+ text: string; // Cancel button text
196
+ };
197
+ };
198
+ feedback?: {
199
+ successToast?: {
200
+ text: string; // Success message
201
+ };
202
+ errorToast?: {
203
+ text: string; // Error message
204
+ };
205
+ };
206
+ };
207
+ };
208
+ };
209
+ };
210
+ menu?: { // Required when type is 'menu'
211
+ label: string; // Label for the dropdown group
212
+ items: {}[] // Array of bulk actions configurations, same structure as action.item, can include dividers
213
+ };
214
+ })[];
215
+ secondaryActions?: {}[]; // Array of bulk actions configurations, same structure as primaryActions[].menu.items, can include dividers
216
+ };
217
+ toolbarTitle?: {
218
+ title: string; // Toolbar title above the table/grid
219
+ subtitle?: {
220
+ text: string; // Toolbar subtitle
221
+ };
222
+ showTotal?: boolean; // Show total items on toolbar. Default: false
223
+ };
224
+ search?: {
225
+ shown?: boolean; // Show/hide the search
226
+ };
227
+ emptyState?: {
228
+ title?: string; // Empty state title
229
+ subtitle?: string; // Empty state subtitle
230
+ image?: {
231
+ id: string; // Image ID for empty state
232
+ };
233
+ addNewCta?: {
234
+ id?: string; // Add New CTA ID
235
+ text?: string; // Add New CTA text
236
+ };
237
+ customCta?: {
238
+ id?: string; // Custom CTA ID
239
+ };
240
+ };
241
+ layout: [ // Array of layout items that define what components to render
242
+ {
243
+ type: 'Table'; // Layout item type for table rendering
244
+ table?: {
245
+ columns: {
246
+ id: string; // Field ID from the collection
247
+ name: string; // Column title displayed
248
+ width: string; // The width of the column (required in types)
249
+ sortable?: boolean; // If the column is sortable
250
+ defaultSortOrder?: 'asc' | 'desc'; // Optional default sort order
251
+ sortMode?: 'asc' | 'desc'; // Optional sorting mode
252
+ reorderDisabled?: boolean; // Whether column reordering is disabled
253
+ hideable?: boolean; // Whether column can be hidden
254
+ defaultHidden?: boolean; // Whether column is hidden by default
255
+ hiddenFromCustomColumnsSelection?: boolean; // Whether column is hidden from custom columns selection
256
+ }[];
257
+ customColumns?: {
258
+ enabled: boolean; // Enable user customization (hide/reorder columns)
259
+ };
260
+ stickyColumns?: number; // Number of columns to make sticky from the start. Sticky columns remain visible when horizontally scrolling.
261
+ };
262
+ },
263
+ {
264
+ type: 'Grid'; // Layout item type for grid rendering
265
+ grid?: {
266
+ item: {
267
+ titleFieldId: string; // Field ID to display as the item title
268
+ subtitleFieldId?: string; // Field ID for the item subtitle
269
+ imageFieldId?: string; // Field ID for the item image
270
+ /**
271
+ * Controls which content is shown in the card (preset):
272
+ * - 'full': Shows both title and subtitle.
273
+ * - 'title': Shows only the title.
274
+ * - 'empty': Hides both title and subtitle (card appears visually empty except for image or other content).
275
+ */
276
+ cardContentMode?: 'full' | 'title' | 'empty';
277
+ imagePlacement?: 'top' | 'side';
278
+ };
279
+ };
280
+ }
281
+ ]; // End of layout array
282
+ }
283
+ ]; // End of components array
284
+ };
285
+ entityPage?: {
286
+ route: {
287
+ path: string; // Route path for the entity page (e.g., '/product/:entityId')
288
+ params: {
289
+ id: string; // Maps dynamic parameter in path to its identifier
290
+ };
291
+ };
292
+ title?: {
293
+ text: string; // Entity page title
294
+ };
295
+ subtitle?: {
296
+ text: string; // Entity page subtitle
297
+ };
298
+ parentPageId?: string; // ID of the parent collection page
299
+ layout?: {
300
+ // Main layout section
301
+ main: {
302
+ type: 'card'; // Type of the card
303
+ card: {
304
+ title: {
305
+ text: string; // Title of the card
306
+ };
307
+ subtitle?: {
308
+ text: string; // Subtitle of the card
309
+ };
310
+ children: LayoutContent[]; // Array of content items that can be fields, nested containers, or components
311
+ };
312
+ }[];
313
+ // Sidebar layout section
314
+ sidebar?: {
315
+ type: 'card';
316
+ card: {
317
+ title: {
318
+ text: string; // Title of the card
319
+ };
320
+ subtitle?: {
321
+ text: string; // Subtitle of the card
322
+ };
323
+ children: LayoutContent[]; // Array of content items that can be fields, nested containers, or components
324
+ };
325
+ }[];
326
+ };
327
+ collectionId: string; // Related collection ID
328
+ entityTypeSource: 'cms'; // Data source type. Always 'cms'
329
+ };
330
+ }[];
331
+ }
332
+
333
+ type LayoutContent =
334
+ | {
335
+ type: 'field';
336
+ field: {
337
+ span?: number;
338
+ fieldId: string;
339
+ };
340
+ }
341
+ | {
342
+ type: 'container';
343
+ container: {
344
+ span?: number;
345
+ children: LayoutContent[];
346
+ };
347
+ }
348
+ | {
349
+ type: 'component';
350
+ component: {
351
+ span?: number;
352
+ componentId: string;
353
+ };
354
+ };
355
+ ```