@wix/auto-patterns 1.23.0 → 1.25.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 (207) hide show
  1. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +12 -323
  2. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +172 -0
  4. package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
  5. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +78 -0
  6. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
  7. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +119 -0
  8. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
  9. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +79 -0
  10. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
  11. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js +16 -0
  12. package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
  13. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +77 -0
  14. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
  15. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +109 -0
  16. package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
  17. package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +198 -0
  18. package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
  19. package/dist/cjs/components/AutoPatternsEntityPage/index.js +12 -0
  20. package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -1
  21. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js +2 -1
  22. package/dist/cjs/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  23. package/dist/cjs/hooks/useActionCell.js +2 -1
  24. package/dist/cjs/hooks/useActionCell.js.map +1 -1
  25. package/dist/cjs/hooks/useBulkActionToolbar.js +2 -1
  26. package/dist/cjs/hooks/useBulkActionToolbar.js.map +1 -1
  27. package/dist/cjs/hooks/useCollectionPageActions.js +2 -1
  28. package/dist/cjs/hooks/useCollectionPageActions.js.map +1 -1
  29. package/dist/cjs/hooks/useEntityPageActions.js +106 -0
  30. package/dist/cjs/hooks/useEntityPageActions.js.map +1 -0
  31. package/dist/cjs/hooks/useEntityPageMoreActions.js +11 -1
  32. package/dist/cjs/hooks/useEntityPageMoreActions.js.map +1 -1
  33. package/dist/cjs/hooks/useNavigateEditEntityAction.js +50 -0
  34. package/dist/cjs/hooks/useNavigateEditEntityAction.js.map +1 -0
  35. package/dist/cjs/hooks/useNavigationUtils.js +12 -1
  36. package/dist/cjs/hooks/useNavigationUtils.js.map +1 -1
  37. package/dist/cjs/providers/ErrorContext.js +6 -3
  38. package/dist/cjs/providers/ErrorContext.js.map +1 -1
  39. package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
  40. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
  41. package/dist/cjs/types/EntityPageConfig.js.map +1 -1
  42. package/dist/cjs/types/actions/actionCell.js.map +1 -1
  43. package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
  44. package/dist/cjs/utils/actions/types.js.map +1 -1
  45. package/dist/docs/action_cell.md +11 -6
  46. package/dist/docs/app_config_structure.md +49 -4
  47. package/dist/docs/auto-patterns-guide.md +311 -43
  48. package/dist/docs/bulk_actions.md +7 -2
  49. package/dist/docs/collection_page_actions.md +14 -4
  50. package/dist/docs/entity_page.md +65 -1
  51. package/dist/docs/entity_page_actions.md +13 -11
  52. package/dist/docs/entity_page_view_actions.md +137 -0
  53. package/dist/docs/index.md +6 -2
  54. package/dist/docs/pages_configuration.md +1 -11
  55. package/dist/docs/sdk_utilities.md +11 -4
  56. package/dist/docs/wix_fqdn_custom_data_source.md +25 -5
  57. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +4 -3
  58. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  59. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +2 -1
  60. package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
  61. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +9 -196
  62. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  63. package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +115 -0
  64. package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
  65. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js +10 -6
  66. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js.map +1 -1
  67. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js +23 -16
  68. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js.map +1 -1
  69. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +3 -2
  70. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -1
  71. package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js +9 -6
  72. package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
  73. package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js +8 -6
  74. package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js.map +1 -1
  75. package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js +10 -8
  76. package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js.map +1 -1
  77. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js +12 -10
  78. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -1
  79. package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js +8 -6
  80. package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js.map +1 -1
  81. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +33 -0
  82. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
  83. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +70 -0
  84. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
  85. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +48 -0
  86. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
  87. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +3 -0
  88. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
  89. package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js +7 -4
  90. package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js.map +1 -1
  91. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +31 -0
  92. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
  93. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +66 -0
  94. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
  95. package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +111 -0
  96. package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
  97. package/dist/esm/components/AutoPatternsEntityPage/index.js +2 -0
  98. package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
  99. package/dist/esm/components/ModalRenderer.js +2 -1
  100. package/dist/esm/components/ModalRenderer.js.map +1 -1
  101. package/dist/esm/components/modals/actions/BulkDeleteModal.js +12 -7
  102. package/dist/esm/components/modals/actions/BulkDeleteModal.js.map +1 -1
  103. package/dist/esm/components/modals/actions/CreateModal.js +11 -6
  104. package/dist/esm/components/modals/actions/CreateModal.js.map +1 -1
  105. package/dist/esm/components/modals/actions/EditModal.js +11 -6
  106. package/dist/esm/components/modals/actions/EditModal.js.map +1 -1
  107. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js +6 -4
  108. package/dist/esm/dataSourceAdapters/cms/cmsAdapter.js.map +1 -1
  109. package/dist/esm/dataSourceAdapters/cms/filterUtils.js +2 -1
  110. package/dist/esm/dataSourceAdapters/cms/filterUtils.js.map +1 -1
  111. package/dist/esm/dataSourceAdapters/cms/sortUtils.js +2 -2
  112. package/dist/esm/dataSourceAdapters/cms/sortUtils.js.map +1 -1
  113. package/dist/esm/hooks/useActionCell.js +14 -9
  114. package/dist/esm/hooks/useActionCell.js.map +1 -1
  115. package/dist/esm/hooks/useBaseTableFeatures.js +2 -1
  116. package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
  117. package/dist/esm/hooks/useBulkActionToolbar.js +4 -3
  118. package/dist/esm/hooks/useBulkActionToolbar.js.map +1 -1
  119. package/dist/esm/hooks/useCollectionPageActions.js +5 -4
  120. package/dist/esm/hooks/useCollectionPageActions.js.map +1 -1
  121. package/dist/esm/hooks/useCollectionPageOnRowClickActions.js +1 -1
  122. package/dist/esm/hooks/useCollectionPageOnRowClickActions.js.map +1 -1
  123. package/dist/esm/hooks/useColumns.js +12 -7
  124. package/dist/esm/hooks/useColumns.js.map +1 -1
  125. package/dist/esm/hooks/useCommonCollectionFeatures.js +8 -7
  126. package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
  127. package/dist/esm/hooks/useEmptyStates.js +6 -5
  128. package/dist/esm/hooks/useEmptyStates.js.map +1 -1
  129. package/dist/esm/hooks/useEntityPageActions.js +83 -0
  130. package/dist/esm/hooks/useEntityPageActions.js.map +1 -0
  131. package/dist/esm/hooks/useEntityPageMoreActions.js +12 -2
  132. package/dist/esm/hooks/useEntityPageMoreActions.js.map +1 -1
  133. package/dist/esm/hooks/useFilters.js +7 -7
  134. package/dist/esm/hooks/useFilters.js.map +1 -1
  135. package/dist/esm/hooks/useNavigateEditEntityAction.js +46 -0
  136. package/dist/esm/hooks/useNavigateEditEntityAction.js.map +1 -0
  137. package/dist/esm/hooks/useNavigationUtils.js +15 -3
  138. package/dist/esm/hooks/useNavigationUtils.js.map +1 -1
  139. package/dist/esm/hooks/usePagePath.js +4 -3
  140. package/dist/esm/hooks/usePagePath.js.map +1 -1
  141. package/dist/esm/hooks/useTableFeatures.js +2 -1
  142. package/dist/esm/hooks/useTableFeatures.js.map +1 -1
  143. package/dist/esm/providers/ErrorContext.js +4 -1
  144. package/dist/esm/providers/ErrorContext.js.map +1 -1
  145. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
  146. package/dist/esm/providers/SchemaContext.js +3 -2
  147. package/dist/esm/providers/SchemaContext.js.map +1 -1
  148. package/dist/esm/providers/SchemaRegistryContext.js +1 -1
  149. package/dist/esm/providers/SchemaRegistryContext.js.map +1 -1
  150. package/dist/esm/types/EntityPageConfig.js.map +1 -1
  151. package/dist/esm/types/actions/actionCell.js.map +1 -1
  152. package/dist/esm/types/actions/entityPageActions.js.map +1 -1
  153. package/dist/esm/utils/actions/customAction.js +2 -1
  154. package/dist/esm/utils/actions/customAction.js.map +1 -1
  155. package/dist/esm/utils/actions/deleteAction.js +10 -5
  156. package/dist/esm/utils/actions/deleteAction.js.map +1 -1
  157. package/dist/esm/utils/actions/types.js.map +1 -1
  158. package/dist/esm/utils/filterCreators.js +11 -11
  159. package/dist/esm/utils/filterCreators.js.map +1 -1
  160. package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
  161. package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts +6 -0
  162. package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -0
  163. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +11 -0
  164. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +1 -0
  165. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +13 -0
  166. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +1 -0
  167. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +8 -0
  168. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +1 -0
  169. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +3 -0
  170. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +1 -0
  171. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +8 -0
  172. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +1 -0
  173. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +8 -0
  174. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +1 -0
  175. package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts +8 -0
  176. package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -0
  177. package/dist/types/components/AutoPatternsEntityPage/index.d.ts +2 -0
  178. package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
  179. package/dist/types/dataSourceAdapters/cms/cmsAdapter.d.ts.map +1 -1
  180. package/dist/types/hooks/useActionCell.d.ts.map +1 -1
  181. package/dist/types/hooks/useEntityPageActions.d.ts +9 -0
  182. package/dist/types/hooks/useEntityPageActions.d.ts.map +1 -0
  183. package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
  184. package/dist/types/hooks/useEntityPageMoreActions.d.ts +2 -2
  185. package/dist/types/hooks/useEntityPageMoreActions.d.ts.map +1 -1
  186. package/dist/types/hooks/useNavigateEditEntityAction.d.ts +6 -0
  187. package/dist/types/hooks/useNavigateEditEntityAction.d.ts.map +1 -0
  188. package/dist/types/hooks/useNavigationUtils.d.ts +1 -0
  189. package/dist/types/hooks/useNavigationUtils.d.ts.map +1 -1
  190. package/dist/types/providers/ErrorContext.d.ts +7 -0
  191. package/dist/types/providers/ErrorContext.d.ts.map +1 -1
  192. package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -2
  193. package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
  194. package/dist/types/types/EntityPageConfig.d.ts +20 -4
  195. package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
  196. package/dist/types/types/actions/actionCell.d.ts +7 -1
  197. package/dist/types/types/actions/actionCell.d.ts.map +1 -1
  198. package/dist/types/types/actions/entityPageActions.d.ts +24 -5
  199. package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
  200. package/dist/types/utils/actions/customAction.d.ts +1 -1
  201. package/dist/types/utils/actions/customAction.d.ts.map +1 -1
  202. package/dist/types/utils/actions/resolveAction.d.ts +1 -0
  203. package/dist/types/utils/actions/resolveAction.d.ts.map +1 -1
  204. package/dist/types/utils/actions/types.d.ts +2 -1
  205. package/dist/types/utils/actions/types.d.ts.map +1 -1
  206. package/package.json +16 -15
  207. package/dist/docs/config_schema.md +0 -184
