@wix/auto-patterns 1.38.0 → 1.40.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 (30) hide show
  1. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +72 -18
  2. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +41 -10
  4. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +50 -14
  6. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  7. package/dist/cjs/hooks/useActionCell.js +14 -8
  8. package/dist/cjs/hooks/useActionCell.js.map +1 -1
  9. package/dist/cjs/types/actions/actionCell.js.map +1 -1
  10. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +28 -10
  11. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  12. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +18 -6
  13. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  14. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +16 -6
  15. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  16. package/dist/esm/hooks/useActionCell.js +14 -8
  17. package/dist/esm/hooks/useActionCell.js.map +1 -1
  18. package/dist/esm/types/actions/actionCell.js.map +1 -1
  19. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts +1 -1
  20. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts.map +1 -1
  21. package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
  22. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
  23. package/dist/types/hooks/useActionCell.d.ts.map +1 -1
  24. package/dist/types/types/actions/actionCell.d.ts +13 -1
  25. package/dist/types/types/actions/actionCell.d.ts.map +1 -1
  26. package/mcp-docs/action_cell.md +66 -8
  27. package/mcp-docs/app_config_structure.md +50 -43
  28. package/mcp-docs/auto-patterns-guide.md +116 -51
  29. package/mcp-docs/wix_fqdn_custom_data_source.md +360 -196
  30. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"names":["AutoPatternsTableGridSwitch","AutoPatternsTable","AutoPatternsGrid","SchemaProvider","SkeletonCollection","React","useMemo","AutoPatternsCollectionComponent","_ref","component","index","layout","sharedConfig","memoized","_layout$find","_layout$find2","length","componentToRender","componentType","tableConfig","find","item","type","table","gridConfig","grid","config","createElement","configuration","Fragment","key","collection","collectionId","skeleton"],"sources":["../../../../src/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx"],"sourcesContent":["import { CollectionComponentConfig } from '../../types';\nimport { AutoPatternsTableGridSwitch } from '../AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch';\nimport { AutoPatternsTable } from '../AutoPatternsTable/AutoPatternsTable';\nimport { AutoPatternsGrid } from '../AutoPatternsGrid/AutoPatternsGrid';\nimport { SchemaProvider } from '../../providers';\nimport { SkeletonCollection } from '../AutoPatternsCollectionPageContent/SkeletonCollection';\nimport React, { useMemo } from 'react';\n\nexport const AutoPatternsCollectionComponent = ({\n component,\n index,\n}: {\n component: CollectionComponentConfig;\n index: number;\n}) => {\n const { layout, ...sharedConfig } = component;\n\n const memoized = useMemo(() => {\n if (!layout?.length) {\n return {\n componentToRender: null,\n componentType: 'Table' as 'Table' | 'Grid',\n };\n }\n\n const tableConfig = layout.find((item) => item.type === 'Table')?.table;\n const gridConfig = layout.find((item) => item.type === 'Grid')?.grid;\n\n let componentType: 'Table' | 'Grid' = 'Table';\n let componentToRender: React.ReactNode = null;\n\n if (tableConfig && gridConfig) {\n const config = {\n ...sharedConfig,\n ...tableConfig,\n ...gridConfig,\n };\n componentToRender = (\n <AutoPatternsTableGridSwitch configuration={config} />\n );\n } else if (tableConfig) {\n const config = { ...sharedConfig, ...tableConfig };\n componentToRender = <AutoPatternsTable configuration={config} />;\n } else if (gridConfig) {\n componentType = 'Grid';\n const config = { ...sharedConfig, ...gridConfig };\n componentToRender = <AutoPatternsGrid configuration={config} />;\n }\n\n return { componentToRender, componentType };\n }, [layout, sharedConfig]);\n\n const { componentToRender, componentType } = memoized;\n\n return (\n <>\n {componentToRender ? (\n <SchemaProvider\n key={`${sharedConfig.collection.collectionId}-${index}`}\n collection={sharedConfig.collection}\n skeleton={<SkeletonCollection componentType={componentType} />}\n >\n {componentToRender}\n </SchemaProvider>\n ) : null}\n </>\n );\n};\n"],"mappings":"AACA,SAASA,2BAA2B,QAAQ,4DAA4D;AACxG,SAASC,iBAAiB,QAAQ,wCAAwC;AAC1E,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,kBAAkB,QAAQ,yDAAyD;AAC5F,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,OAAO,MAAMC,+BAA+B,GAAGC,IAAA,IAMzC;EAAA,IAN0C;IAC9CC,SAAS;IACTC;EAIF,CAAC,GAAAF,IAAA;EACC,MAAM;IAAEG,MAAM;IAAE,GAAGC;EAAa,CAAC,GAAGH,SAAS;EAE7C,MAAMI,QAAQ,GAAGP,OAAO,CAAC,MAAM;IAAA,IAAAQ,YAAA,EAAAC,aAAA;IAC7B,IAAI,EAACJ,MAAM,YAANA,MAAM,CAAEK,MAAM,GAAE;MACnB,OAAO;QACLC,iBAAiB,EAAE,IAAI;QACvBC,aAAa,EAAE;MACjB,CAAC;IACH;IAEA,MAAMC,WAAW,IAAAL,YAAA,GAAGH,MAAM,CAACS,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACC,IAAI,KAAK,OAAO,CAAC,qBA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AACmB,UAAU,CAACC,YAAY,IAAItB,KAAK,EAAG;IACxDqB,UAAU,EAAEnB,YAAY,CAACmB,UAAW;IACpCE,QAAQ,eAAE5B,KAAA,CAAAsB,aAAA,CAACvB,kBAAkB;MAACc,aAAa,EAAEA;IAAc,CAAE;EAAE,GAE9DD,iBACa,CAAC,GACf,IACJ,CAAC;AAEP,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","lazy","Suspense","SchemaProvider","SkeletonCollection","AutoPatternsTableGridSwitch","then","module","default","AutoPatternsTable","AutoPatternsGrid","AutoPatternsCollectionComponent","_ref","component","index","layout","sharedConfig","memoized","_layout$find","_layout$find2","length","componentToRender","componentType","tableConfig","find","item","type","table","gridConfig","grid","config","createElement","fallback","configuration","Fragment","key","collection","collectionId","skeleton"],"sources":["../../../../src/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx"],"sourcesContent":["import React, { useMemo, lazy, Suspense } from 'react';\nimport { CollectionComponentConfig } from '../../types';\nimport { SchemaProvider } from '../../providers';\nimport { SkeletonCollection } from '../AutoPatternsCollectionPageContent/SkeletonCollection';\n\nconst AutoPatternsTableGridSwitch = lazy(() =>\n import('../AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch').then(\n (module) => ({ default: module.AutoPatternsTableGridSwitch }),\n ),\n);\nconst AutoPatternsTable = lazy(() =>\n import('../AutoPatternsTable/AutoPatternsTable').then((module) => ({\n default: module.AutoPatternsTable,\n })),\n);\nconst AutoPatternsGrid = lazy(() =>\n import('../AutoPatternsGrid/AutoPatternsGrid').then((module) => ({\n default: module.AutoPatternsGrid,\n })),\n);\n\nexport const AutoPatternsCollectionComponent = ({\n component,\n index,\n}: {\n component: CollectionComponentConfig;\n index: number;\n}) => {\n const { layout, ...sharedConfig } = component;\n\n const memoized = useMemo(() => {\n if (!layout?.length) {\n return {\n componentToRender: null,\n componentType: 'Table' as 'Table' | 'Grid',\n };\n }\n\n const tableConfig = layout.find((item) => item.type === 'Table')?.table;\n const gridConfig = layout.find((item) => item.type === 'Grid')?.grid;\n\n let componentType: 'Table' | 'Grid' = 'Table';\n let componentToRender: React.ReactNode = null;\n\n if (tableConfig && gridConfig) {\n const config = {\n ...sharedConfig,\n ...tableConfig,\n ...gridConfig,\n };\n componentToRender = (\n <Suspense fallback={<SkeletonCollection componentType=\"Table\" />}>\n <AutoPatternsTableGridSwitch configuration={config} />\n </Suspense>\n );\n } else if (tableConfig) {\n const config = { ...sharedConfig, ...tableConfig };\n componentToRender = (\n <Suspense fallback={<SkeletonCollection componentType=\"Table\" />}>\n <AutoPatternsTable configuration={config} />\n </Suspense>\n );\n } else if (gridConfig) {\n componentType = 'Grid';\n const config = { ...sharedConfig, ...gridConfig };\n componentToRender = (\n <Suspense fallback={<SkeletonCollection componentType=\"Grid\" />}>\n <AutoPatternsGrid configuration={config} />\n </Suspense>\n );\n }\n\n return { componentToRender, componentType };\n }, [layout, sharedConfig]);\n\n const { componentToRender, componentType } = memoized;\n\n return (\n <>\n {componentToRender ? (\n <SchemaProvider\n key={`${sharedConfig.collection.collectionId}-${index}`}\n collection={sharedConfig.collection}\n skeleton={<SkeletonCollection componentType={componentType} />}\n >\n {componentToRender}\n </SchemaProvider>\n ) : null}\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAEtD,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,kBAAkB,QAAQ,yDAAyD;AAE5F,MAAMC,2BAA2B,gBAAGJ,IAAI,CAAC,MACvC,MAAM,CAAC,4DAA4D,CAAC,CAACK,IAAI,CACtEC,MAAM,KAAM;EAAEC,OAAO,EAAED,MAAM,CAACF;AAA4B,CAAC,CAC9D,CACF,CAAC;AACD,MAAMI,iBAAiB,gBAAGR,IAAI,CAAC,MAC7B,MAAM,CAAC,wCAAwC,CAAC,CAACK,IAAI,CAAEC,MAAM,KAAM;EACjEC,OAAO,EAAED,MAAM,CA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ACpCE,QAAQ,eAAEvC,KAAA,CAAAgC,aAAA,CAAC3B,kBAAkB;MAACkB,aAAa,EAAEA;IAAc,CAAE;EAAE,GAE9DD,iBACa,CAAC,GACf,IACJ,CAAC;AAEP,CAAC","ignoreList":[]}
