@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.
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +12 -323
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +172 -0
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +78 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +119 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +79 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js +16 -0
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +77 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +109 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +196 -0
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/index.js +12 -0
- package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/cjs/hooks/useActionCell.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageActions.js +105 -0
- package/dist/cjs/hooks/useEntityPageActions.js.map +1 -0
- package/dist/cjs/hooks/useEntityPageMoreActions.js +10 -0
- package/dist/cjs/hooks/useEntityPageMoreActions.js.map +1 -1
- package/dist/cjs/hooks/useNavigateEditEntityAction.js +50 -0
- package/dist/cjs/hooks/useNavigateEditEntityAction.js.map +1 -0
- package/dist/cjs/hooks/useNavigationUtils.js +12 -1
- package/dist/cjs/hooks/useNavigationUtils.js.map +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/docs/action_cell.md +6 -2
- package/dist/docs/app_config_structure.md +48 -6
- package/dist/docs/auto-patterns-guide.md +391 -60
- package/dist/docs/bulk_actions.md +7 -6
- package/dist/docs/collection_page_actions.md +14 -4
- package/dist/docs/custom_overrides.md +86 -15
- package/dist/docs/entity_page.md +65 -1
- package/dist/docs/entity_page_actions.md +13 -11
- package/dist/docs/entity_page_view_actions.md +137 -0
- package/dist/docs/index.md +6 -2
- package/dist/docs/pages_configuration.md +1 -11
- package/dist/docs/sdk_utilities.md +11 -4
- package/dist/docs/wix_fqdn_custom_data_source.md +25 -5
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +9 -201
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +115 -0
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js +33 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +70 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +48 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +3 -0
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +31 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +66 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +109 -0
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/index.js +2 -0
- package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/esm/hooks/useActionCell.js.map +1 -1
- package/dist/esm/hooks/useEntityPageActions.js +82 -0
- package/dist/esm/hooks/useEntityPageActions.js.map +1 -0
- package/dist/esm/hooks/useEntityPageMoreActions.js +11 -1
- package/dist/esm/hooks/useEntityPageMoreActions.js.map +1 -1
- package/dist/esm/hooks/useNavigateEditEntityAction.js +46 -0
- package/dist/esm/hooks/useNavigateEditEntityAction.js.map +1 -0
- package/dist/esm/hooks/useNavigationUtils.js +12 -1
- package/dist/esm/hooks/useNavigationUtils.js.map +1 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts +6 -0
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +11 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +13 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +3 -0
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts +8 -0
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageActions.d.ts +9 -0
- package/dist/types/hooks/useEntityPageActions.d.ts.map +1 -0
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageMoreActions.d.ts +2 -2
- package/dist/types/hooks/useEntityPageMoreActions.d.ts.map +1 -1
- package/dist/types/hooks/useNavigateEditEntityAction.d.ts +6 -0
- package/dist/types/hooks/useNavigateEditEntityAction.d.ts.map +1 -0
- package/dist/types/hooks/useNavigationUtils.d.ts +1 -0
- package/dist/types/hooks/useNavigationUtils.d.ts.map +1 -1
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -5
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +20 -4
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +0 -4
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +24 -5
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -1
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/package.json +15 -15
- 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
|
|
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 {
|
|
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
|
|
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":[]}
|
package/dist/docs/action_cell.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
}[];
|