@@ -95,6 +95,13 @@ It is configured using a TypeScript file conforming to the `AppConfig` interface
95
95
  - Not designating exactly one page as `appMainPage: true`
96
96
  - Missing or inconsistent page relationships (parentPageId/entityPageId)
97
97
  - Setting `stickyColumns` to invalid values (negative, zero, or exceeding column count)
98
+ - **Missing custom property**: When `entityTypeSource: 'custom'`, forgetting to include the required `custom: { id: "..." }` property will cause TypeScript errors
99
+ - **Using incorrect field types**: Mismatching page type with configuration object (e.g., `type: 'entityPage'` with `collectionPage` field)
100
+ - **Including fields from wrong page type**: Adding both `collectionPage` and `entityPage` fields in the same page configuration
101
+ - **Missing action layout properties**: Not including `action` property when `type: 'action'` or `menu` property when `type: 'menu'`
102
+ - **Missing action type properties**: Not including `create`, `update`, `delete`, or `bulkDelete` properties when required by the action type
103
+ - **Including wrong action properties**: Adding properties from different action types in the same action configuration
104
+ - **Action type mismatches**: Using action cell types in collection actions, or bulk action types in regular actions
98
105
 
99
106
  ```ts
100
107
  export interface AppConfig {
@@ -124,6 +131,9 @@ export interface AppConfig {
124
131
  collection: {
125
132
  collectionId: string; // ID of the Wix Data collection
126
133
  entityTypeSource: 'cms' | 'custom'; // Data source type.
134
+ custom?: { // REQUIRED when entityTypeSource is 'custom'
135
+ id: string; // ID matching your custom data source identifier
136
+ };
127
137
  };
128
138
  create?: { // Required when type is 'create'
129
139
  mode: 'page'; // Create mode
@@ -151,8 +161,8 @@ export interface AppConfig {
151
161
  collection: {
152
162
  collectionId: string; // ID of the Wix Data collection
153
163
  entityTypeSource: 'cms' | 'custom'; // Data source type.
154
- custom?: {
155
- id: string;
164
+ custom?: { // REQUIRED when entityTypeSource is 'custom'
165
+ id: string; // ID matching your custom data source identifier
156
166
  };
157
167
  reflectQueryInUrl?: boolean; // Reflects query state (search, filters, sorting) in the browser URL. Default: false
158
168
  selectAllScope?: 'page' | 'all'; // Controls "Select All" scope. 'all' selects entire collection, 'page' selects only visible items. Default: 'all'
@@ -373,6 +383,7 @@ export interface AppConfig {
373
383
  ]; // End of components array
374
384
  };
375
385
  entityPage?: {
386
+ mode?: 'edit' | 'view'; // Entity page mode. Default: 'edit'
376
387
  route: {
377
388
  path: string; // Route path for the entity page (e.g., '/product/:entityId')
378
389
  params: {
@@ -385,6 +396,40 @@ export interface AppConfig {
385
396
  subtitle?: {
386
397
  text: string; // Entity page subtitle
387
398
  };
399
+ actions?: { // Action configuration varies by mode
400
+ // Edit mode: only moreActions supported
401
+ // View mode: primaryActions, secondaryActions, and moreActions supported
402
+ primaryActions?: { // View mode only
403
+ type: 'action' | 'menu';
404
+ action?: {
405
+ item: {
406
+ id: string;
407
+ type: 'create' | 'custom';
408
+ label?: string;
409
+ create?: { // Required when type is 'create'
410
+ mode: 'page';
411
+ page: {
412
+ id: string; // Entity page ID to navigate to
413
+ };
414
+ };
415
+ };
416
+ };
417
+ menu?: {
418
+ label: string;
419
+ items: {}[]; // Array of action configurations, same structure as action.item, can include dividers
420
+ };
421
+ };
422
+ secondaryActions?: { // View mode only - same structure as primaryActions
423
+ type: 'action' | 'menu';
424
+ action?: {}; // Same structure as primaryActions.action
425
+ menu?: {}; // Same structure as primaryActions.menu
426
+ };
427
+ moreActions?: { // Both modes
428
+ id: string;
429
+ type: 'custom';
430
+ label?: string;
431
+ }[];
432
+ };
388
433
  parentPageId?: string; // ID of the parent collection page
389
434
  layout?: {
390
435
  // Main layout section
@@ -416,8 +461,8 @@ export interface AppConfig {
416
461
  };
417
462
  collectionId: string; // Related collection ID
418
463
  entityTypeSource: 'cms' | 'custom'; // Data source type.
419
- custom?: {
420
- id: string;
464
+ custom?: { // REQUIRED when entityTypeSource is 'custom'
465
+ id: string; // ID matching your custom data source identifier
421
466
  };
422
467
  };
423
468
  }[];
@@ -516,7 +561,6 @@ Notice how the `label` is derived from the `value` by capitalizing the first let
516
561
  - **Pages array must contain exactly two pages** - one collectionPage and one entityPage
517
562
  - **Exactly one page must have `appMainPage: true`** to designate it as the main page
518
563
  - **All page IDs referenced in relationships must exist in the configuration** - validate all `parentPageId` and `entityPageId` references
519
- - **Bind `type` strictly to matching fields** - if `type: 'collectionPage'`, only `collectionPage` field exists (no `entityPage` field), and vice versa
520
564
 
521
565
  ## Default Generation
522
566
 
@@ -529,12 +573,6 @@ Notice how the `label` is derived from the `value` by capitalizing the first let
529
573
  * The route path **must** include a descriptive segment (e.g., `/product/:entityId`, `/pet/:entityId`)
530
574
  * **Never use just `/:entityId`** - this conflicts with the collection page route and breaks routing
531
575
 
532
- ## Type and Structure Binding
533
-
534
- * If `type: 'collectionPage'`, then **only** `collectionPage` field exists (no `entityPage` field).
535
- * If `type: 'entityPage'`, then **only** `entityPage` field exists (no `collectionPage` field).
536
- * **No cross-mixing** allowed.
537
-
538
576
  ## Page Connection Configuration
539
577
 
540
578
  ### Main Page Designation
@@ -599,11 +637,8 @@ A two-way connection must be established between collection pages and entity pag
599
637
  * **Route Structure**: Entity pages must use `/[segment]/:entityId` format (e.g., `/product/:entityId` or `/pets/:entityId`), never just `/:entityId`
600
638
  * **Route Parameters Configuration**: All entity pages must have both a dynamic parameter in `route.path` and a matching configuration in `route.params`
601
639
 
602
- ## ⚠️ Common Type and Route Mistakes to Avoid
640
+ ## ⚠️ Common Route and Configuration Mistakes to Avoid
603
641
 
604
- - Using incorrect field types
605
- - Missing required fields
606
- - Including fields from wrong page type
607
642
  - Missing route.params for entity pages
608
643
  - Using `/:entityId` instead of `/segment/:entityId` for entity page routes (causes routing conflicts)
609
644
 
@@ -787,11 +822,15 @@ Custom collection page actions execute JavaScript code that you define for colle
787
822
  // Your collection export logic here
788
823
  console.log(`Exporting collection: ${collectionId}`);
789
824
  // Export and update all items on server
790
- return await schema.actions.bulkUpdate({ lastExported: new Date() });
825
+ // Handle potential undefined schema
826
+ if (schema) {
827
+ return await schema.actions.bulkUpdate({ lastExported: new Date() });
828
+ }
829
+ return Promise.resolve(); // fallback when schema is unavailable
791
830
  },
792
831
  successToast: 'Collection exported successfully',
793
832
  errorToast: (err, {retry}) => ({
794
- text: 'Export failed',
833
+ message: 'Export failed',
795
834
  action: { text: 'Retry', onClick: retry }
796
835
  })
797
836
  }
@@ -1014,10 +1053,16 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
1014
1053
  const updatedItem = { ...item, isActive: !item.isActive };
1015
1054
 
1016
1055
  optimisticActions.updateOne(updatedItem, {
1017
- submit: async (items) => schema.actions.update(items[0]),
1056
+ submit: async (items) => {
1057
+ // Handle potential undefined schema
1058
+ if (schema) {
1059
+ return await schema.actions.update(items[0]);
1060
+ }
1061
+ return items[0]; // fallback when schema is unavailable
1062
+ },
1018
1063
  successToast: `${item.name} toggled successfully`,
1019
1064
  errorToast: (err, {retry}) => ({
1020
- text: 'Toggle failed',
1065
+ message: 'Toggle failed',
1021
1066
  action: { text: 'Retry', onClick: retry }
1022
1067
  })
1023
1068
  });
@@ -1120,9 +1165,15 @@ const optimisticActions = sdk.getOptimisticActions(sdk.collectionId);
1120
1165
  const schema = sdk.getSchema(sdk.collectionId);
1121
1166
 
1122
1167
  optimisticActions.operation(items, {
1123
- submit: async (items) => schema.actions.serverMethod(items),
1168
+ submit: async (items) => {
1169
+ // Handle potential undefined schema
1170
+ if (schema) {
1171
+ return await schema.actions.serverMethod(items);
1172
+ }
1173
+ return items; // fallback when schema is unavailable
1174
+ },
1124
1175
  successToast: 'Success message',
1125
- errorToast: (err, {retry}) => ({ text: 'Error message', action: { text: 'Retry', onClick: retry }})
1176
+ errorToast: (err, {retry}) => ({ message: 'Error message', action: { text: 'Retry', onClick: retry }})
1126
1177
  });
1127
1178
  ```