@@ -1,15 +1,27 @@
1
- import React from 'react';
2
- import { ViewModeEntityPage } from './ViewModeEntityPage';
3
- import { EditModeEntityPage } from './EditModeEntityPage';
1
+ import React, { lazy, Suspense } from 'react';
2
+ import { SkeletonEntity } from './SkeletonEntity';
3
+ const ViewModeEntityPage = /*#__PURE__*/lazy(() => import('./ViewModeEntityPage').then(module => ({
4
+ default: module.ViewModeEntityPage
5
+ })));
6
+ const EditModeEntityPage = /*#__PURE__*/lazy(() => import('./EditModeEntityPage').then(module => ({
7
+ default: module.EditModeEntityPage
8
+ })));
4
9
  export const AutoPatternsEntityPage = _ref => {
5
10
  let {
6
11
  configuration
7
12
  } = _ref;
8
- return configuration.mode === 'view' ? /*#__PURE__*/React.createElement(ViewModeEntityPage, {
13
+ const fallback = /*#__PURE__*/React.createElement(SkeletonEntity, {
14
+ entityPage: configuration
15
+ });
16
+ return configuration.mode === 'view' ? /*#__PURE__*/React.createElement(Suspense, {
17
+ fallback: fallback
18
+ }, /*#__PURE__*/React.createElement(ViewModeEntityPage, {
9
19
  configuration: configuration
10
- }) : /*#__PURE__*/React.createElement(EditModeEntityPage, {
20
+ })) : /*#__PURE__*/React.createElement(Suspense, {
21
+ fallback: fallback
22
+ }, /*#__PURE__*/React.createElement(EditModeEntityPage, {
11
23
  configuration: configuration
12
- });
24
+ }));
13
25
  };
14
26
 
15
27
  /*
@@ -1 +1 @@
1
- {"version":3,"names":["React","ViewModeEntityPage","EditModeEntityPage","AutoPatternsEntityPage","_ref","configuration","mode","createElement"],"sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"sourcesContent":["import React from 'react';\nimport { EntityPageConfig } from '../../types';\nimport { ViewModeEntityPage } from './ViewModeEntityPage';\nimport { EditModeEntityPage } from './EditModeEntityPage';\n\nexport interface AutoPatternsEntityPageProps {\n configuration: EntityPageConfig;\n}\n\nexport const AutoPatternsEntityPage: React.FC<AutoPatternsEntityPageProps> = ({\n configuration,\n}) => {\n return configuration.mode === 'view' ? (\n <ViewModeEntityPage configuration={configuration} />\n ) : (\n <EditModeEntityPage configuration={configuration} />\n );\n};\n\n/*\n Key structure explanation:\n\n Main cards: main-section-card-{layoutIndex}\n Sidebar cards: sidebar-section-card-{layoutIndex}\n\n Layout content:\n {sectionId}-card-{cardIndex}-content-{contentIndex}\n\n Nested children:\n {sectionId}-card-{cardIndex}-content-{parentContentIndex}-level-{level}-child-{childIndex}\n\n This ensures uniqueness across all levels and sections.\n*/\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,kBAAkB,QAAQ,sBAAsB;AAMzD,OAAO,MAAMC,sBAA6D,GAAGC,IAAA,IAEvE;EAAA,IAFwE;IAC5EC;EACF,CAAC,GAAAD,IAAA;EACC,OAAOC,aAAa,CAACC,IAAI,KAAK,MAAM,gBAClCN,KAAA,CAAAO,aAAA,CAACN,kBAAkB;IAACI,aAAa,EAAEA;EAAc,CAAE,CAAC,gBAEpDL,KAAA,CAAAO,aAAA,CAACL,kBAAkB;IAACG,aAAa,EAAEA;EAAc,CAAE,CACpD;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["React","lazy","Suspense","SkeletonEntity","ViewModeEntityPage","then","module","default","EditModeEntityPage","AutoPatternsEntityPage","_ref","configuration","fallback","createElement","entityPage","mode"],"sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { EntityPageConfig } from '../../types';\nimport { SkeletonEntity } from './SkeletonEntity';\n\nconst ViewModeEntityPage = lazy(() =>\n import('./ViewModeEntityPage').then((module) => ({\n default: module.ViewModeEntityPage,\n })),\n);\nconst EditModeEntityPage = lazy(() =>\n import('./EditModeEntityPage').then((module) => ({\n default: module.EditModeEntityPage,\n })),\n);\n\nexport interface AutoPatternsEntityPageProps {\n configuration: EntityPageConfig;\n}\n\nexport const AutoPatternsEntityPage: React.FC<AutoPatternsEntityPageProps> = ({\n configuration,\n}) => {\n const fallback = <SkeletonEntity entityPage={configuration} />;\n\n return configuration.mode === 'view' ? (\n <Suspense fallback={fallback}>\n <ViewModeEntityPage configuration={configuration} />\n </Suspense>\n ) : (\n <Suspense fallback={fallback}>\n <EditModeEntityPage configuration={configuration} />\n </Suspense>\n );\n};\n\n/*\n Key structure explanation:\n\n Main cards: main-section-card-{layoutIndex}\n Sidebar cards: sidebar-section-card-{layoutIndex}\n\n Layout content:\n {sectionId}-card-{cardIndex}-content-{contentIndex}\n\n Nested children:\n {sectionId}-card-{cardIndex}-content-{parentContentIndex}-level-{level}-child-{childIndex}\n\n This ensures uniqueness across all levels and sections.\n*/\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,MAAMC,kBAAkB,gBAAGH,IAAI,CAAC,MAC9B,MAAM,CAAC,sBAAsB,CAAC,CAACI,IAAI,CAAEC,MAAM,KAAM;EAC/CC,OAAO,EAAED,MAAM,CAACF;AAClB,CAAC,CAAC,CACJ,CAAC;AACD,MAAMI,kBAAkB,gBAAGP,IAAI,CAAC,MAC9B,MAAM,CAAC,sBAAsB,CAAC,CAACI,IAAI,CAAEC,MAAM,KAAM;EAC/CC,OAAO,EAAED,MAAM,CAACE;AAClB,CAAC,CAAC,CACJ,CAAC;AAMD,OAAO,MAAMC,sBAA6D,GAAGC,IAAA,IAEvE;EAAA,IAFwE;IAC5EC;EACF,CAAC,GAAAD,IAAA;EACC,MAAME,QAAQ,gBAAGZ,KAAA,CAAAa,aAAA,CAACV,cAAc;IAACW,UAAU,EAAEH;EAAc,CAAE,CAAC;EAE9D,OAAOA,aAAa,CAACI,IAAI,KAAK,MAAM,gBAClCf,KAAA,CAAAa,aAAA,CAACX,QAAQ;IAACU,QAAQ,EAAEA;EAAS,gBAC3BZ,KAAA,CAAAa,aAAA,CAACT,kBAAkB;IAACO,aAAa,EAAEA;EAAc,CAAE,CAC3C,CAAC,gBAEXX,KAAA,CAAAa,aAAA,CAACX,QAAQ;IAACU,QAAQ,EAAEA;EAAS,gBAC3BZ,KAAA,CAAAa,aAAA,CAACL,kBAAkB;IAACG,aAAa,EAAEA;EAAc,CAAE,CAC3C,CACX;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,8 +1,12 @@
1
- import React from 'react';
2
- import { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';
3
- import { AutoPatternsEntityPage } from '../AutoPatternsEntityPage';
1
+ import React, { lazy, Suspense } from 'react';
4
2
  import { SchemaProvider } from '../../providers/SchemaContext';
5
3
  import { SkeletonEntity } from '../AutoPatternsEntityPage/SkeletonEntity';
4
+ const AutoPatternsCollectionPage = /*#__PURE__*/lazy(() => import('../AutoPatternsCollectionPage').then(module => ({
5
+ default: module.AutoPatternsCollectionPage
6
+ })));
7
+ const AutoPatternsEntityPage = /*#__PURE__*/lazy(() => import('../AutoPatternsEntityPage').then(module => ({
8
+ default: module.AutoPatternsEntityPage
9
+ })));
6
10
  export const AutoPatternsPage = _ref => {
7
11
  let {
8
12
  pageConfig
@@ -15,9 +19,11 @@ export const AutoPatternsPage = _ref => {
15
19
  switch (type) {
16
20
  case 'collectionPage':
17
21
  if (collectionPage) {
18
- return /*#__PURE__*/React.createElement(AutoPatternsCollectionPage, {
22
+ return /*#__PURE__*/React.createElement(Suspense, {
23
+ fallback: /*#__PURE__*/React.createElement("div", null)
24
+ }, /*#__PURE__*/React.createElement(AutoPatternsCollectionPage, {
19
25
  configuration: collectionPage
20
- });
26
+ }));
21
27
  }
22
28
  break;
23
29
  case 'entityPage':
@@ -27,9 +33,13 @@ export const AutoPatternsPage = _ref => {
27
33
  skeleton: /*#__PURE__*/React.createElement(SkeletonEntity, {
28
34
  entityPage: entityPage
29
35
  })
36
+ }, /*#__PURE__*/React.createElement(Suspense, {
37
+ fallback: /*#__PURE__*/React.createElement(SkeletonEntity, {
38
+ entityPage: entityPage
39
+ })
30
40
  }, /*#__PURE__*/React.createElement(AutoPatternsEntityPage, {
31
41
  configuration: entityPage
32
- }));
42
+ })));
33
43
  }
34
44
  break;
35
45
  default:
