@wix/auto-patterns 1.32.0 → 1.34.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 (29) hide show
  1. package/dist/cjs/utils/actions/resolveAction.js +2 -2
  2. package/dist/cjs/utils/actions/resolveAction.js.map +1 -1
  3. package/dist/esm/utils/actions/resolveAction.js +2 -2
  4. package/dist/esm/utils/actions/resolveAction.js.map +1 -1
  5. package/dist/types/utils/actions/resolveAction.d.ts +1 -1
  6. package/docs/GETTING_STARTED.md +98 -0
  7. package/docs/OVERVIEW.md +54 -0
  8. package/docs/documentation.yaml +11 -0
  9. package/{dist/docs → mcp-docs}/auto-patterns-guide.md +0 -2
  10. package/package.json +13 -14
  11. /package/{dist/docs → mcp-docs}/action_cell.md +0 -0
  12. /package/{dist/docs → mcp-docs}/app_config_structure.md +0 -0
  13. /package/{dist/docs → mcp-docs}/app_context.md +0 -0
  14. /package/{dist/docs → mcp-docs}/bulk_actions.md +0 -0
  15. /package/{dist/docs → mcp-docs}/collection_page.md +0 -0
  16. /package/{dist/docs → mcp-docs}/collection_page_actions.md +0 -0
  17. /package/{dist/docs → mcp-docs}/custom_overrides.md +0 -0
  18. /package/{dist/docs → mcp-docs}/entity_page.md +0 -0
  19. /package/{dist/docs → mcp-docs}/entity_page_actions.md +0 -0
  20. /package/{dist/docs → mcp-docs}/entity_page_view_actions.md +0 -0
  21. /package/{dist/docs → mcp-docs}/error_handling.md +0 -0
  22. /package/{dist/docs → mcp-docs}/index.md +0 -0
  23. /package/{dist/docs → mcp-docs}/installation.md +0 -0
  24. /package/{dist/docs → mcp-docs}/introduction.md +0 -0
  25. /package/{dist/docs → mcp-docs}/pages_configuration.md +0 -0
  26. /package/{dist/docs → mcp-docs}/resolved_action.md +0 -0
  27. /package/{dist/docs → mcp-docs}/schema_config.md +0 -0
  28. /package/{dist/docs → mcp-docs}/sdk_utilities.md +0 -0
  29. /package/{dist/docs → mcp-docs}/wix_fqdn_custom_data_source.md +0 -0
@@ -6,8 +6,8 @@ const resolveAction = (actionConfig, action) => {
6
6
  return {
7
7
  ...action,
8
8
  label: actionConfig.label ?? action.label,
9
- skin: actionConfig.skin,
10
- biName: actionConfig.biName
9
+ biName: action.biName ?? actionConfig.biName,
10
+ skin: actionConfig.skin
11
11
  };
12
12
  };
13
13
  exports.resolveAction = resolveAction;