1128
1179
 
@@ -1153,7 +1204,7 @@ interface OptimisticParams<T> {
1153
1204
  }
1154
1205
 
1155
1206
  interface ToastConfig {
1156
- text: string;
1207
+ message: string; // Note: Use 'message' property, not 'text'
1157
1208
  action?: { text: string; onClick: () => void };
1158
1209
  }
1159
1210
  ```
@@ -1162,9 +1213,10 @@ interface ToastConfig {
1162
1213
 
1163
1214
  **Before using optimistic actions:**
1164
1215
  - Verify `sdk.getOptimisticActions(collectionId)` returns valid instance
1165
- - Verify `sdk.getSchema(collectionId)` returns valid schema
1216
+ - **Always check for undefined schema**: `sdk.getSchema(collectionId)` can return `undefined` - handle this case in your submit functions
1166
1217
  - For delete operations: `showUndoToast: true` is mandatory
1167
1218
  - All `submit` functions must return a Promise
1219
+ - **Toast property**: Use `message` property in ToastConfig, not `text`
1168
1220
 
1169
1221
  **SDK Parameter:** Available in custom actions and modals. See SDK Utilities section for complete interface.
1170
1222
 
@@ -1458,12 +1510,12 @@ Custom actions execute JavaScript code that you define. These actions receive pa
1458
1510
 
1459
1511
  2. Create your action handler in `downloadPetDetails.tsx` (note: the filename and function name MUST match your action id):
1460
1512
  ```typescript
1461
- import { CustomActionCellActionResolver } from '@wix/auto-patterns';
1513
+ import { CustomActionCellSecondaryActionResolver } from '@wix/auto-patterns';
1462
1514
  import { Download } from '@wix/wix-ui-icons-common';
1463
1515
  import React from 'react';
1464
1516
 
1465
1517
  // IMPORTANT: Function name MUST match the action id in your configuration
1466
- export const downloadPetDetails: CustomActionCellActionResolver = (params) => {
1518
+ export const downloadPetDetails: CustomActionCellSecondaryActionResolver = (params) => {
1467
1519
  const { actionParams, sdk } = params;
1468
1520
  const { item } = actionParams;
1469
1521
 
@@ -1480,11 +1532,15 @@ Custom actions execute JavaScript code that you define. These actions receive pa
1480
1532
  optimisticActions.updateOne(updatedItem, {
1481
1533
  submit: async (items) => {
1482
1534
  // Your download logic here + update server
1483
- return await schema.actions.update(items[0]);
1535
+ // Handle potential undefined schema
1536
+ if (schema) {
1537
+ return await schema.actions.update(items[0]);
1538
+ }
1539
+ return items[0]; // fallback when schema is unavailable
1484
1540
  },
1485
1541
  successToast: 'Pet details downloaded',
1486
1542
  errorToast: (err, {retry}) => ({
1487
- text: 'Download failed',
1543
+ message: 'Download failed',
1488
1544
  action: { text: 'Retry', onClick: retry }
1489
1545
  })
1490
1546
  });
@@ -1535,7 +1591,7 @@ Custom actions execute JavaScript code that you define. These actions receive pa
1535
1591
  - The action `id` in the configuration MUST exactly match the function name exported from your actions folder
1536
1592
  - The function name and file name should follow a consistent naming convention (e.g., camelCase)
1537
1593
  - The implementation must be exported as a named export (not default export)
1538
- - The implementation must use the `CustomActionCellActionResolver` type
1594
+ - The implementation must use either `CustomActionCellPrimaryActionResolver` or `CustomActionCellSecondaryActionResolver` type depending on your use case
1539
1595
 
1540
1596
  #### Validation Rules for Custom Actions:
1541
1597
 
@@ -1548,9 +1604,10 @@ Custom actions execute JavaScript code that you define. These actions receive pa
1548
1604
  - `label`: Text displayed for the action
1549
1605
  - `icon`: An Icon component from "@wix/wix-ui-icons-common"
1550
1606
  - `onClick`: Handler function for the action
1607
+ - `hidden` (optional): Boolean to hide the action when true
1551
1608
 
1552
1609
  3. The implementation must:
1553
- - Use the correct type: `CustomActionCellActionResolver`
1610
+ - Use the correct type: `CustomActionCellPrimaryActionResolver` for primary actions (with prefixIcon/suffixIcon) or `CustomActionCellSecondaryActionResolver` for secondary actions (with icon)
1554
1611
  - Be exported as a named export
1555
1612
  - Have a filename matching the function name
1556
1613
 
@@ -1714,11 +1771,15 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
1714
1771
  a.click();
1715
1772
 
1716
1773
  // Update server with export timestamp
1717
- return await schema.actions.update(items);
1774
+ // Handle potential undefined schema
1775
+ if (schema) {
1776
+ return await schema.actions.update(items);
1777
+ }
1778
+ return items; // fallback when schema is unavailable
1718
1779
  },
1719
1780
  successToast: `${selectedValues.length} pets exported`,
1720
1781
  errorToast: (err, {retry}) => ({
1721
- text: 'Export failed',
1782
+ message: 'Export failed',
1722
1783
  action: { text: 'Retry', onClick: retry }
1723
1784
  })
1724
1785
  });
@@ -1782,6 +1843,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
1782
1843
  - `label`: Text displayed for the action
1783
1844
  - `icon`: An Icon component from "@wix/wix-ui-icons-common"
1784
1845
  - `onClick`: Handler function for the bulk action
1846
+ - `hidden` (optional): Boolean to hide the action when true
1785
1847
 
1786
1848
  3. The implementation must:
1787
1849
  - Use the correct type: `CustomBulkActionsActionResolver`
@@ -1898,8 +1960,72 @@ All entity pages must have:
1898
1960
 
1899
1961
  * Displays details for a **single entity**.
1900
1962
  * Always tied to a single Wix collection.
1963
+ * Supports **two distinct modes**: **view mode** and **edit mode** with separate page configurations.
1964
+
1965
+ ## Entity Page Modes
1966
+
1967
+ AutoPatterns supports two entity page modes that can be configured as separate pages:
1968
+
1969
+ ### Edit Mode (Default)
1970
+ - **Purpose**: Allows users to modify entity data
1971
+ - **UI**: Uses `@wix/patterns` `EntityPage` component with built-in Save/Cancel actions
1972
+ - **Actions**: Only supports `moreActions` (custom actions in the "more" menu)
1973
+ - **Default Mode**: When `mode` is not specified, defaults to edit mode
1974
+
1975
+ ### View Mode
1976
+ - **Purpose**: Displays entity data in read-only format with rich action capabilities
1977
+ - **Actions**: Supports `primaryActions`, `secondaryActions`, and `moreActions` (collection-style actions)
1978
+ - **Mode**: Must be explicitly set with `mode: 'view'`
1901
1979
 
1902
- > The custom actions must be defined inside the `moreActions` array.
1980
+
1981
+ ## Routing Patterns
1982
+
1983
+ When implementing both view and edit modes for the same entity, use these routing patterns:
1984
+
1985
+ - **View Mode**: `/entity/:entityId` (e.g., `/product/:productId`)
1986
+ - **Edit Mode**: `/entity/edit/:entityId` (e.g., `/product/edit/:productId`)
1987
+
1988
+ This pattern allows:
1989
+ - Clear distinction between view and edit URLs
1990
+ - Natural navigation flow between modes
1991
+
1992
+ ## View Mode: Purpose and API
1993
+
1994
+ ### Purpose of View Mode
1995
+ View mode is primarily intended for **read-only entity presentation** with rich action capabilities by default; however, it also supports interactive or editable custom components if needed:
1996
+
1997
+ - **Data Display**: Present entity information in a clean, read-only format
1998
+ - **Action Hub**: Provide primary, secondary, and more actions for entity operations
1999
+ - **Navigation Center**: Enable seamless transitions to edit mode and other workflows
2000
+ - **Rich Content**: Display images, rich text, and complex data types optimally
2001
+
2002
+
2003
+ See [Entity Page View Actions](./entity_page_view_actions.md) for detailed action configuration.
2004
+
2005
+ #### Out-of-the-Box Features
2006
+
2007
+ **Automatic Edit Navigation**: When a corresponding edit mode page exists, view mode automatically adds an "Edit [EntityName]" action to the more actions menu.
2008
+
2009
+ **Back Navigation**: Automatic "Back" button that navigates to the parent collection page.
2010
+
2011
+ ## Action Configuration
2012
+
2013
+ Entity page action configuration depends on the mode:
2014
+
2015
+ - **Edit Mode**: Supports only `moreActions`. See [Entity Page Actions](./entity_page_actions.md)
2016
+ - **View Mode**: Supports full action API (`primaryActions`, `secondaryActions`, `moreActions`). See [Entity Page View Actions](./entity_page_view_actions.md)
2017
+
2018
+ ### Edit Mode Actions
2019
+ - **Supported**: `moreActions` only
2020
+ - **Built-in**: Save and Cancel actions are automatically provided
2021
+ - **Custom Actions**: Must be defined in the `moreActions` array
2022
+
2023
+ ### View Mode Actions
2024
+ - **Supported**: `primaryActions`, `secondaryActions`, and `moreActions`
2025
+ - **Pattern**: Follows collection page action patterns
2026
+ - **Flexibility**: Full control over all action areas
2027
+
2028
+ > The custom actions must be defined inside the `moreActions` array for edit mode, but view mode supports actions in all areas.
1903
2029
 
1904
2030
  > Note: You do not need to define a custom action to navigate to the entity page. This behavior is built-in — clicking on a row in the collection table automatically navigates to the corresponding entity page.
1905
2031
 
@@ -1991,11 +2117,13 @@ All entity pages must have:
1991
2117
 
1992
2118
  ---
1993
2119
 
1994
- ## Entity Page Actions: `moreActions` Support
2120
+ ## Entity Page Edit Mode Actions: `moreActions` Support
1995
2121
 
1996
- Entity pages in AutoPatternsApp support not only a primary action (such as "Save" or "Delete") but also a flexible set of **more actions** (sometimes called "secondary actions" or `moreActions`). These allow you to provide additional contextual actions for the entity, such as custom logic, or grouped actions.
2122
+ Entity pages in **edit mode** support not only built-in actions (such as "Save" and "Cancel") but also a flexible set of **more actions** (sometimes called "secondary actions" or `moreActions`). These allow you to provide additional contextual actions for the entity, such as custom logic, or grouped actions.
1997
2123
 
1998
- > **Note:** All custom actions for entity pages must be placed in the `moreActions` array. Do not place custom actions as primary actions on entity pages. The `moreActions` array is the only supported location for custom actions on entity pages.
2124
+ > **Note:** This documentation covers **edit mode** entity pages only. Edit mode supports only `moreActions`. For **view mode** entity pages that support `primaryActions`, `secondaryActions`, and `moreActions`, see [Entity Page View Actions](./entity_page_view_actions.md).
2125
+
2126
+ > **Edit Mode Limitation:** All custom actions for edit mode entity pages must be placed in the `moreActions` array. Do not place custom actions as primary actions on edit mode entity pages. The `moreActions` array is the only supported location for custom actions on edit mode entity pages.
1999
2127
 
2000
2128
  ### Configuration Structure
2001
2129
 
@@ -2032,16 +2160,16 @@ Entity pages in AutoPatternsApp support not only a primary action (such as "Save
2032
2160
 
2033
2161
  ---
2034
2162
 
2035
- ### CustomEntityPageMoreActionsActionResolver
2163
+ ### CustomEntityPageActionResolver
2036
2164
 
2037
- The `CustomEntityPageMoreActionsActionResolver` type is used to implement custom actions for the `moreActions` menu on entity pages in AutoPatternsApp. Each action in the `moreActions` array must have a corresponding resolver function registered in your overrides.
2165
+ The `CustomEntityPageActionResolver` type is used to implement custom actions for the `moreActions` menu on entity pages in AutoPatternsApp. Each action in the `moreActions` array must have a corresponding resolver function registered in your overrides.
2038
2166
 
2039
2167
  #### Function Signature
2040
2168
 
2041
2169
  ```typescript
2042
- import { CustomEntityPageMoreActionsActionResolver } from '@wix/auto-patterns/types';
2170
+ import { CustomEntityPageActionResolver } from '@wix/auto-patterns/types';
2043
2171
 
2044
- export const myMoreAction: CustomEntityPageMoreActionsActionResolver = (params) => {
2172
+ export const myMoreAction: CustomEntityPageActionResolver = (params) => {
2045
2173
  const { actionParams: { entity, form } , sdk } = params;
2046
2174
 
2047
2175
  return {
@@ -2060,10 +2188,10 @@ export const myMoreAction: CustomEntityPageMoreActionsActionResolver = (params)
2060
2188
 
2061
2189
  ---
2062
2190
 
2063
- #### Key Points for CustomEntityPageMoreActionsActionResolver
2191
+ #### Key Points for CustomEntityPageActionResolver
2064
2192
 
2065
2193
  - The action `id` in the configuration MUST exactly match the function name exported from your actions folder.
2066
- - The implementation must use the `CustomEntityPageMoreActionsActionResolver` type.
2194
+ - The implementation must use the `CustomEntityPageActionResolver` type.
2067
2195
  - The implementation must be exported as a named export (not default export).
2068
2196
  - The function receives `{ actionParams, sdk }` as parameters.
2069
2197
  - The returned object must include at least a `label` and an `onClick` handler (optionally an `icon`).
@@ -2076,13 +2204,153 @@ export const myMoreAction: CustomEntityPageMoreActionsActionResolver = (params)
2076
2204
  ✓ Each action type only includes its required field(s)
2077
2205
  ✓ Custom actions match implementations in overrides
2078
2206
  ✓ The resolver is exported and registered in the `actions` property of your `PatternsWizardOverridesProvider`
2079
- ✓ The function signature matches `CustomEntityPageMoreActionsActionResolver`
2207
+ ✓ The function signature matches `CustomEntityPageActionResolver`
2080
2208
  ✓ The returned object includes `label`, `onClick`, and optionally `icon`
2081
2209
 
2082
2210
  ---
2083
2211
 
2084
2212
  **Summary:**
2085
- The `CustomEntityPageMoreActionsActionResolver` enables you to add custom, contextual actions to the "More Actions" menu on your entity pages. Implement the resolver, export it, and reference it by `id` in your config for seamless integration.
2213
+ The `CustomEntityPageActionResolver` enables you to add custom, contextual actions to the "More Actions" menu on your entity pages. Implement the resolver, export it, and reference it by `id` in your config for seamless integration.
2214
+
2215
+ ---
2216
+
2217
+ # Entity Page View Mode Actions
2218
+
2219
+ View mode supports the complete collection-style actions API, providing maximum flexibility for entity operations.
2220
+
2221
+ ## Supported Action Types
2222
+
2223
+ ### Primary Actions
2224
+ The main call-to-action, typically for the most common operation:
2225
+
2226
+ ```typescript
2227
+ primaryActions: {
2228
+ type: 'action',
2229
+ action: {
2230
+ item: {
2231
+ id: 'createEntity',
2232
+ label: 'Create New',
2233
+ type: 'create',
2234
+ create: {
2235
+ mode: 'page',
2236
+ page: { id: 'EntityEditPageId' }
2237
+ }
2238
+ }
2239
+ }
2240
+ }
2241
+ ```
2242
+
2243
+ ### Secondary Actions
2244
+ Supporting actions displayed alongside primary actions:
2245
+
2246
+ ```typescript
2247
+ secondaryActions: {
2248
+ type: 'action',
2249
+ action: {
2250
+ item: {
2251
+ id: 'duplicateEntity',
2252
+ label: 'Duplicate',
2253
+ type: 'custom',
2254
+ }
2255
+ }
2256
+ }
2257
+ ```
2258
+
2259
+ ### More Actions
2260
+ Additional contextual actions in dropdown menu:
2261
+
2262
+ ```typescript
2263
+ moreActions: [
2264
+ {
2265
+ id: 'shareEntity',
2266
+ type: 'custom',
2267
+ label: 'Share',
2268
+ }
2269
+ ]
2270
+ ```
2271
+
2272
+ ## Action Menu Support
2273
+
2274
+ View mode also supports menu-style actions for grouping related operations:
2275
+
2276
+ ```typescript
2277
+ primaryActions: {
2278
+ type: 'menu',
2279
+ menu: {
2280
+ label: 'Actions',
2281
+ items: [
2282
+ {
2283
+ id: 'duplicateProduct',
2284
+ label: 'Duplicate',
2285
+ type: 'custom',
2286
+ },
2287
+ { type: 'divider' },
2288
+ {
2289
+ id: 'shareProduct',
2290
+ type: 'custom',
2291
+ label: 'Share'
2292
+ }
2293
+ ]
2294
+ }
2295
+ }
2296
+ ```
2297
+
2298
+ ## Automatic Edit Action
2299
+
2300
+ View mode automatically provides an "Edit [EntityName]" action in the more actions menu when:
2301
+ - An edit mode page exists for the same collection
2302
+ - The edit page has no explicit mode or `mode: 'edit'`
2303
+ - The view page has `mode: 'view'`
2304
+
2305
+ This action is automatically added and doesn't need to be configured manually.
2306
+
2307
+ ## Action Resolvers
2308
+
2309
+ View mode actions follow the same resolver patterns as collection page actions:
2310
+
2311
+ ### For Standard Actions (create)
2312
+ These actions are handled automatically by the AutoPatterns framework using the configuration provided.
2313
+
2314
+ ### For Custom Actions
2315
+ Custom actions require resolver implementations:
2316
+
2317
+ ```typescript
2318
+ import { CustomEntityPageActionResolver } from '@wix/auto-patterns/types';
2319
+
2320
+ export const duplicateProduct: CustomEntityPageActionResolver = (params) => {
2321
+ const { actionParams: { entity }, sdk } = params;
2322
+
2323
+ const schema = sdk.getSchema(sdk.collectionId);
2324
+ return {
2325
+ label: 'Duplicate Product',
2326
+ icon: <DuplicateIcon />, // optional
2327
+ onClick: async () => {
2328
+ // Your custom duplication logic here
2329
+ await schema.actions.create({
2330
+ ...entity,
2331
+ name: `${entity.name} (Copy)`
2332
+ });
2333
+ },
2334
+ };
2335
+ };
2336
+ ```
2337
+
2338
+ ## Best Practices
2339
+
2340
+ ### When to Use Each Action Type
2341
+
2342
+ **Primary Actions**: Use for the most common user action (typically "Create" or main workflow action)
2343
+
2344
+ **Secondary Actions**: Use for supporting workflows like "Duplicate"
2345
+
2346
+ **More Actions**: Use for:
2347
+ - Less common operations
2348
+ - Administrative functions
2349
+ - Actions that need confirmation
2350
+
2351
+ ### Navigation Patterns
2352
+
2353
+ 1. **View → Create**: Use primary actions with `type: 'create'`
2086
2354
 
2087
2355
  ---
2088
2356
 
@@ -106,11 +106,15 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
106
106
  a.click();
107
107
 
108
108
  // Update server with export timestamp
109
- return await schema.actions.update(items);
109
+ // Handle potential undefined schema
110
+ if (schema) {
111
+ return await schema.actions.update(items);
112
+ }
113
+ return items; // fallback when schema is unavailable
110
114
  },
111
115
  successToast: `${selectedValues.length} pets exported`,
112
116
  errorToast: (err, {retry}) => ({
113
- text: 'Export failed',
117
+ message: 'Export failed',
114
118
  action: { text: 'Retry', onClick: retry }
115
119
  })
116
120
  });
@@ -174,6 +178,7 @@ Custom bulk actions execute JavaScript code that you define for bulk operations.
174
178
  - `label`: Text displayed for the action
175
179
  - `icon`: An Icon component from "@wix/wix-ui-icons-common"
176
180
  - `onClick`: Handler function for the bulk action
181
+ - `hidden` (optional): Boolean to hide the action when true
177
182
 
178
183
  3. The implementation must:
179
184
  - Use the correct type: `CustomBulkActionsActionResolver`
@@ -87,11 +87,15 @@ Custom collection page actions execute JavaScript code that you define for colle
87
87
  // Your collection export logic here
88
88
  console.log(`Exporting collection: ${collectionId}`);
89
89
  // Export and update all items on server
90
- return await schema.actions.bulkUpdate({ lastExported: new Date() });
90
+ // Handle potential undefined schema
91
+ if (schema) {
92
+ return await schema.actions.bulkUpdate({ lastExported: new Date() });
93
+ }
94
+ return Promise.resolve(); // fallback when schema is unavailable
91
95
  },
92
96
  successToast: 'Collection exported successfully',
93
97
  errorToast: (err, {retry}) => ({
94
- text: 'Export failed',
98
+ message: 'Export failed',
95
99
  action: { text: 'Retry', onClick: retry }
96
100
  })
97
101
  }
@@ -314,10 +318,16 @@ export const quickToggle: CustomActionCollectionPageActionOnRowClickResolver = (
314
318
  const updatedItem = { ...item, isActive: !item.isActive };
315
319
 
316
320
  optimisticActions.updateOne(updatedItem, {
317
- submit: async (items) => schema.actions.update(items[0]),
321
+ submit: async (items) => {
322
+ // Handle potential undefined schema
323
+ if (schema) {
324
+ return await schema.actions.update(items[0]);
325
+ }
326
+ return items[0]; // fallback when schema is unavailable
327
+ },
318
328
  successToast: `${item.name} toggled successfully`,
319
329
  errorToast: (err, {retry}) => ({
320
- text: 'Toggle failed',
330
+ message: 'Toggle failed',
321
331
  action: { text: 'Retry', onClick: retry }
322
332
  })
323
333
  });