@@ -1 +1 @@
1
- {"version":3,"names":["React","AutoPatternsCollectionPage","AutoPatternsEntityPage","SchemaProvider","SkeletonEntity","AutoPatternsPage","_ref","pageConfig","type","collectionPage","entityPage","createElement","configuration","collection","skeleton"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"sourcesContent":["import React from 'react';\nimport { PageConfig } from '../../types';\nimport { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';\nimport { AutoPatternsEntityPage } from '../AutoPatternsEntityPage';\nimport { SchemaProvider } from '../../providers/SchemaContext';\nimport { SkeletonEntity } from '../AutoPatternsEntityPage/SkeletonEntity';\n\nexport interface AutoPatternsPageProps {\n pageConfig: PageConfig;\n}\n\nexport const AutoPatternsPage = ({ pageConfig }: AutoPatternsPageProps) => {\n const { type, collectionPage, entityPage } = pageConfig;\n\n switch (type) {\n case 'collectionPage':\n if (collectionPage) {\n return <AutoPatternsCollectionPage configuration={collectionPage} />;\n }\n break;\n case 'entityPage':\n if (entityPage) {\n return (\n <SchemaProvider\n collection={entityPage}\n skeleton={<SkeletonEntity entityPage={entityPage} />}\n >\n <AutoPatternsEntityPage configuration={entityPage} />\n </SchemaProvider>\n );\n }\n break;\n default:\n break;\n }\n\n return null;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,0BAA0B,QAAQ,+BAA+B;AAC1E,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,cAAc,QAAQ,0CAA0C;AAMzE,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAA2C;EAAA,IAA1C;IAAEC;EAAkC,CAAC,GAAAD,IAAA;EACpE,MAAM;IAAEE,IAAI;IAAEC,cAAc;IAAEC;EAAW,CAAC,GAAGH,UAAU;EAEvD,QAAQC,IAAI;IACV,KAAK,gBAAgB;MACnB,IAAIC,cAAc,EAAE;QAClB,oBAAOT,KAAA,CAAAW,aAAA,CAACV,0BAA0B;UAACW,aAAa,EAAEH;QAAe,CAAE,CAAC;MACtE;MACA;IACF,KAAK,YAAY;MACf,IAAIC,UAAU,EAAE;QACd,oBACEV,KAAA,CAAAW,aAAA,CAACR,cAAc;UACbU,UAAU,EAAEH,UAAW;UACvBI,QAAQ,eAAEd,KAAA,CAAAW,aAAA,CAACP,cAAc;YAACM,UAAU,EAAEA;UAAW,CAAE;QAAE,gBAErDV,KAAA,CAAAW,aAAA,CAACT,sBAAsB;UAACU,aAAa,EAAEF;QAAW,CAAE,CACtC,CAAC;MAErB;MACA;IACF;MACE;EACJ;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","lazy","Suspense","SchemaProvider","SkeletonEntity","AutoPatternsCollectionPage","then","module","default","AutoPatternsEntityPage","AutoPatternsPage","_ref","pageConfig","type","collectionPage","entityPage","createElement","fallback","configuration","collection","skeleton"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { PageConfig } from '../../types';\nimport { SchemaProvider } from '../../providers/SchemaContext';\nimport { SkeletonEntity } from '../AutoPatternsEntityPage/SkeletonEntity';\n\nconst AutoPatternsCollectionPage = lazy(() =>\n import('../AutoPatternsCollectionPage').then((module) => ({\n default: module.AutoPatternsCollectionPage,\n })),\n);\nconst AutoPatternsEntityPage = lazy(() =>\n import('../AutoPatternsEntityPage').then((module) => ({\n default: module.AutoPatternsEntityPage,\n })),\n);\n\nexport interface AutoPatternsPageProps {\n pageConfig: PageConfig;\n}\n\nexport const AutoPatternsPage = ({ pageConfig }: AutoPatternsPageProps) => {\n const { type, collectionPage, entityPage } = pageConfig;\n\n switch (type) {\n case 'collectionPage':\n if (collectionPage) {\n return (\n <Suspense fallback={<div />}>\n <AutoPatternsCollectionPage configuration={collectionPage} />\n </Suspense>\n );\n }\n break;\n case 'entityPage':\n if (entityPage) {\n return (\n <SchemaProvider\n collection={entityPage}\n skeleton={<SkeletonEntity entityPage={entityPage} />}\n >\n <Suspense fallback={<SkeletonEntity entityPage={entityPage} />}>\n <AutoPatternsEntityPage configuration={entityPage} />\n </Suspense>\n </SchemaProvider>\n );\n }\n break;\n default:\n break;\n }\n\n return null;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,cAAc,QAAQ,0CAA0C;AAEzE,MAAMC,0BAA0B,gBAAGJ,IAAI,CAAC,MACtC,MAAM,CAAC,+BAA+B,CAAC,CAACK,IAAI,CAAEC,MAAM,KAAM;EACxDC,OAAO,EAAED,MAAM,CAACF;AAClB,CAAC,CAAC,CACJ,CAAC;AACD,MAAMI,sBAAsB,gBAAGR,IAAI,CAAC,MAClC,MAAM,CAAC,2BAA2B,CAAC,CAACK,IAAI,CAAEC,MAAM,KAAM;EACpDC,OAAO,EAAED,MAAM,CAACE;AAClB,CAAC,CAAC,CACJ,CAAC;AAMD,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAA2C;EAAA,IAA1C;IAAEC;EAAkC,CAAC,GAAAD,IAAA;EACpE,MAAM;IAAEE,IAAI;IAAEC,cAAc;IAAEC;EAAW,CAAC,GAAGH,UAAU;EAEvD,QAAQC,IAAI;IACV,KAAK,gBAAgB;MACnB,IAAIC,cAAc,EAAE;QAClB,oBACEd,KAAA,CAAAgB,aAAA,CAACd,QAAQ;UAACe,QAAQ,eAAEjB,KAAA,CAAAgB,aAAA,YAAM;QAAE,gBAC1BhB,KAAA,CAAAgB,aAAA,CAACX,0BAA0B;UAACa,aAAa,EAAEJ;QAAe,CAAE,CACpD,CAAC;MAEf;MACA;IACF,KAAK,YAAY;MACf,IAAIC,UAAU,EAAE;QACd,oBACEf,KAAA,CAAAgB,aAAA,CAACb,cAAc;UACbgB,UAAU,EAAEJ,UAAW;UACvBK,QAAQ,eAAEpB,KAAA,CAAAgB,aAAA,CAACZ,cAAc;YAACW,UAAU,EAAEA;UAAW,CAAE;QAAE,gBAErDf,KAAA,CAAAgB,aAAA,CAACd,QAAQ;UAACe,QAAQ,eAAEjB,KAAA,CAAAgB,aAAA,CAACZ,cAAc;YAACW,UAAU,EAAEA;UAAW,CAAE;QAAE,gBAC7Df,KAAA,CAAAgB,aAAA,CAACP,sBAAsB;UAACS,aAAa,EAAEH;QAAW,CAAE,CAC5C,CACI,CAAC;MAErB;MACA;IACF;MACE;EACJ;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
@@ -17,7 +17,7 @@ export const useActionCell = _ref => {
17
17
  collectionId
18
18
  });
19
19
  const buildCellActions = useCallback((item, index, api) => {
20
- var _config$primaryAction, _config$primaryAction2, _config$secondaryActi, _config$secondaryActi2, _config$secondaryActi3, _config$secondaryActi4;
20
+ var _config$primaryAction, _config$primaryAction2, _config$secondaryActi, _config$secondaryActi2, _config$secondaryActi3, _config$secondaryActi4, _config$primaryAction3;
21
21
  const buildAction = actionConfig => {
22
22
  if (actionConfig.type === 'divider') {
23
23
  return {
@@ -71,7 +71,10 @@ export const useActionCell = _ref => {
71
71
  disabledDescription: resolvedAction.tooltip
72
72
  };
73
73
  };
74
- const primaryAction = config != null && (_config$primaryAction = config.primaryAction) != null && _config$primaryAction.item ? buildAction(config.primaryAction.item) : undefined;
74
+
75
+ // Handle both single primary action and multiple primary actions
76
+ const isMultiplePrimaryActions = 'items' in ((config == null ? void 0 : config.primaryAction) || {});
77
+ const primaryActions = isMultiplePrimaryActions ? (config == null || (_config$primaryAction = config.primaryAction) == null || (_config$primaryAction = _config$primaryAction.items) == null ? void 0 : _config$primaryAction.map(buildAction).filter(Boolean)) || [] : config != null && config.primaryAction && 'item' in config.primaryAction ? [buildAction(config.primaryAction.item)].filter(Boolean) : [];
75
78
  const primaryActionProps = {
76
79
  ...(config != null && (_config$primaryAction2 = config.primaryAction) != null && _config$primaryAction2.alwaysVisible ? {
77
80
  visibility: 'always'
@@ -83,17 +86,20 @@ export const useActionCell = _ref => {
83
86
  const secondaryActions = cleanupActionsWithDividers(rawSecondaryActions, config == null || (_config$secondaryActi2 = config.secondaryActions) == null ? void 0 : _config$secondaryActi2.inlineCount);
84
87
  const numOfVisibleSecondaryActions = config == null || (_config$secondaryActi3 = config.secondaryActions) == null ? void 0 : _config$secondaryActi3.inlineCount;
85
88
  const alwaysShowSecondaryActions = config == null || (_config$secondaryActi4 = config.secondaryActions) == null ? void 0 : _config$secondaryActi4.inlineAlwaysVisible;
86
- if (!primaryAction && !secondaryActions.length) {
89
+ if (!primaryActions.length && !secondaryActions.length) {
87
90
  return {};
88
91
  }
89
92
  return {
90
- ...(primaryAction ? {
91
- primaryAction: {
92
- ...primaryAction,
93
+ ...(primaryActions.length ? {
94
+ primaryAction: primaryActions.map(action => ({
95
+ ...action,
93
96
  ...primaryActionProps
94
- }
97
+ }))
95
98
  } : {
96
- primaryAction: undefined
99
+ primaryAction: []
100
+ }),
101
+ ...(isMultiplePrimaryActions && {
102
+ alwaysShowPrimaryActions: config == null || (_config$primaryAction3 = config.primaryAction) == null ? void 0 : _config$primaryAction3.alwaysVisible
97
103
  }),
98
104
  ...(secondaryActions.length && {
99
105
  secondaryActions
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useActionsSDK","updateAction","customAction","resolveAction","deleteAction","cleanupActionsWithDividers","actions","inlineCount","clean","a","filter","x","i","ar","_ar","divider","length","slice","useActionCell","_ref","config","collectionId","sdk","buildCellActions","item","index","api","_config$primaryAction","_config$primaryAction2","_config$secondaryActi","_config$secondaryActi2","_config$secondaryActi3","_config$secondaryActi4","buildAction","actionConfig","type","actionToResolve","baseParams","actionParams","action","hidden","resolvedAction","label","tooltip","resolvedActionProps","text","disabledDescription","primaryAction","undefined","primaryActionProps","alwaysVisible","visibility","rawSecondaryActions","secondaryActions","items","map","Boolean","numOfVisibleSecondaryActions","alwaysShowSecondaryActions","inlineAlwaysVisible"],"sources":["../../../src/hooks/useActionCell.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n ActionCellConfig,\n ActionCellItemConfig,\n ResolvedAction,\n} from '../types';\nimport { useActionsSDK } from './useActionsSDK';\nimport {\n updateAction,\n customAction,\n resolveAction,\n deleteAction,\n} from '../utils/actions';\nimport { DividerActionConfig } from '../types/actions/base';\n\nexport interface useActionCellParams {\n config?: ActionCellConfig;\n collectionId: string;\n}\n\nconst cleanupActionsWithDividers = (\n actions: any[],\n inlineCount?: number,\n): any[] => {\n const clean = (a: any[]) =>\n a.filter(\n (x, i, ar) =>\n x?.divider !== true ||\n (i > 0 && i < ar.length - 1 && ar[i - 1]?.divider !== true),\n );\n return !actions?.length || !inlineCount || inlineCount >= actions.length\n ? clean(actions || [])\n : [\n ...clean(actions.slice(0, inlineCount)),\n ...clean(actions.slice(inlineCount)),\n ];\n};\n\nexport const useActionCell = ({\n config,\n collectionId,\n}: useActionCellParams) => {\n const sdk = useActionsSDK({\n collectionId,\n });\n\n const buildCellActions = useCallback(\n (item, index, api) => {\n const buildAction = (\n actionConfig: ActionCellItemConfig | DividerActionConfig,\n ) => {\n if (actionConfig.type === 'divider') {\n return { divider: true };\n }\n\n let actionToResolve: Partial<ResolvedAction> | null = null;\n\n const baseParams = {\n actionParams: { item, index, api },\n sdk,\n };\n\n switch (actionConfig.type) {\n case 'update':\n actionToResolve = updateAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n case 'delete':\n actionToResolve = deleteAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n case 'custom':\n actionToResolve = customAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n default:\n return null;\n }\n\n if (!actionToResolve || actionToResolve.hidden) {\n return null;\n }\n\n const resolvedAction = resolveAction(actionConfig, actionToResolve);\n\n const { label, tooltip, hidden, ...resolvedActionProps } =\n resolvedAction;\n\n return {\n ...resolvedActionProps,\n text: resolvedAction.label,\n disabledDescription: resolvedAction.tooltip,\n };\n };\n\n const primaryAction = config?.primaryAction?.item\n ? buildAction(config.primaryAction.item)\n : undefined;\n\n const primaryActionProps = {\n ...(config?.primaryAction?.alwaysVisible\n ? { visibility: 'always' }\n : {}),\n };\n\n const rawSecondaryActions = config?.secondaryActions?.items.length\n ? config.secondaryActions.items.map(buildAction).filter(Boolean)\n : [];\n\n // Process secondary actions with inline count consideration\n const secondaryActions = cleanupActionsWithDividers(\n rawSecondaryActions,\n config?.secondaryActions?.inlineCount,\n );\n\n const numOfVisibleSecondaryActions =\n config?.secondaryActions?.inlineCount;\n const alwaysShowSecondaryActions =\n config?.secondaryActions?.inlineAlwaysVisible;\n\n if (!primaryAction && !secondaryActions.length) {\n return {};\n }\n\n return {\n ...(primaryAction\n ? {\n primaryAction: {\n ...primaryAction,\n ...primaryActionProps,\n },\n }\n : { primaryAction: undefined }),\n ...(secondaryActions.length && { secondaryActions }),\n numOfVisibleSecondaryActions,\n alwaysShowSecondaryActions,\n };\n },\n [config, sdk],\n );\n\n return buildCellActions;\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AAMnC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SACEC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,YAAY,QACP,kBAAkB;AAQzB,MAAMC,0BAA0B,GAAGA,CACjCC,OAAc,EACdC,WAAoB,KACV;EACV,MAAMC,KAAK,GAAIC,CAAQ,IACrB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AAAS,qBAAA,GAANT,MAAM,CAAEiC,gBAAgB,aAAxBxB,qBAAA,CAA0ByB,KAAK,CAACtC,MAAM,GAC9DI,MAAM,CAACiC,gBAAgB,CAACC,KAAK,CAACC,GAAG,CAACtB,WAAW,CAAC,CAACvB,MAAM,CAAC8C,OAAO,CAAC,GAC9D,EAAE;;IAEN;IACA,MAAMH,gBAAgB,GAAGhD,0BAA0B,CACjD+C,mBAAmB,EACnBhC,MAAM,aAAAU,sBAAA,GAANV,MAAM,CAAEiC,gBAAgB,qBAAxBvB,sBAAA,CAA0BvB,WAC5B,CAAC;IAED,MAAMkD,4BAA4B,GAChCrC,MAAM,aAAAW,sBAAA,GAANX,MAAM,CAAEiC,gBAAgB,qBAAxBtB,sBAAA,CAA0BxB,WAAW;IACvC,MAAMmD,0BAA0B,GAC9BtC,MAAM,aAAAY,sBAAA,GAANZ,MAAM,CAAEiC,gBAAgB,qBAAxBrB,sBAAA,CAA0B2B,mBAAmB;IAE/C,IAAI,CAACZ,aAAa,IAAI,CAACM,gBAAgB,CAACrC,MAAM,EAAE;MAC9C,OAAO,CAAC,CAAC;IACX;IAEA,OAAO;MACL,IAAI+B,aAAa,GACb;QACEA,aAAa,EAAE;UACb,GAAGA,aAAa;UAChB,GAAGE;QACL;MACF,CAAC,GACD;QAAEF,aAAa,EAAEC;MAAU,CAAC,CAAC;MACjC,IAAIK,gBAAgB,CAACrC,MAAM,IAAI;QAAEqC;MAAiB,CAAC,CAAC;MACpDI,4BAA4B;MAC5BC;IACF,CAAC;EACH,CAAC,EACD,CAACtC,MAAM,EAAEE,GAAG,CACd,CAAC;EAED,OAAOC,gBAAgB;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useActionsSDK","updateAction","customAction","resolveAction","deleteAction","cleanupActionsWithDividers","actions","inlineCount","clean","a","filter","x","i","ar","_ar","divider","length","slice","useActionCell","_ref","config","collectionId","sdk","buildCellActions","item","index","api","_config$primaryAction","_config$primaryAction2","_config$secondaryActi","_config$secondaryActi2","_config$secondaryActi3","_config$secondaryActi4","_config$primaryAction3","buildAction","actionConfig","type","actionToResolve","baseParams","actionParams","action","hidden","resolvedAction","label","tooltip","resolvedActionProps","text","disabledDescription","isMultiplePrimaryActions","primaryAction","primaryActions","items","map","Boolean","primaryActionProps","alwaysVisible","visibility","rawSecondaryActions","secondaryActions","numOfVisibleSecondaryActions","alwaysShowSecondaryActions","inlineAlwaysVisible","alwaysShowPrimaryActions"],"sources":["../../../src/hooks/useActionCell.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n ActionCellConfig,\n ActionCellItemConfig,\n ActionCellPrimaryActions,\n ResolvedAction,\n} from '../types';\nimport { useActionsSDK } from './useActionsSDK';\nimport {\n updateAction,\n customAction,\n resolveAction,\n deleteAction,\n} from '../utils/actions';\nimport { DividerActionConfig } from '../types/actions/base';\n\nexport interface useActionCellParams {\n config?: ActionCellConfig;\n collectionId: string;\n}\n\nconst cleanupActionsWithDividers = (\n actions: any[],\n inlineCount?: number,\n): any[] => {\n const clean = (a: any[]) =>\n a.filter(\n (x, i, ar) =>\n x?.divider !== true ||\n (i > 0 && i < ar.length - 1 && ar[i - 1]?.divider !== true),\n );\n return !actions?.length || !inlineCount || inlineCount >= actions.length\n ? clean(actions || [])\n : [\n ...clean(actions.slice(0, inlineCount)),\n ...clean(actions.slice(inlineCount)),\n ];\n};\n\nexport const useActionCell = ({\n config,\n collectionId,\n}: useActionCellParams) => {\n const sdk = useActionsSDK({\n collectionId,\n });\n\n const buildCellActions = useCallback(\n (item, index, api) => {\n const buildAction = (\n actionConfig: ActionCellItemConfig | DividerActionConfig,\n ) => {\n if (actionConfig.type === 'divider') {\n return { divider: true };\n }\n\n let actionToResolve: Partial<ResolvedAction> | null = null;\n\n const baseParams = {\n actionParams: { item, index, api },\n sdk,\n };\n\n switch (actionConfig.type) {\n case 'update':\n actionToResolve = updateAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n case 'delete':\n actionToResolve = deleteAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n case 'custom':\n actionToResolve = customAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n\n default:\n return null;\n }\n\n if (!actionToResolve || actionToResolve.hidden) {\n return null;\n }\n\n const resolvedAction = resolveAction(actionConfig, actionToResolve);\n\n const { label, tooltip, hidden, ...resolvedActionProps } =\n resolvedAction;\n\n return {\n ...resolvedActionProps,\n text: resolvedAction.label,\n disabledDescription: resolvedAction.tooltip,\n };\n };\n\n // Handle both single primary action and multiple primary actions\n const isMultiplePrimaryActions = 'items' in (config?.primaryAction || {});\n\n const primaryActions = isMultiplePrimaryActions\n ? (config?.primaryAction as ActionCellPrimaryActions)?.items\n ?.map(buildAction)\n .filter(Boolean) || []\n : config?.primaryAction && 'item' in config.primaryAction\n ? [buildAction(config.primaryAction.item)].filter(Boolean)\n : [];\n\n const primaryActionProps = {\n ...(config?.primaryAction?.alwaysVisible\n ? { visibility: 'always' }\n : {}),\n };\n\n const rawSecondaryActions = config?.secondaryActions?.items.length\n ? config.secondaryActions.items.map(buildAction).filter(Boolean)\n : [];\n\n // Process secondary actions with inline count consideration\n const secondaryActions = cleanupActionsWithDividers(\n rawSecondaryActions,\n config?.secondaryActions?.inlineCount,\n );\n\n const numOfVisibleSecondaryActions =\n config?.secondaryActions?.inlineCount;\n const alwaysShowSecondaryActions =\n config?.secondaryActions?.inlineAlwaysVisible;\n\n if (!primaryActions.length && !secondaryActions.length) {\n return {};\n }\n\n return {\n ...(primaryActions.length\n ? {\n primaryAction: primaryActions.map((action: any) => ({\n ...action,\n ...primaryActionProps,\n })),\n }\n : { primaryAction: [] }),\n ...(isMultiplePrimaryActions && {\n alwaysShowPrimaryActions: config?.primaryAction?.alwaysVisible,\n }),\n ...(secondaryActions.length && { secondaryActions }),\n numOfVisibleSecondaryActions,\n alwaysShowSecondaryActions,\n };\n },\n [config, sdk],\n );\n\n return buildCellActions;\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AA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C0C,gBAAgB,CAAC1C,MAAM,EAAE;MACtD,OAAO,CAAC,CAAC;IACX;IAEA,OAAO;MACL,IAAIkC,cAAc,CAAClC,MAAM,GACrB;QACEiC,aAAa,EAAEC,cAAc,CAACE,GAAG,CAAEZ,MAAW,KAAM;UAClD,GAAGA,MAAM;UACT,GAAGc;QACL,CAAC,CAAC;MACJ,CAAC,GACD;QAAEL,aAAa,EAAE;MAAG,CAAC,CAAC;MAC1B,IAAID,wBAAwB,IAAI;QAC9Bc,wBAAwB,EAAE1C,MAAM,aAAAa,sBAAA,GAANb,MAAM,CAAE6B,aAAa,qBAArBhB,sBAAA,CAAuBsB;MACnD,CAAC,CAAC;MACF,IAAIG,gBAAgB,CAAC1C,MAAM,IAAI;QAAE0C;MAAiB,CAAC,CAAC;MACpDC,4BAA4B;MAC5BC;IACF,CAAC;EACH,CAAC,EACD,CAACxC,MAAM,EAAEE,GAAG,CACd,CAAC;EAED,OAAOC,gBAAgB;AACzB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n /**\n * The action item configuration.\n */\n item: ActionCellItemConfig;\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n /**\n * Array of action items and dividers for the secondary actions menu.\n */\n items: (ActionCellItemConfig | DividerActionConfig)[];\n /**\n * Number of secondary actions to show inline before moving to overflow menu.\n * Remaining actions appear in a \"more actions\" dropdown.\n * @default 0 (all actions in dropdown)\n */\n inlineCount?: number;\n /**\n * Whether inline secondary actions should always be visible.\n * If true, the inline actions are always visible; if false, they are visible only when hovering the row.\n * @default false\n */\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n /**\n * Primary action configuration.\n * Shown as the main action button in each row.\n */\n primaryAction?: ActionCellPrimaryAction;\n /**\n * Secondary actions configuration.\n * Shown as additional actions in dropdown or inline.\n */\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n /**\n * Icon displayed before the action label.\n */\n prefixIcon?: IconElement;\n /**\n * Icon displayed after the action label.\n */\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n /**\n * The data item (row) that the action is being performed on.\n */\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n /**\n * Action parameters including the row item context.\n */\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n /**\n * The action item configuration.\n */\n item: ActionCellItemConfig;\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellPrimaryActions {\n /**\n * The action items configuration.\n */\n items: ActionCellItemConfig[];\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n /**\n * Array of action items and dividers for the secondary actions menu.\n */\n items: (ActionCellItemConfig | DividerActionConfig)[];\n /**\n * Number of secondary actions to show inline before moving to overflow menu.\n * Remaining actions appear in a \"more actions\" dropdown.\n * @default 0 (all actions in dropdown)\n */\n inlineCount?: number;\n /**\n * Whether inline secondary actions should always be visible.\n * If true, the inline actions are always visible; if false, they are visible only when hovering the row.\n * @default false\n */\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n /**\n * Primary action configuration.\n * Shown as the main action button in each row.\n */\n primaryAction?: ActionCellPrimaryAction | ActionCellPrimaryActions;\n /**\n * Secondary actions configuration.\n * Shown as additional actions in dropdown or inline.\n */\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n /**\n * Icon displayed before the action label.\n */\n prefixIcon?: IconElement;\n /**\n * Icon displayed after the action label.\n */\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n /**\n * The data item (row) that the action is being performed on.\n */\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n /**\n * Action parameters including the row item context.\n */\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { CollectionComponentConfig } from '../../types';
2
1
  import React from 'react';
2
+ import { CollectionComponentConfig } from '../../types';
3
3
  export declare const AutoPatternsCollectionComponent: ({ component, index, }: {
4
4
  component: CollectionComponentConfig;
5
5
  index: number;
@@ -1 +1 @@
1
- {"version":3,"file":"AutoPatternsCollectionComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAMxD,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,eAAO,MAAM,+BAA+B,GAAI,uBAG7C;IACD,SAAS,EAAE,yBAAyB,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf,sBAqDA,CAAC"}
1
+ {"version":3,"file":"AutoPatternsCollectionComponent.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAoBxD,eAAO,MAAM,+BAA+B,GAAI,uBAG7C;IACD,SAAS,EAAE,yBAAyB,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf,sBA+DA,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutoPatternsEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAQxE,CAAC"}
1
+ {"version":3,"file":"AutoPatternsEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAc/C,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAcxE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutoPatternsPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,qBAAqB,6BA0BrE,CAAC"}
1
+ {"version":3,"file":"AutoPatternsPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAezC,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,qBAAqB,6BAgCrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useActionCell.d.ts","sourceRoot":"","sources":["../../../src/hooks/useActionCell.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAUlB,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAoBD,eAAO,MAAM,aAAa,GAAI,2BAG3B,mBAAmB,4CA8GrB,CAAC"}
1
+ {"version":3,"file":"useActionCell.d.ts","sourceRoot":"","sources":["../../../src/hooks/useActionCell.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAIjB,MAAM,UAAU,CAAC;AAUlB,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAoBD,eAAO,MAAM,aAAa,GAAI,2BAG3B,mBAAmB,4CAwHrB,CAAC"}
@@ -14,6 +14,18 @@ export interface ActionCellPrimaryAction {
14
14
  */
15
15
  alwaysVisible?: boolean;
16
16
  }
17
+ export interface ActionCellPrimaryActions {
18
+ /**
19
+ * The action items configuration.
20
+ */
21
+ items: ActionCellItemConfig[];
22
+ /**
23
+ * Whether the primary action should always be visible.
24
+ * If true, the action is always visible; if false, it is visible only when hovering the row.
25
+ * @default false
26
+ */
27
+ alwaysVisible?: boolean;
28
+ }
17
29
  export interface ActionCellSecondaryActions {
18
30
  /**
19
31
  * Array of action items and dividers for the secondary actions menu.
@@ -37,7 +49,7 @@ export interface ActionCellConfig {
37
49
  * Primary action configuration.
38
50
  * Shown as the main action button in each row.
39
51
  */
40
- primaryAction?: ActionCellPrimaryAction;
52
+ primaryAction?: ActionCellPrimaryAction | ActionCellPrimaryActions;
41
53
  /**
42
54
  * Secondary actions configuration.
43
55
  * Shown as additional actions in dropdown or inline.
@@ -1 +1 @@
1
- {"version":3,"file":"actionCell.d.ts","sourceRoot":"","sources":["../../../../src/types/actions/actionCell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,oBAAoB,GAC5B,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,KAAK,EAAE,CAAC,oBAAoB,GAAG,mBAAmB,CAAC,EAAE,CAAC;IACtD;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C;AAED,MAAM,WAAW,+BACf,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,MAAM,4BAA4B,GACtC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;AAE7C,MAAM,MAAM,qCAAqC,GAAG,CAClD,MAAM,EAAE,4BAA4B,KACjC,+BAA+B,CAAC;AAErC,MAAM,MAAM,uCAAuC,GAAG,CACpD,MAAM,EAAE,4BAA4B,KACjC,cAAc,CAAC;AAEpB,MAAM,WAAW,gCACf,SAAQ,sBAAsB;IAC9B;;OAEG;IACH,YAAY,EAAE,sBAAsB,CAAC;CACtC"}
1
+ {"version":3,"file":"actionCell.d.ts","sourceRoot":"","sources":["../../../../src/types/actions/actionCell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAC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,MAAM,MAAM,uCAAuC,GAAG,CACpD,MAAM,EAAE,4BAA4B,KACjC,cAAc,CAAC;AAEpB,MAAM,WAAW,gCACf,SAAQ,sBAAsB;IAC9B;;OAEG;IACH,YAAY,EAAE,sBAAsB,CAAC;CACtC"}
@@ -4,12 +4,54 @@ The ActionCell feature adds an interactive action column to collection tables or
4
4
 
5
5
  ## Placement and Structure
6
6
 
7
- The ActionCell has a two-level structure:
8
- * `primaryAction`: A single prominent action shown directly in the table/grid row
7
+ The ActionCell has a flexible structure supporting both single and multiple primary actions:
8
+ * `primaryAction`: Type: `ActionCellPrimaryAction | ActionCellPrimaryActions` - Can be either a single action or multiple actions shown directly in the table/grid row
9
+ - **Single Primary Action** (`ActionCellPrimaryAction`): `{ item: ActionCellItemConfig, alwaysVisible?: boolean }`
10
+ - **Multiple Primary Actions** (`ActionCellPrimaryActions`): `{ items: ActionCellItemConfig[], alwaysVisible?: boolean }`
9
11
  * `secondaryActions`: Additional actions shown in a dropdown menu
10
12
 
11
13
  Both properties are optional, but at least one should be provided for the ActionCell to be useful.
12
14
 
15
+ ### Multiple Primary Actions
16
+
17
+ **New Feature**: Primary actions now support both single and multiple action configurations:
18
+
19
+ #### Single Primary Action Configuration
20
+ ```json
21
+ {
22
+ "primaryAction": {
23
+ "item": {
24
+ "id": "editItem",
25
+ "type": "update",
26
+ "label": "Edit",
27
+ "biName": "edit-item-action"
28
+ },
29
+ "alwaysVisible": false
30
+ }
31
+ }
32
+ ```
33
+
34
+ #### Multiple Primary Actions Configuration
35
+ ```json
36
+ {
37
+ "primaryAction": {
38
+ "items": [
39
+ {
40
+ "id": "editItem",
41
+ "type": "update",
42
+ "label": "Edit"
43
+ },
44
+ {
45
+ "id": "quickApprove",
46
+ "type": "custom",
47
+ "label": "Approve"
48
+ }
49
+ ],
50
+ "alwaysVisible": true
51
+ }
52
+ }
53
+ ```
54
+
13
55
  ### Primary Action Visibility Control
14
56
 
15
57
  **New Feature**: Primary actions now support visibility control through the `alwaysVisible` property. By default, primary actions follow standard table interaction patterns (typically visible on hover), but you can configure them to be always visible for improved accessibility and user discovery.
@@ -277,25 +319,37 @@ Follow this decision process when implementing ActionCell:
277
319
  - Delete entities? → Use `delete` actions
278
320
  - Custom operations? → Use `custom` actions
279
321
 
280
- 2. **Primary vs Secondary**: Choose the most common/important action as primary:
281
- - Most common operation (typically Edit) → Place in `primaryAction.item`
322
+ 2. **Primary vs Secondary**: Choose the most common/important actions as primary:
323
+ - **Single Primary Action**: Most common operation (typically Edit) → Place in `primaryAction.item`
324
+ - **Multiple Primary Actions**: 2-3 most common operations → Place in `primaryAction.items` array
282
325
  - Less common operations → Place in `secondaryActions.items` array
283
326
 
284
- 3. **Primary Action Visibility Strategy**:
327
+ 3. **Single vs Multiple Primary Actions**:
328
+ - **Use Single Primary Action** when:
329
+ - You have one dominant action (e.g., "Edit" for most entities)
330
+ - Space is limited or you want a clean, minimal interface
331
+ - The action is contextually obvious
332
+ - **Use Multiple Primary Actions** when:
333
+ - You have 2-3 equally important actions (e.g., "Edit", "Approve", "Reject")
334
+ - Users frequently need to perform multiple actions in sequence
335
+ - Actions are complementary and often used together
336
+ - You want to reduce clicks by avoiding secondary menus
337
+
338
+ 4. **Primary Action Visibility Strategy**:
285
339
  - **Standard Visibility** (`alwaysVisible: false` or omitted): Use for most cases where actions appear on interaction
286
340
  - **Always Visible** (`alwaysVisible: true`): Use for critical actions that need constant visibility or when user discovery is important
287
341
 
288
- 4. **Inline Secondary Actions Strategy**:
342
+ 5. **Inline Secondary Actions Strategy**:
289
343
  - **Action Prioritization**: Order `secondaryActions.items` by frequency of use (most used first)
290
344
  - **Inline Count**: Use `inlineCount: 1-3` for optimal UX (avoid cluttering)
291
345
  - **Visibility Control**:
292
346
  - Use `inlineAlwaysVisible: false` (default) for cleaner visual appearance
293
347
  - Use `inlineAlwaysVisible: true` only for critical actions requiring constant visibility
294
348
 
295
- 5. **Update Action Mode**:
349
+ 6. **Update Action Mode**:
296
350
  - Complex, full-entity edits → Use `mode: "page"` to navigate to entity page
297
351
 
298
- 6. **Custom Implementation**:
352
+ 7. **Custom Implementation**:
299
353
  - For `custom` actions, you must provide implementations in your code and register them with `AutoPatternsOverridesProvider`
300
354
 
301
355
  ### ActionCell Validation Checklist
@@ -309,8 +363,12 @@ AI agents should verify these requirements before generating ActionCell configur
309
363
  ✓ Delete action has a modal configuration
310
364
  ✓ Custom actions match implementations in overrides
311
365
  ✓ At least one of `primaryAction` or `secondaryActions` is provided
366
+ ✓ Primary action configuration is valid (Type: `ActionCellPrimaryAction | ActionCellPrimaryActions`):
367
+ - Single primary action (`ActionCellPrimaryAction`): `{ item: ActionCellItemConfig, alwaysVisible?: boolean }`
368
+ - Multiple primary actions (`ActionCellPrimaryActions`): `{ items: ActionCellItemConfig[], alwaysVisible?: boolean }`
312
369
  ✓ `alwaysVisible` property on primary actions (if specified) is a boolean value
313
370
  ✓ Primary action visibility is properly considered for UX (use `alwaysVisible: true` for critical actions)
371
+ ✓ Multiple primary actions are limited to 2-3 actions for optimal UX
314
372
  ✓ `inlineCount` (if specified) is a non-negative number ≤ total secondary actions count
315
373
  ✓ `inlineAlwaysVisible` (if specified) is a boolean value
316
374
  ✓ Inline secondary actions configuration is applied only when secondary actions exist
@@ -170,52 +170,16 @@ export interface AppConfig {
170
170
  };
171
171
  actionCell?: {
172
172
  primaryAction?: {
173
- item: {
174
- id: string; // Unique identifier for the action
175
- type: 'update' | 'delete' | 'custom'; // Action type
176
- label?: string; // Text displayed for the action
177
- skin?: string; // Visual appearance of the action button (see Action Button Skin Values section)
178
- biName: string; // MANDATORY: Business intelligence name for analytics tracking
179
- disabled?: boolean; // Whether the action is disabled
180
- tooltip?: string; // Tooltip text shown on hover
181
- update?: { // Required when type is 'update'
182
- mode: 'page'; // Update mode
183
- page?: { // Required when mode is 'page'
184
- id: string; // Entity page ID to navigate to
185
- };
186
- };
187
- delete?: { // Required when type is 'delete'
188
- mode: 'modal'; // Currently only 'modal' is supported
189
- modal: {
190
- title?: {
191
- text: string; // Modal title
192
- };
193
- description?: {
194
- text: string; // Modal description
195
- };
196
- actions?: {
197
- submit?: {
198
- text: string; // Submit button text
199
- };
200
- cancel?: {
201
- text: string; // Cancel button text
202
- };
203
- };
204
- feedback?: {
205
- successToast?: {
206
- text: string; // Success message
207
- };
208
- errorToast?: {
209
- text: string; // Error message
210
- };
211
- };
212
- };
213
- };
214
- };
173
+ // Single primary action configuration
174
+ item: ActionItem;
215
175
  alwaysVisible?: boolean; // Whether to always show the primary action (not just on hover)
176
+ } | {
177
+ // Multiple primary actions configuration
178
+ items: ActionItem[];
179
+ alwaysVisible?: boolean; // Whether to always show the primary actions (not just on hover)
216
180
  };
217
181
  secondaryActions?: {
218
- items: {}[]; // Array of action configurations, same structure as primaryAction.item, can include dividers
182
+ items: ActionItem[]; // Array of action configurations, can include dividers
219
183
  inlineCount?: number; // How many secondary actions to show inline before showing popover
220
184
  inlineAlwaysVisible?: boolean; // Whether to always show inline actions (not just on hover)
221
185
  };
@@ -444,6 +408,49 @@ export interface AppConfig {
444
408
  }[];
445
409
  }
446
410
 
411
+ type ActionItem = {
412
+ id: string; // Unique identifier for the action
413
+ type: 'update' | 'delete' | 'custom'; // Action type
414
+ label?: string; // Text displayed for the action
415
+ skin?: string; // Visual appearance of the action button (see Action Button Skin Values section)
416
+ biName: string; // MANDATORY: Business intelligence name for analytics tracking
417
+ disabled?: boolean; // Whether the action is disabled
418
+ tooltip?: string; // Tooltip text shown on hover
419
+ update?: { // Required when type is 'update'
420
+ mode: 'page'; // Update mode
421
+ page?: { // Required when mode is 'page'
422
+ id: string; // Entity page ID to navigate to
423
+ };
424
+ };
425
+ delete?: { // Required when type is 'delete'
426
+ mode: 'modal'; // Currently only 'modal' is supported
427
+ modal: {
428
+ title?: {
429
+ text: string; // Modal title
430
+ };
431
+ description?: {
432
+ text: string; // Modal description
433
+ };
434
+ actions?: {
435
+ submit?: {
436
+ text: string; // Submit button text
437
+ };
438
+ cancel?: {
439
+ text: string; // Cancel button text
440
+ };
441
+ };
442
+ feedback?: {
443
+ successToast?: {
444
+ text: string; // Success message
445
+ };
446
+ errorToast?: {
447
+ text: string; // Error message
448
+ };
449
+ };
450
+ };
451
+ };
452
+ };
453
+
447
454
  type LayoutContent =
448
455
  | {
449
456
  type: 'field';