@wix/auto-patterns 1.22.0 → 1.24.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 (122) 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 +196 -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/hooks/useActionCell.js.map +1 -1
  22. package/dist/cjs/hooks/useEntityPageActions.js +105 -0
  23. package/dist/cjs/hooks/useEntityPageActions.js.map +1 -0
  24. package/dist/cjs/hooks/useEntityPageMoreActions.js +10 -0
  25. package/dist/cjs/hooks/useEntityPageMoreActions.js.map +1 -1
  26. package/dist/cjs/hooks/useNavigateEditEntityAction.js +50 -0
  27. package/dist/cjs/hooks/useNavigateEditEntityAction.js.map +1 -0
  28. package/dist/cjs/hooks/useNavigationUtils.js +12 -1
  29. package/dist/cjs/hooks/useNavigationUtils.js.map +1 -1
  30. package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
  31. package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
  32. package/dist/cjs/types/EntityPageConfig.js.map +1 -1
  33. package/dist/cjs/types/actions/base.js.map +1 -1
  34. package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
  35. package/dist/cjs/utils/actions/types.js.map +1 -1
  36. package/dist/docs/action_cell.md +6 -2
  37. package/dist/docs/app_config_structure.md +48 -6
  38. package/dist/docs/auto-patterns-guide.md +391 -60
  39. package/dist/docs/bulk_actions.md +7 -6
  40. package/dist/docs/collection_page_actions.md +14 -4
  41. package/dist/docs/custom_overrides.md +86 -15
  42. package/dist/docs/entity_page.md +65 -1
  43. package/dist/docs/entity_page_actions.md +13 -11
  44. package/dist/docs/entity_page_view_actions.md +137 -0
  45. package/dist/docs/index.md +6 -2
  46. package/dist/docs/pages_configuration.md +1 -11
  47. package/dist/docs/sdk_utilities.md +11 -4
  48. package/dist/docs/wix_fqdn_custom_data_source.md +25 -5
  49. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +9 -201
  50. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  51. package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +115 -0
  52. package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
  53. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +33 -0
  54. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
  55. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +70 -0
  56. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
  57. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +48 -0
  58. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
  59. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +3 -0
  60. package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
  61. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +31 -0
  62. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
  63. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +66 -0
  64. package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
  65. package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +109 -0
  66. package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
  67. package/dist/esm/components/AutoPatternsEntityPage/index.js +2 -0
  68. package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
  69. package/dist/esm/hooks/useActionCell.js.map +1 -1
  70. package/dist/esm/hooks/useEntityPageActions.js +82 -0
  71. package/dist/esm/hooks/useEntityPageActions.js.map +1 -0
  72. package/dist/esm/hooks/useEntityPageMoreActions.js +11 -1
  73. package/dist/esm/hooks/useEntityPageMoreActions.js.map +1 -1
  74. package/dist/esm/hooks/useNavigateEditEntityAction.js +46 -0
  75. package/dist/esm/hooks/useNavigateEditEntityAction.js.map +1 -0
  76. package/dist/esm/hooks/useNavigationUtils.js +12 -1
  77. package/dist/esm/hooks/useNavigationUtils.js.map +1 -1
  78. package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
  79. package/dist/esm/types/EntityPageConfig.js.map +1 -1
  80. package/dist/esm/types/actions/base.js.map +1 -1
  81. package/dist/esm/types/actions/entityPageActions.js.map +1 -1
  82. package/dist/esm/utils/actions/types.js.map +1 -1
  83. package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
  84. package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts +6 -0
  85. package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -0
  86. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +11 -0
  87. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +1 -0
  88. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +13 -0
  89. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +1 -0
  90. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +8 -0
  91. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +1 -0
  92. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +3 -0
  93. package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +1 -0
  94. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +8 -0
  95. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +1 -0
  96. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +8 -0
  97. package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +1 -0
  98. package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts +8 -0
  99. package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -0
  100. package/dist/types/components/AutoPatternsEntityPage/index.d.ts +2 -0
  101. package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
  102. package/dist/types/hooks/useEntityPageActions.d.ts +9 -0
  103. package/dist/types/hooks/useEntityPageActions.d.ts.map +1 -0
  104. package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
  105. package/dist/types/hooks/useEntityPageMoreActions.d.ts +2 -2
  106. package/dist/types/hooks/useEntityPageMoreActions.d.ts.map +1 -1
  107. package/dist/types/hooks/useNavigateEditEntityAction.d.ts +6 -0
  108. package/dist/types/hooks/useNavigateEditEntityAction.d.ts.map +1 -0
  109. package/dist/types/hooks/useNavigationUtils.d.ts +1 -0
  110. package/dist/types/hooks/useNavigationUtils.d.ts.map +1 -1
  111. package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -5
  112. package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
  113. package/dist/types/types/EntityPageConfig.d.ts +20 -4
  114. package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
  115. package/dist/types/types/actions/base.d.ts +0 -4
  116. package/dist/types/types/actions/base.d.ts.map +1 -1
  117. package/dist/types/types/actions/entityPageActions.d.ts +24 -5
  118. package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
  119. package/dist/types/utils/actions/types.d.ts +1 -1
  120. package/dist/types/utils/actions/types.d.ts.map +1 -1
  121. package/package.json +15 -15
  122. package/dist/docs/config_schema.md +0 -184
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n id: string;\n label?: string;\n skin?: string;\n};\n\nexport interface Feedback {\n successToast?: { text: string };\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n title?: { text: string };\n actions?: {\n submit?: { text: string };\n cancel?: { text: string };\n };\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n id: string;\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n custom?: never;\n }\n | {\n mode: 'custom';\n custom: CustomAction;\n modal?: never;\n };\n\nexport type DeleteAction = {\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n id: string;\n}\n\nexport type CustomAction = {};\n\nexport interface ActionModalWithFields extends BaseActionModal {\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n type: 'create';\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n type: 'update';\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n type: 'delete';\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n type: 'bulkDelete';\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n type: 'custom';\n custom: CustomAction;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n id: string;\n label?: string;\n skin?: string;\n};\n\nexport interface Feedback {\n successToast?: { text: string };\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n title?: { text: string };\n actions?: {\n submit?: { text: string };\n cancel?: { text: string };\n };\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n id: string;\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n type: 'create';\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n type: 'update';\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n type: 'delete';\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n type: 'bulkDelete';\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n type: 'custom';\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport { CustomActionConfig, DividerActionConfig } from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport interface EntityPageMoreActionsActionParams {\n entity: any;\n form: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageMoreActionsActionParams =\n CustomActionParams<EntityPageMoreActionsActionParams>;\n\nexport type CustomEntityPageMoreActionsActionResolver = (\n params: CustomEntityPageMoreActionsActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n type: 'action';\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams {\n entity: any;\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n tooltip?: string;\n skin?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends ActionCellBaseParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n tooltip?: string;\n skin?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends BaseActionParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
@@ -131,11 +131,15 @@ Custom actions execute JavaScript code that you define. These actions receive pa
131
131
  optimisticActions.updateOne(updatedItem, {
132
132
  submit: async (items) => {
133
133
  // Your download logic here + update server
134
- return await schema.actions.update(items[0]);
134
+ // Handle potential undefined schema
135
+ if (schema) {
136
+ return await schema.actions.update(items[0]);
137
+ }
138
+ return items[0]; // fallback when schema is unavailable
135
139
  },
136
140
  successToast: 'Pet details downloaded',
137
141
  errorToast: (err, {retry}) => ({
138
- text: 'Download failed',
142
+ message: 'Download failed',
139
143
  action: { text: 'Retry', onClick: retry }
140
144
  })
141
145
  });
@@ -17,6 +17,13 @@
17
17
  - Not designating exactly one page as `appMainPage: true`
18
18
  - Missing or inconsistent page relationships (parentPageId/entityPageId)
19
19
  - Setting `stickyColumns` to invalid values (negative, zero, or exceeding column count)
20
+ - **Missing custom property**: When `entityTypeSource: 'custom'`, forgetting to include the required `custom: { id: "..." }` property will cause TypeScript errors
21
+ - **Using incorrect field types**: Mismatching page type with configuration object (e.g., `type: 'entityPage'` with `collectionPage` field)
22
+ - **Including fields from wrong page type**: Adding both `collectionPage` and `entityPage` fields in the same page configuration
23
+ - **Missing action layout properties**: Not including `action` property when `type: 'action'` or `menu` property when `type: 'menu'`
24
+ - **Missing action type properties**: Not including `create`, `update`, `delete`, or `bulkDelete` properties when required by the action type
25
+ - **Including wrong action properties**: Adding properties from different action types in the same action configuration
26
+ - **Action type mismatches**: Using action cell types in collection actions, or bulk action types in regular actions
20
27
 
21
28
  ```ts
22
29
  export interface AppConfig {
@@ -46,8 +53,8 @@ export interface AppConfig {
46
53
  collection: {
47
54
  collectionId: string; // ID of the Wix Data collection
48
55
  entityTypeSource: 'cms' | 'custom'; // Data source type.
49
- custom?: {
50
- id: string;
56
+ custom?: { // REQUIRED when entityTypeSource is 'custom'
57
+ id: string; // ID matching your custom data source identifier
51
58
  };
52
59
  };
53
60
  create?: { // Required when type is 'create'
@@ -76,8 +83,8 @@ export interface AppConfig {
76
83
  collection: {
77
84
  collectionId: string; // ID of the Wix Data collection
78
85
  entityTypeSource: 'cms' | 'custom'; // Data source type.
79
- custom?: {
80
- id: string;
86
+ custom?: { // REQUIRED when entityTypeSource is 'custom'
87
+ id: string; // ID matching your custom data source identifier
81
88
  };
82
89
  reflectQueryInUrl?: boolean; // Reflects query state (search, filters, sorting) in the browser URL. Default: false
83
90
  selectAllScope?: 'page' | 'all'; // Controls "Select All" scope. 'all' selects entire collection, 'page' selects only visible items. Default: 'all'
@@ -298,6 +305,7 @@ export interface AppConfig {
298
305
  ]; // End of components array
299
306
  };
300
307
  entityPage?: {
308
+ mode?: 'edit' | 'view'; // Entity page mode. Default: 'edit'
301
309
  route: {
302
310
  path: string; // Route path for the entity page (e.g., '/product/:entityId')
303
311
  params: {
@@ -310,6 +318,40 @@ export interface AppConfig {
310
318
  subtitle?: {
311
319
  text: string; // Entity page subtitle
312
320
  };
321
+ actions?: { // Action configuration varies by mode
322
+ // Edit mode: only moreActions supported
323
+ // View mode: primaryActions, secondaryActions, and moreActions supported
324
+ primaryActions?: { // View mode only
325
+ type: 'action' | 'menu';
326
+ action?: {
327
+ item: {
328
+ id: string;
329
+ type: 'create' | 'custom';
330
+ label?: string;
331
+ create?: { // Required when type is 'create'
332
+ mode: 'page';
333
+ page: {
334
+ id: string; // Entity page ID to navigate to
335
+ };
336
+ };
337
+ };
338
+ };
339
+ menu?: {
340
+ label: string;
341
+ items: {}[]; // Array of action configurations, same structure as action.item, can include dividers
342
+ };
343
+ };
344
+ secondaryActions?: { // View mode only - same structure as primaryActions
345
+ type: 'action' | 'menu';
346
+ action?: {}; // Same structure as primaryActions.action
347
+ menu?: {}; // Same structure as primaryActions.menu
348
+ };
349
+ moreActions?: { // Both modes
350
+ id: string;
351
+ type: 'custom';
352
+ label?: string;
353
+ }[];
354
+ };
313
355
  parentPageId?: string; // ID of the parent collection page
314
356
  layout?: {
315
357
  // Main layout section
@@ -341,8 +383,8 @@ export interface AppConfig {
341
383
  };
342
384
  collectionId: string; // Related collection ID
343
385
  entityTypeSource: 'cms' | 'custom'; // Data source type.
344
- custom?: {
345
- id: string;
386
+ custom?: { // REQUIRED when entityTypeSource is 'custom'
387
+ id: string; // ID matching your custom data source identifier
346
388
  };
347
389
  };
348
390
  }[];