@@ -1 +1 @@
1
- {"version":3,"names":["resolveAction","actionConfig","action","label","skin","biName","exports"],"sources":["../../../../src/utils/actions/resolveAction.ts"],"sourcesContent":["import { BaseActionItemConfig, ResolvedAction } from '../../types';\n\nexport const resolveAction = (\n actionConfig: BaseActionItemConfig,\n action: Partial<ResolvedAction>,\n) => {\n return {\n ...action,\n label: actionConfig.label ?? action.label,\n skin: actionConfig.skin,\n biName: actionConfig.biName,\n };\n};\n"],"mappings":";;;;AAEO,MAAMA,aAAa,GAAGA,CAC3BC,YAAkC,EAClCC,MAA+B,KAC5B;EACH,OAAO;IACL,GAAGA,MAAM;IACTC,KAAK,EAAEF,YAAY,CAACE,KAAK,IAAID,MAAM,CAACC,KAAK;IACzCC,IAAI,EAAEH,YAAY,CAACG,IAAI;IACvBC,MAAM,EAAEJ,YAAY,CAACI;EACvB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["resolveAction","actionConfig","action","label","biName","skin","exports"],"sources":["../../../../src/utils/actions/resolveAction.ts"],"sourcesContent":["import { BaseActionItemConfig, ResolvedAction } from '../../types';\n\nexport const resolveAction = (\n actionConfig: BaseActionItemConfig,\n action: Partial<ResolvedAction>,\n) => {\n return {\n ...action,\n label: actionConfig.label ?? action.label,\n biName: action.biName ?? actionConfig.biName,\n skin: actionConfig.skin,\n };\n};\n"],"mappings":";;;;AAEO,MAAMA,aAAa,GAAGA,CAC3BC,YAAkC,EAClCC,MAA+B,KAC5B;EACH,OAAO;IACL,GAAGA,MAAM;IACTC,KAAK,EAAEF,YAAY,CAACE,KAAK,IAAID,MAAM,CAACC,KAAK;IACzCC,MAAM,EAAEF,MAAM,CAACE,MAAM,IAAIH,YAAY,CAACG,MAAM;IAC5CC,IAAI,EAAEJ,YAAY,CAACI;EACrB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -2,8 +2,8 @@ export const resolveAction = (actionConfig, action) => {
2
2
  return {
3
3
  ...action,
4
4
  label: actionConfig.label ?? action.label,
5
- skin: actionConfig.skin,
6
- biName: actionConfig.biName
5
+ biName: action.biName ?? actionConfig.biName,
6
+ skin: actionConfig.skin
7
7
  };
8
8
  };
9
9
  //# sourceMappingURL=resolveAction.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["resolveAction","actionConfig","action","label","skin","biName"],"sources":["../../../../src/utils/actions/resolveAction.ts"],"sourcesContent":["import { BaseActionItemConfig, ResolvedAction } from '../../types';\n\nexport const resolveAction = (\n actionConfig: BaseActionItemConfig,\n action: Partial<ResolvedAction>,\n) => {\n return {\n ...action,\n label: actionConfig.label ?? action.label,\n skin: actionConfig.skin,\n biName: actionConfig.biName,\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,aAAa,GAAGA,CAC3BC,YAAkC,EAClCC,MAA+B,KAC5B;EACH,OAAO;IACL,GAAGA,MAAM;IACTC,KAAK,EAAEF,YAAY,CAACE,KAAK,IAAID,MAAM,CAACC,KAAK;IACzCC,IAAI,EAAEH,YAAY,CAACG,IAAI;IACvBC,MAAM,EAAEJ,YAAY,CAACI;EACvB,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["resolveAction","actionConfig","action","label","biName","skin"],"sources":["../../../../src/utils/actions/resolveAction.ts"],"sourcesContent":["import { BaseActionItemConfig, ResolvedAction } from '../../types';\n\nexport const resolveAction = (\n actionConfig: BaseActionItemConfig,\n action: Partial<ResolvedAction>,\n) => {\n return {\n ...action,\n label: actionConfig.label ?? action.label,\n biName: action.biName ?? actionConfig.biName,\n skin: actionConfig.skin,\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,aAAa,GAAGA,CAC3BC,YAAkC,EAClCC,MAA+B,KAC5B;EACH,OAAO;IACL,GAAGA,MAAM;IACTC,KAAK,EAAEF,YAAY,CAACE,KAAK,IAAID,MAAM,CAACC,KAAK;IACzCC,MAAM,EAAEF,MAAM,CAACE,MAAM,IAAIH,YAAY,CAACG,MAAM;IAC5CC,IAAI,EAAEJ,YAAY,CAACI;EACrB,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  import { BaseActionItemConfig, ResolvedAction } from '../../types';
2
2
  export declare const resolveAction: (actionConfig: BaseActionItemConfig, action: Partial<ResolvedAction>) => {
3
3
  label: string | undefined;
4
- skin: string | undefined;
5
4
  biName: string | undefined;
5
+ skin: string | undefined;
6
6
  icon?: import("@wix/design-system").IconElement | undefined;
7
7
  onClick?: (() => void) | undefined;
8
8
  disabled?: boolean | undefined;
@@ -0,0 +1,98 @@
1
+ # Getting Started
2
+ *Build your first dashboard page on Patterns using Cursor.*
3
+
4
+ ## Library Installations
5
+ Run the following command to install the library and its peer dependencies:
6
+ ```bash
7
+ yarn add @wix/auto-patterns @wix/patterns @wix/design-system react-router-dom
8
+ ```
9
+
10
+ ## MCP Installations
11
+
12
+ * [Install Business Schema MCP in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=business-schema&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAd2l4L2J1c2luZXNzLXNjaGVtYS1tY3AiXX0%3D)
13
+ * [Install Auto Patterns MCP in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=auto-patterns&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAd2l4L2F1dG8tcGF0dGVybnMtbWNwIl19)
14
+
15
+ ## Working with Auto Patterns
16
+ A typical usage of Auto Patterns is to render a `AutoPatternsApp` component with a configuration object. You don't need to do it manually, but generate it through Cursor's chat.
17
+ You can write a prompt like this:
18
+ ```
19
+ I want a dashboard page for sessions, use wix.bookings.v1.sessions fqdn for that.
20
+ ```
21
+
22
+ Then Cursor will retrieve the schema for the `wix.bookings.v1.sessions` FQDN and create an Auto Patterns configuration with custom data source.
23
+
24
+ Then, you can run your app and see the results.
25
+ According to the results, you can ask Cursor to improve the configuration.
26
+ For example, you can ask Cursor to add specific filters, actions, or custom columns.
27
+
28
+ ## Handling Translations
29
+ You should provide translated values everywhere you configure or render text content, just like you do in the rest of your app.
30
+
31
+ Example to properties in the configuration that need a translated content:
32
+ - Page titles
33
+ - Column names
34
+ - Action labels
35
+
36
+ Code Example: (props that are not relevant to translation are omitted)
37
+ ```ts
38
+ import { AppConfig, AutoPatternsApp } from '@wix/auto-patterns';
39
+ import { useTranslation } from 'react-i18next';
40
+
41
+ const MyPage = () => {
42
+ const { t } = useTranslation();
43
+
44
+ const config: AppConfig = {
45
+ pages: [
46
+ {
47
+ id: 'wixPets-collection',
48
+ type: 'collectionPage',
49
+ collectionPage: {
50
+ title: { text: t('pages.pets.title') },
51
+ actions: {
52
+ primaryActions: {
53
+ type: 'action',
54
+ action: {
55
+ item: {
56
+ id: 'createPet',
57
+ label: t('actions.create'),
58
+ type: 'create',
59
+ create: { mode: 'page', page: { id: 'wixPets-entity' } },
60
+ },
61
+ },
62
+ },
63
+ },
64
+ components: [
65
+ {
66
+ type: 'collection',
67
+ entityPageId: 'wixPets-entity',
68
+ layout: [
69
+ {
70
+ type: 'Table',
71
+ table: {
72
+ columns: [
73
+ { id: 'name', name: t('columns.name') },
74
+ { id: 'age', name: t('columns.age') },
75
+ { id: 'owner', name: t('columns.owner') },
76
+ ],
77
+ },
78
+ },
79
+ ],
80
+ },
81
+ ],
82
+ },
83
+ },
84
+ {
85
+ id: 'wixPets-entity',
86
+ type: 'entityPage',
87
+ entityPage: {
88
+ title: { text: t('pages.pets.detailsTitle') },
89
+ },
90
+ },
91
+ ],
92
+ };
93
+
94
+ return <AutoPatternsApp configuration={config} />;
95
+ };
96
+
97
+ export default MyPage;
98
+ ```
@@ -0,0 +1,54 @@
1
+ # Auto Patterns Overview
2
+
3
+ ## What is Auto Patterns?
4
+
5
+ Auto Patterns is our AI-oriented library that lets anyone (Devs, PMs, UX) create rich dashboards with ease using Cursor.
6
+
7
+ ## Key Concepts
8
+
9
+ ### Configuration-Driven Development
10
+ Instead of manually building collection pages, entity forms, and data management interfaces, Auto Patterns allows you to define everything through a TypeScript configuration object that conforms to the `AppConfig` interface. This approach:
11
+
12
+ - Reduces development time
13
+ - Makes experience intuitive and expected
14
+ - Minimizes bugs
15
+ - Simplifies maintenance
16
+
17
+ ### Relationship with @wix/patterns
18
+ Auto Patterns serves as a **configuration layer** on top of `@wix/patterns` by:
19
+
20
+ - **Configuration-driven approach**: Instead of imperatively composing `@wix/patterns` components, you define behavior through TypeScript configuration objects
21
+ - **Pre-built component combinations**: Uses existing `@wix/patterns` components like `CollectionPage`, `Table`, `Grid`, and `EntityPage`, but configures them automatically based on your AppConfig
22
+ - **Simplified integration**: Handles the wiring between `@wix/patterns` components, hooks, and providers so you don't need to set them up manually
23
+ - **Declarative API**: Transforms complex component composition patterns into simple configuration properties
24
+
25
+ ## When to Use Auto Patterns
26
+
27
+ ### Perfect For:
28
+ - **Collection management pages** (lists, tables, grids)
29
+ - **Entity detail/edit pages** (forms, CRUD operations)
30
+ - **Teams standardizing** UI patterns across applications
31
+
32
+ ## Core Components
33
+
34
+ ### AutoPatternsApp
35
+ The main component that renders your entire application based on configuration:
36
+
37
+ ```tsx
38
+ import { AutoPatternsApp } from '@wix/auto-patterns';
39
+ import { config } from './myConfig.patterns';
40
+
41
+ const MyPage = () => (
42
+ <AutoPatternsApp configuration={config} />
43
+ );
44
+ ```
45
+
46
+ ### AppConfig Structure
47
+ The heart of Auto Patterns - a TypeScript configuration that defines:
48
+
49
+ - **Pages**: Collection pages (lists/tables) and entity pages (forms)
50
+ - **Data sources**: FQDN-based Wix entities, Wix Data Collections (CMS) or custom data sources
51
+ - **Actions**: Create, edit, delete, and custom operations
52
+ - **Filters**: Search and filtering capabilities
53
+ - **Layouts**: Table, grid, and form layouts
54
+ - **Customizations**: Column overrides, custom components, and styling
@@ -0,0 +1,11 @@
1
+ apiDoc:
2
+ title: Auto Patterns
3
+ description: Auto Patterns documentation
4
+ category: fe-guild
5
+ markdownOnlyAutoUpdate: true
6
+ gitUrl: https://github.com/wix-private/auto-cairo/
7
+ docs:
8
+ - file: ./GETTING_STARTED.md
9
+ title: Getting Started
10
+ - file: ./OVERVIEW.md
11
+ title: Overview
@@ -4317,5 +4317,3 @@ Before deploying your custom data source, ensure:
4317
4317
  ✅ **External API calls are NOT wrapped** with errorHandler (e.g., fetch(), axios, third-party HTTP clients)
4318
4318
  ✅ **SDK actions are used directly** without error handling (e.g., `sdk.getOptimisticActions()`, `sdk.getSchema()`)
4319
4319
  ✅ **@wix/essentials** is installed as a dependency
4320
-
4321
- ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto-patterns",
3
- "version": "1.32.0",
3
+ "version": "1.34.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Matvey Oklander",
@@ -18,13 +18,14 @@
18
18
  "!dist/**/__tests__",
19
19
  "types",
20
20
  "react",
21
- "form"
21
+ "form",
22
+ "docs",
23
+ "mcp-docs"
22
24
  ],
23
25
  "scripts": {
26
+ "build": "npm run generate-guide && yoshi-library build",
27
+ "start": "npm run generate-guide && yoshi-library start",
24
28
  "generate-guide": "node scripts/generate-guide.js",
25
- "build": "yoshi-library build && npm run generate-guide",
26
- "prestart": "npm run generate-guide",
27
- "start": "yoshi-library start",
28
29
  "test": "yoshi-library test",
29
30
  "test:watch": "yoshi-library test --watch",
30
31
  "lint": "yoshi-library lint",
@@ -35,9 +36,8 @@
35
36
  },
36
37
  "dependencies": {
37
38
  "@babel/runtime": "^7.28.4",
38
- "@wix/data": "^1.0.286",
39
+ "@wix/data": "^1.0.289",
39
40
  "@wix/wix-ui-icons-common": "^3.87.3",
40
- "ejs": "^3.1.10",
41
41
  "lodash": "^4.17.21"
42
42
  },
43
43
  "publishConfig": {
@@ -46,22 +46,21 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@testing-library/react": "^11.2.7",
49
- "@types/ejs": "^3.1.5",
50
49
  "@types/jest": "^27.5.2",
51
50
  "@types/lodash": "^4.17.20",
52
51
  "@types/node": "^16.18.126",
53
52
  "@types/node-fetch": "^2.6.13",
54
53
  "@types/react": "^16.14.66",
55
- "@wix/crm": "^1.0.1008",
54
+ "@wix/crm": "^1.0.1021",
56
55
  "@wix/design-system": "^1.214.3",
57
56
  "@wix/eslint-config-yoshi": "^6.158.0",
58
57
  "@wix/fe-essentials-standalone": "^1.1380.0",
59
58
  "@wix/jest-yoshi-preset": "^6.158.0",
60
- "@wix/patterns": "^1.276.0",
61
- "@wix/sdk": "^1.15.27",
59
+ "@wix/patterns": "^1.277.0",
60
+ "@wix/sdk": "^1.16.0",
62
61
  "@wix/sdk-testkit": ">=0.1.7",
63
- "@wix/wix-data-items-common": "^1.0.234",
64
- "@wix/wix-data-items-sdk": "^1.0.427",
62
+ "@wix/wix-data-items-common": "^1.0.235",
63
+ "@wix/wix-data-items-sdk": "^1.0.428",
65
64
  "@wix/yoshi-flow-library": "^6.158.0",
66
65
  "@wix/yoshi-style-dependencies": "^6.158.0",
67
66
  "chance": "^1.1.13",
@@ -126,5 +125,5 @@
126
125
  "wallaby": {
127
126
  "autoDetect": true
128
127
  },
129
- "falconPackageHash": "8ecc0e67f9ab32e6e355cb56ecdf9861a5bd7727b0f9041221d9ddec"
128
+ "falconPackageHash": "3b95f950e8cf046662d2a6326593abe425912fede0ff9c0711897c1f"
130
129
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes