@contentful/field-editor-validation-errors 1.2.0 → 1.3.1

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/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-validation-errors",
3
- "version": "1.2.0",
4
- "main": "dist/index.js",
5
- "module": "dist/field-editor-validation-errors.esm.js",
6
- "typings": "dist/index.d.ts",
3
+ "version": "1.3.1",
4
+ "main": "dist/cjs/index.js",
5
+ "module": "dist/esm/index.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/types/index.d.ts",
10
+ "require": "./dist/cjs/index.js",
11
+ "default": "./dist/cjs/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
7
15
  "files": [
8
16
  "dist"
9
17
  ],
@@ -14,24 +22,30 @@
14
22
  "url": "https://github.com/contentful/field-editors"
15
23
  },
16
24
  "scripts": {
17
- "watch": "tsdx watch",
18
- "build": "tsdx build",
19
- "test": "tsdx test --env=jsdom --watch",
20
- "test:ci": "tsdx test --env=jsdom --ci",
25
+ "watch": "yarn concurrently \"yarn:watch:*\"",
26
+ "watch:cjs": "yarn build:cjs -w",
27
+ "watch:esm": "yarn build:esm -w",
28
+ "watch:types": "yarn build:types --watch",
29
+ "build": "yarn build:types && yarn build:cjs && yarn build:esm",
30
+ "build:types": "tsc --outDir dist/types --emitDeclarationOnly",
31
+ "build:cjs": "swc src --config-file ../../.swcrc -d dist/cjs -C module.type=commonjs",
32
+ "build:esm": "swc src --config-file ../../.swcrc -d dist/esm",
33
+ "test": "jest --watch",
34
+ "test:ci": "jest --ci",
21
35
  "tsc": "tsc -p ./ --noEmit"
22
36
  },
23
37
  "dependencies": {
24
38
  "@contentful/f36-components": "^4.0.27",
25
39
  "@contentful/f36-icons": "^4.1.0",
26
40
  "@contentful/f36-tokens": "^4.0.0",
27
- "@contentful/field-editor-shared": "^1.2.0",
41
+ "@contentful/field-editor-shared": "^1.3.1",
28
42
  "emotion": "^10.0.17"
29
43
  },
30
44
  "devDependencies": {
31
- "@contentful/field-editor-test-utils": "^1.3.0"
45
+ "@contentful/field-editor-test-utils": "^1.4.1"
32
46
  },
33
47
  "peerDependencies": {
34
48
  "react": ">=16.8.0"
35
49
  },
36
- "gitHead": "de7e74e3485dd69c240cfe9c545e6e50e41fb295"
50
+ "gitHead": "ca904b19ca794a2c40d82e1f7ede9e0be3560f22"
37
51
  }
package/CHANGELOG.md DELETED
@@ -1,204 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [1.2.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.11...@contentful/field-editor-validation-errors@1.2.0) (2023-04-19)
7
-
8
- ### Features
9
-
10
- - upgrade cypress [TOL-1036] ([#1391](https://github.com/contentful/field-editors/issues/1391)) ([9c1aec9](https://github.com/contentful/field-editors/commit/9c1aec98aabbe464cdc3f1236c3bb1cc29b8208d))
11
-
12
- ## [1.1.11](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.10...@contentful/field-editor-validation-errors@1.1.11) (2023-03-14)
13
-
14
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
15
-
16
- ## [1.1.10](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.9...@contentful/field-editor-validation-errors@1.1.10) (2023-03-10)
17
-
18
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
19
-
20
- ## [1.1.9](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.8...@contentful/field-editor-validation-errors@1.1.9) (2023-02-21)
21
-
22
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
23
-
24
- ## [1.1.8](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.7...@contentful/field-editor-validation-errors@1.1.8) (2023-02-07)
25
-
26
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
27
-
28
- ## [1.1.7](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.6...@contentful/field-editor-validation-errors@1.1.7) (2022-12-08)
29
-
30
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
31
-
32
- ## [1.1.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.5...@contentful/field-editor-validation-errors@1.1.6) (2022-07-29)
33
-
34
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
35
-
36
- ## [1.1.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.4...@contentful/field-editor-validation-errors@1.1.5) (2022-07-29)
37
-
38
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
39
-
40
- ## [1.1.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.3...@contentful/field-editor-validation-errors@1.1.4) (2022-07-11)
41
-
42
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
43
-
44
- ## [1.1.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.2...@contentful/field-editor-validation-errors@1.1.3) (2022-06-22)
45
-
46
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
47
-
48
- ## [1.1.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.1...@contentful/field-editor-validation-errors@1.1.2) (2022-02-15)
49
-
50
- ### Bug Fixes
51
-
52
- - bump f36 packages ([#1025](https://github.com/contentful/field-editors/issues/1025)) ([ec37a40](https://github.com/contentful/field-editors/commit/ec37a4000db7cd75c66dd9621136b2272c9feeea))
53
-
54
- ## [1.1.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.1.0...@contentful/field-editor-validation-errors@1.1.1) (2022-02-14)
55
-
56
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
57
-
58
- # [1.1.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.0.3...@contentful/field-editor-validation-errors@1.1.0) (2022-01-11)
59
-
60
- ### Features
61
-
62
- - bump f36 packages to stable v4 [BAU-521] ([#988](https://github.com/contentful/field-editors/issues/988)) ([419cf56](https://github.com/contentful/field-editors/commit/419cf56692179b074fcfa2743469d5265ed98429))
63
-
64
- ## [1.0.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.0.2...@contentful/field-editor-validation-errors@1.0.3) (2021-12-23)
65
-
66
- ### Bug Fixes
67
-
68
- - markdown buttons ([#968](https://github.com/contentful/field-editors/issues/968)) ([9803b98](https://github.com/contentful/field-editors/commit/9803b98c25d92df6148686ffe2749a77f7efdbb9))
69
-
70
- ## [1.0.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.0.1...@contentful/field-editor-validation-errors@1.0.2) (2021-12-20)
71
-
72
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
73
-
74
- ## [1.0.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@1.0.0...@contentful/field-editor-validation-errors@1.0.1) (2021-11-17)
75
-
76
- ### Bug Fixes
77
-
78
- - **card-actions:** update forma 36 to fix card actions click issue ([#927](https://github.com/contentful/field-editors/issues/927)) ([3dfdef2](https://github.com/contentful/field-editors/commit/3dfdef2c2b0045f12ea94ddafca89a8e9f25e7d0))
79
-
80
- # [1.0.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.8.0...@contentful/field-editor-validation-errors@1.0.0) (2021-11-04)
81
-
82
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
83
-
84
- # [0.8.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.7.1...@contentful/field-editor-validation-errors@0.8.0) (2021-11-04)
85
-
86
- ### Features
87
-
88
- - Forma v4 components adoption ([#805](https://github.com/contentful/field-editors/issues/805)) ([526bde6](https://github.com/contentful/field-editors/commit/526bde6e10e0ee3789705ec10fb31489af7ca59e))
89
-
90
- ### BREAKING CHANGES
91
-
92
- - adopts a new Forma v4 beta
93
-
94
- ## [0.7.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.7.0...@contentful/field-editor-validation-errors@0.7.1) (2021-10-14)
95
-
96
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
97
-
98
- # [0.7.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.6.4...@contentful/field-editor-validation-errors@0.7.0) (2021-10-06)
99
-
100
- ### Features
101
-
102
- - [EXT-3161] bump app sdk to v4 ([#881](https://github.com/contentful/field-editors/issues/881)) ([9c4a2af](https://github.com/contentful/field-editors/commit/9c4a2af07da203d59fb5f15c3a5188ecc64b1d44))
103
-
104
- ## [0.6.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.6.3...@contentful/field-editor-validation-errors@0.6.4) (2021-09-17)
105
-
106
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
107
-
108
- ## [0.6.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.6.2...@contentful/field-editor-validation-errors@0.6.3) (2021-09-16)
109
-
110
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
111
-
112
- ## [0.6.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.6.1...@contentful/field-editor-validation-errors@0.6.2) (2021-08-19)
113
-
114
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
115
-
116
- ## [0.6.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.6.0...@contentful/field-editor-validation-errors@0.6.1) (2021-07-29)
117
-
118
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
119
-
120
- # [0.6.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.6...@contentful/field-editor-validation-errors@0.6.0) (2021-07-23)
121
-
122
- ### Features
123
-
124
- - 💡 new color tokens ([#778](https://github.com/contentful/field-editors/issues/778)) ([fba548d](https://github.com/contentful/field-editors/commit/fba548de32305016df7f2685634eefb14294828f))
125
-
126
- ## [0.5.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.3...@contentful/field-editor-validation-errors@0.5.6) (2021-07-06)
127
-
128
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
129
-
130
- ## [0.5.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.3...@contentful/field-editor-validation-errors@0.5.5) (2021-07-06)
131
-
132
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
133
-
134
- ## [0.5.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.3...@contentful/field-editor-validation-errors@0.5.4) (2021-06-23)
135
-
136
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
137
-
138
- ## [0.5.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.2...@contentful/field-editor-validation-errors@0.5.3) (2021-06-23)
139
-
140
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
141
-
142
- ## [0.5.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.1...@contentful/field-editor-validation-errors@0.5.2) (2021-06-22)
143
-
144
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
145
-
146
- ## [0.5.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.5.0...@contentful/field-editor-validation-errors@0.5.1) (2021-03-05)
147
-
148
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
149
-
150
- # [0.5.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.4.2...@contentful/field-editor-validation-errors@0.5.0) (2021-02-19)
151
-
152
- ### Features
153
-
154
- - bump min version of forma-36 ([#606](https://github.com/contentful/field-editors/issues/606)) ([fd57c7a](https://github.com/contentful/field-editors/commit/fd57c7a4312766af38c01507f17706ab22992617))
155
-
156
- ## [0.4.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.4.1...@contentful/field-editor-validation-errors@0.4.2) (2021-02-09)
157
-
158
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
159
-
160
- ## [0.4.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.4.0...@contentful/field-editor-validation-errors@0.4.1) (2021-02-01)
161
-
162
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
163
-
164
- # [0.4.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.3.0...@contentful/field-editor-validation-errors@0.4.0) (2021-01-20)
165
-
166
- ### Features
167
-
168
- - update minimal forma-36 versions to use updated design ([#565](https://github.com/contentful/field-editors/issues/565)) ([332c734](https://github.com/contentful/field-editors/commit/332c734bfaf54f0e9773fcbb460d743b1f5459ec))
169
-
170
- # [0.3.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.7...@contentful/field-editor-validation-errors@0.3.0) (2021-01-12)
171
-
172
- ### Features
173
-
174
- - update minimal required Forma version to the 3.73.12 ([#552](https://github.com/contentful/field-editors/issues/552)) ([2816fd9](https://github.com/contentful/field-editors/commit/2816fd960c28815faebf49a9ef8f4c4c0d91fc36))
175
-
176
- ## [0.2.7](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.6...@contentful/field-editor-validation-errors@0.2.7) (2020-12-16)
177
-
178
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
179
-
180
- ## [0.2.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.5...@contentful/field-editor-validation-errors@0.2.6) (2020-11-06)
181
-
182
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
183
-
184
- ## [0.2.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.4...@contentful/field-editor-validation-errors@0.2.5) (2020-11-06)
185
-
186
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
187
-
188
- ## [0.2.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.3...@contentful/field-editor-validation-errors@0.2.4) (2020-10-28)
189
-
190
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
191
-
192
- ## [0.2.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.2...@contentful/field-editor-validation-errors@0.2.3) (2020-09-08)
193
-
194
- ### Bug Fixes
195
-
196
- - center vertical align of error items ([#396](https://github.com/contentful/field-editors/issues/396)) ([28de452](https://github.com/contentful/field-editors/commit/28de452c63a2d445549f78edce609c1e2266f96d))
197
-
198
- ## [0.2.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.1...@contentful/field-editor-validation-errors@0.2.2) (2020-08-24)
199
-
200
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
201
-
202
- ## [0.2.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-validation-errors@0.2.0...@contentful/field-editor-validation-errors@0.2.1) (2020-08-17)
203
-
204
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
@@ -1,139 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
-
7
- var React = _interopDefault(require('react'));
8
- var f36Components = require('@contentful/f36-components');
9
- var f36Icons = require('@contentful/f36-icons');
10
- var fieldEditorShared = require('@contentful/field-editor-shared');
11
- var tokens = _interopDefault(require('@contentful/f36-tokens'));
12
- var emotion = require('emotion');
13
-
14
- const errorList = /*#__PURE__*/emotion.css({
15
- padding: 0,
16
- wordWrap: 'break-word',
17
- marginTop: tokens.spacingS,
18
- color: tokens.red500,
19
- listStyleType: 'none'
20
- });
21
- const errorMessage = /*#__PURE__*/emotion.css({
22
- display: 'inline-flex',
23
- flexDirection: 'column',
24
- marginLeft: tokens.spacingXs
25
- });
26
- const errorItem = /*#__PURE__*/emotion.css({
27
- display: 'flex',
28
- alignItems: 'center'
29
- });
30
- const entryLink = /*#__PURE__*/emotion.css({
31
- fontWeight: /*#__PURE__*/Number(tokens.fontWeightDemiBold)
32
- });
33
-
34
- function UniquenessError(props) {
35
- const [state, setState] = React.useState({
36
- loading: true,
37
- entries: []
38
- });
39
- const contentTypesById = React.useMemo(() => // Maps ID => Content Type
40
- props.space.getCachedContentTypes().reduce((prev, ct) => ({ ...prev,
41
- [ct.sys.id]: ct
42
- }), {}), [props.space]);
43
- const getTitle = React.useCallback(entry => fieldEditorShared.entityHelpers.getEntryTitle({
44
- entry,
45
- defaultTitle: 'Untitled',
46
- localeCode: props.localeCode,
47
- defaultLocaleCode: props.defaultLocaleCode,
48
- contentType: contentTypesById[entry.sys.contentType.sys.id]
49
- }), [props.localeCode, props.defaultLocaleCode, contentTypesById]);
50
- let conflicting = [];
51
-
52
- if ('conflicting' in props.error) {
53
- conflicting = props.error.conflicting;
54
- }
55
-
56
- React.useEffect(() => {
57
- const entryIds = state.entries.map(entry => entry.id);
58
- const conflictIds = conflicting.map(entry => entry.sys.id); // Avoid unnecessary refetching
59
-
60
- if (conflictIds.every(id => entryIds.includes(id))) {
61
- return;
62
- }
63
-
64
- setState(state => ({ ...state,
65
- loading: true
66
- }));
67
- const query = {
68
- 'sys.id[in]': conflictIds.join(',')
69
- };
70
- props.space.getEntries(query).then(({
71
- items
72
- }) => {
73
- const entries = items.map(entry => ({
74
- id: entry.sys.id,
75
- title: getTitle(entry),
76
- href: props.getEntryURL(entry)
77
- }));
78
- setState({
79
- loading: false,
80
- entries
81
- });
82
- }); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate these dependencies
83
- }, [getTitle, state.entries, conflicting, props.space.getEntries, props.getEntryURL]);
84
- return React.createElement(f36Components.List, {
85
- className: errorList,
86
- testId: "validation-errors-uniqueness"
87
- }, React.createElement(f36Components.ListItem, {
88
- className: entryLink
89
- }, state.loading ? React.createElement("div", null, "Loading title for conflicting entry\u2026") : state.entries.map(entry => React.createElement(f36Components.TextLink, {
90
- key: entry.id,
91
- href: entry.href,
92
- icon: React.createElement(f36Icons.ExternalLinkIcon, null),
93
- alignIcon: "end",
94
- variant: "negative",
95
- target: "_blank",
96
- rel: "noopener noreferrer"
97
- }, entry.title))));
98
- }
99
-
100
- function ValidationErrors(props) {
101
- const [errors, setErrors] = React.useState([]);
102
- React.useEffect(() => {
103
- const onErrors = errors => {
104
- setErrors(errors || []);
105
- };
106
-
107
- return props.field.onSchemaErrorsChanged(onErrors);
108
- }, [props.field]);
109
-
110
- if (errors.length === 0) {
111
- return null;
112
- }
113
-
114
- return React.createElement(f36Components.List, {
115
- className: errorList,
116
- testId: "validation-errors"
117
- }, errors.map((error, index) => {
118
- return React.createElement("li", {
119
- key: index,
120
- role: "status",
121
- "aria-roledescription": "field-locale-schema",
122
- "data-error-code": `entry.schema.${error.name}`,
123
- className: errorItem
124
- }, React.createElement(f36Icons.InfoCircleIcon, {
125
- variant: "negative"
126
- }), React.createElement("div", {
127
- className: errorMessage
128
- }, error.message, error.name === 'unique' && React.createElement(UniquenessError, {
129
- error: error,
130
- space: props.space,
131
- localeCode: props.field.locale,
132
- defaultLocaleCode: props.locales.default,
133
- getEntryURL: props.getEntryURL
134
- })));
135
- }));
136
- }
137
-
138
- exports.ValidationErrors = ValidationErrors;
139
- //# sourceMappingURL=field-editor-validation-errors.cjs.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-editor-validation-errors.cjs.development.js","sources":["../src/styles.ts","../src/ValidationErrors.tsx"],"sourcesContent":["import tokens from '@contentful/f36-tokens';\nimport { css } from 'emotion';\n\nexport const errorList = css({\n padding: 0,\n wordWrap: 'break-word',\n marginTop: tokens.spacingS,\n color: tokens.red500,\n listStyleType: 'none',\n});\n\nexport const errorMessage = css({\n display: 'inline-flex',\n flexDirection: 'column',\n marginLeft: tokens.spacingXs,\n});\n\nexport const errorItem = css({\n display: 'flex',\n alignItems: 'center',\n});\n\nexport const entryLink = css({\n fontWeight: Number(tokens.fontWeightDemiBold),\n});\n","import React from 'react';\n\nimport { ValidationError, Link } from '@contentful/app-sdk';\nimport { TextLink, List, ListItem } from '@contentful/f36-components';\nimport { ExternalLinkIcon, InfoCircleIcon } from '@contentful/f36-icons';\nimport type {\n SpaceAPI,\n Entry,\n ContentType,\n FieldAPI,\n LocalesAPI,\n} from '@contentful/field-editor-shared';\nimport { entityHelpers } from '@contentful/field-editor-shared';\n\nimport * as styles from './styles';\n\ntype UniquenessErrorProps = {\n error: ValidationError;\n space: SpaceAPI;\n localeCode: string;\n defaultLocaleCode: string;\n getEntryURL: (entry: Entry) => string;\n};\n\nfunction UniquenessError(props: UniquenessErrorProps) {\n const [state, setState] = React.useState<{\n loading: boolean;\n entries: { id: string; title: string; href: string }[];\n }>({\n loading: true,\n entries: [],\n });\n\n const contentTypesById = React.useMemo(\n (): Record<string, ContentType> =>\n // Maps ID => Content Type\n props.space.getCachedContentTypes().reduce(\n (prev, ct) => ({\n ...prev,\n [ct.sys.id]: ct,\n }),\n {}\n ),\n [props.space]\n );\n\n const getTitle = React.useCallback(\n (entry: Entry) =>\n entityHelpers.getEntryTitle({\n entry,\n defaultTitle: 'Untitled',\n localeCode: props.localeCode,\n defaultLocaleCode: props.defaultLocaleCode,\n contentType: contentTypesById[entry.sys.contentType.sys.id],\n }),\n [props.localeCode, props.defaultLocaleCode, contentTypesById]\n );\n\n let conflicting: Link<'Entry', 'Link'>[] = [];\n if ('conflicting' in props.error) {\n conflicting = props.error.conflicting;\n }\n React.useEffect(() => {\n const entryIds = state.entries.map((entry) => entry.id);\n const conflictIds = conflicting.map((entry) => entry.sys.id);\n\n // Avoid unnecessary refetching\n if (conflictIds.every((id) => entryIds.includes(id))) {\n return;\n }\n\n setState((state) => ({ ...state, loading: true }));\n\n const query = {\n 'sys.id[in]': conflictIds.join(','),\n };\n\n props.space.getEntries<Entry>(query).then(({ items }) => {\n const entries = items.map((entry) => ({\n id: entry.sys.id,\n title: getTitle(entry),\n href: props.getEntryURL(entry),\n }));\n\n setState({\n loading: false,\n entries,\n });\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate these dependencies\n }, [getTitle, state.entries, conflicting, props.space.getEntries, props.getEntryURL]);\n\n return (\n <List className={styles.errorList} testId=\"validation-errors-uniqueness\">\n <ListItem className={styles.entryLink}>\n {state.loading ? (\n <div>Loading title for conflicting entry…</div>\n ) : (\n state.entries.map((entry) => (\n <TextLink\n key={entry.id}\n href={entry.href}\n icon={<ExternalLinkIcon />}\n alignIcon=\"end\"\n variant=\"negative\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {entry.title}\n </TextLink>\n ))\n )}\n </ListItem>\n </List>\n );\n}\n\nexport interface ValidationErrorsProps {\n field: FieldAPI;\n space: SpaceAPI;\n locales: LocalesAPI;\n getEntryURL: (entry: Entry) => string;\n}\n\nexport function ValidationErrors(props: ValidationErrorsProps) {\n const [errors, setErrors] = React.useState<ValidationError[]>([]);\n\n React.useEffect(() => {\n const onErrors = (errors?: ValidationError[]) => {\n setErrors(errors || []);\n };\n\n return props.field.onSchemaErrorsChanged(onErrors);\n }, [props.field]);\n\n if (errors.length === 0) {\n return null;\n }\n\n return (\n <List className={styles.errorList} testId=\"validation-errors\">\n {errors.map((error, index) => {\n return (\n <li\n key={index}\n role=\"status\"\n aria-roledescription=\"field-locale-schema\"\n data-error-code={`entry.schema.${error.name}`}\n className={styles.errorItem}>\n <InfoCircleIcon variant=\"negative\" />\n <div className={styles.errorMessage}>\n {error.message}\n {error.name === 'unique' && (\n <UniquenessError\n error={error}\n space={props.space}\n localeCode={props.field.locale}\n defaultLocaleCode={props.locales.default}\n getEntryURL={props.getEntryURL}\n />\n )}\n </div>\n </li>\n );\n })}\n </List>\n );\n}\n"],"names":["errorList","css","padding","wordWrap","marginTop","tokens","spacingS","color","red500","listStyleType","errorMessage","display","flexDirection","marginLeft","spacingXs","errorItem","alignItems","entryLink","fontWeight","Number","fontWeightDemiBold","UniquenessError","props","state","setState","React","useState","loading","entries","contentTypesById","useMemo","space","getCachedContentTypes","reduce","prev","ct","sys","id","getTitle","useCallback","entry","entityHelpers","getEntryTitle","defaultTitle","localeCode","defaultLocaleCode","contentType","conflicting","error","useEffect","entryIds","map","conflictIds","every","includes","query","join","getEntries","then","items","title","href","getEntryURL","List","className","styles","testId","ListItem","TextLink","key","icon","ExternalLinkIcon","alignIcon","variant","target","rel","ValidationErrors","errors","setErrors","onErrors","field","onSchemaErrorsChanged","length","index","role","name","InfoCircleIcon","message","locale","locales","default"],"mappings":";;;;;;;;;;;;;AAGO,MAAMA,SAAS,gBAAGC,WAAG,CAAC;AAC3BC,EAAAA,OAAO,EAAE,CADkB;AAE3BC,EAAAA,QAAQ,EAAE,YAFiB;AAG3BC,EAAAA,SAAS,EAAEC,MAAM,CAACC,QAHS;AAI3BC,EAAAA,KAAK,EAAEF,MAAM,CAACG,MAJa;AAK3BC,EAAAA,aAAa,EAAE;AALY,CAAD,CAArB;AAQA,MAAMC,YAAY,gBAAGT,WAAG,CAAC;AAC9BU,EAAAA,OAAO,EAAE,aADqB;AAE9BC,EAAAA,aAAa,EAAE,QAFe;AAG9BC,EAAAA,UAAU,EAAER,MAAM,CAACS;AAHW,CAAD,CAAxB;AAMA,MAAMC,SAAS,gBAAGd,WAAG,CAAC;AAC3BU,EAAAA,OAAO,EAAE,MADkB;AAE3BK,EAAAA,UAAU,EAAE;AAFe,CAAD,CAArB;AAKA,MAAMC,SAAS,gBAAGhB,WAAG,CAAC;AAC3BiB,EAAAA,UAAU,eAAEC,MAAM,CAACd,MAAM,CAACe,kBAAR;AADS,CAAD,CAArB;;ACEP,SAASC,eAAT,CAAyBC,KAAzB;AACE,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBC,KAAK,CAACC,QAAN,CAGvB;AACDC,IAAAA,OAAO,EAAE,IADR;AAEDC,IAAAA,OAAO,EAAE;AAFR,GAHuB,CAA1B;AAQA,QAAMC,gBAAgB,GAAGJ,KAAK,CAACK,OAAN,CACvB;AAEER,EAAAA,KAAK,CAACS,KAAN,CAAYC,qBAAZ,GAAoCC,MAApC,CACE,CAACC,IAAD,EAAOC,EAAP,MAAe,EACb,GAAGD,IADU;AAE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AiB,EAAEvB,KAAK,CAACmE,OAAN,CAAcC;AACjC5B,MAAAA,WAAW,EAAExC,KAAK,CAACwC;KALrB,CAHJ,CAPF,CADF;AAsBD,GAvBA,CADH,CADF;AA4BD;;;;"}
@@ -1,2 +0,0 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),n=require("@contentful/f36-components"),r=require("@contentful/f36-icons"),a=require("@contentful/field-editor-shared"),i=e(require("@contentful/f36-tokens")),l=require("emotion");const o=l.css({padding:0,wordWrap:"break-word",marginTop:i.spacingS,color:i.red500,listStyleType:"none"}),s=l.css({display:"inline-flex",flexDirection:"column",marginLeft:i.spacingXs}),c=l.css({display:"flex",alignItems:"center"}),d=l.css({fontWeight:Number(i.fontWeightDemiBold)});function u(e){const[i,l]=t.useState({loading:!0,entries:[]}),s=t.useMemo(()=>e.space.getCachedContentTypes().reduce((e,t)=>({...e,[t.sys.id]:t}),{}),[e.space]),c=t.useCallback(t=>a.entityHelpers.getEntryTitle({entry:t,defaultTitle:"Untitled",localeCode:e.localeCode,defaultLocaleCode:e.defaultLocaleCode,contentType:s[t.sys.contentType.sys.id]}),[e.localeCode,e.defaultLocaleCode,s]);let u=[];return"conflicting"in e.error&&(u=e.error.conflicting),t.useEffect(()=>{const t=i.entries.map(e=>e.id),n=u.map(e=>e.sys.id);if(n.every(e=>t.includes(e)))return;l(e=>({...e,loading:!0}));const r={"sys.id[in]":n.join(",")};e.space.getEntries(r).then(({items:t})=>{const n=t.map(t=>({id:t.sys.id,title:c(t),href:e.getEntryURL(t)}));l({loading:!1,entries:n})})},[c,i.entries,u,e.space.getEntries,e.getEntryURL]),t.createElement(n.List,{className:o,testId:"validation-errors-uniqueness"},t.createElement(n.ListItem,{className:d},i.loading?t.createElement("div",null,"Loading title for conflicting entry…"):i.entries.map(e=>t.createElement(n.TextLink,{key:e.id,href:e.href,icon:t.createElement(r.ExternalLinkIcon,null),alignIcon:"end",variant:"negative",target:"_blank",rel:"noopener noreferrer"},e.title))))}exports.ValidationErrors=function(e){const[a,i]=t.useState([]);return t.useEffect(()=>e.field.onSchemaErrorsChanged(e=>{i(e||[])}),[e.field]),0===a.length?null:t.createElement(n.List,{className:o,testId:"validation-errors"},a.map((n,a)=>t.createElement("li",{key:a,role:"status","aria-roledescription":"field-locale-schema","data-error-code":"entry.schema."+n.name,className:c},t.createElement(r.InfoCircleIcon,{variant:"negative"}),t.createElement("div",{className:s},n.message,"unique"===n.name&&t.createElement(u,{error:n,space:e.space,localeCode:e.field.locale,defaultLocaleCode:e.locales.default,getEntryURL:e.getEntryURL})))))};
2
- //# sourceMappingURL=field-editor-validation-errors.cjs.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-editor-validation-errors.cjs.production.min.js","sources":["../src/styles.ts","../src/ValidationErrors.tsx"],"sourcesContent":["import tokens from '@contentful/f36-tokens';\nimport { css } from 'emotion';\n\nexport const errorList = css({\n padding: 0,\n wordWrap: 'break-word',\n marginTop: tokens.spacingS,\n color: tokens.red500,\n listStyleType: 'none',\n});\n\nexport const errorMessage = css({\n display: 'inline-flex',\n flexDirection: 'column',\n marginLeft: tokens.spacingXs,\n});\n\nexport const errorItem = css({\n display: 'flex',\n alignItems: 'center',\n});\n\nexport const entryLink = css({\n fontWeight: Number(tokens.fontWeightDemiBold),\n});\n","import React from 'react';\n\nimport { ValidationError, Link } from '@contentful/app-sdk';\nimport { TextLink, List, ListItem } from '@contentful/f36-components';\nimport { ExternalLinkIcon, InfoCircleIcon } from '@contentful/f36-icons';\nimport type {\n SpaceAPI,\n Entry,\n ContentType,\n FieldAPI,\n LocalesAPI,\n} from '@contentful/field-editor-shared';\nimport { entityHelpers } from '@contentful/field-editor-shared';\n\nimport * as styles from './styles';\n\ntype UniquenessErrorProps = {\n error: ValidationError;\n space: SpaceAPI;\n localeCode: string;\n defaultLocaleCode: string;\n getEntryURL: (entry: Entry) => string;\n};\n\nfunction UniquenessError(props: UniquenessErrorProps) {\n const [state, setState] = React.useState<{\n loading: boolean;\n entries: { id: string; title: string; href: string }[];\n }>({\n loading: true,\n entries: [],\n });\n\n const contentTypesById = React.useMemo(\n (): Record<string, ContentType> =>\n // Maps ID => Content Type\n props.space.getCachedContentTypes().reduce(\n (prev, ct) => ({\n ...prev,\n [ct.sys.id]: ct,\n }),\n {}\n ),\n [props.space]\n );\n\n const getTitle = React.useCallback(\n (entry: Entry) =>\n entityHelpers.getEntryTitle({\n entry,\n defaultTitle: 'Untitled',\n localeCode: props.localeCode,\n defaultLocaleCode: props.defaultLocaleCode,\n contentType: contentTypesById[entry.sys.contentType.sys.id],\n }),\n [props.localeCode, props.defaultLocaleCode, contentTypesById]\n );\n\n let conflicting: Link<'Entry', 'Link'>[] = [];\n if ('conflicting' in props.error) {\n conflicting = props.error.conflicting;\n }\n React.useEffect(() => {\n const entryIds = state.entries.map((entry) => entry.id);\n const conflictIds = conflicting.map((entry) => entry.sys.id);\n\n // Avoid unnecessary refetching\n if (conflictIds.every((id) => entryIds.includes(id))) {\n return;\n }\n\n setState((state) => ({ ...state, loading: true }));\n\n const query = {\n 'sys.id[in]': conflictIds.join(','),\n };\n\n props.space.getEntries<Entry>(query).then(({ items }) => {\n const entries = items.map((entry) => ({\n id: entry.sys.id,\n title: getTitle(entry),\n href: props.getEntryURL(entry),\n }));\n\n setState({\n loading: false,\n entries,\n });\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate these dependencies\n }, [getTitle, state.entries, conflicting, props.space.getEntries, props.getEntryURL]);\n\n return (\n <List className={styles.errorList} testId=\"validation-errors-uniqueness\">\n <ListItem className={styles.entryLink}>\n {state.loading ? (\n <div>Loading title for conflicting entry…</div>\n ) : (\n state.entries.map((entry) => (\n <TextLink\n key={entry.id}\n href={entry.href}\n icon={<ExternalLinkIcon />}\n alignIcon=\"end\"\n variant=\"negative\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {entry.title}\n </TextLink>\n ))\n )}\n </ListItem>\n </List>\n );\n}\n\nexport interface ValidationErrorsProps {\n field: FieldAPI;\n space: SpaceAPI;\n locales: LocalesAPI;\n getEntryURL: (entry: Entry) => string;\n}\n\nexport function ValidationErrors(props: ValidationErrorsProps) {\n const [errors, setErrors] = React.useState<ValidationError[]>([]);\n\n React.useEffect(() => {\n const onErrors = (errors?: ValidationError[]) => {\n setErrors(errors || []);\n };\n\n return props.field.onSchemaErrorsChanged(onErrors);\n }, [props.field]);\n\n if (errors.length === 0) {\n return null;\n }\n\n return (\n <List className={styles.errorList} testId=\"validation-errors\">\n {errors.map((error, index) => {\n return (\n <li\n key={index}\n role=\"status\"\n aria-roledescription=\"field-locale-schema\"\n data-error-code={`entry.schema.${error.name}`}\n className={styles.errorItem}>\n <InfoCircleIcon variant=\"negative\" />\n <div className={styles.errorMessage}>\n {error.message}\n {error.name === 'unique' && (\n <UniquenessError\n error={error}\n space={props.space}\n localeCode={props.field.locale}\n defaultLocaleCode={props.locales.default}\n getEntryURL={props.getEntryURL}\n />\n )}\n </div>\n </li>\n );\n })}\n </List>\n );\n}\n"],"names":["errorList","css","padding","wordWrap","marginTop","tokens","spacingS","color","red500","listStyleType","errorMessage","display","flexDirection","marginLeft","spacingXs","errorItem","alignItems","entryLink","fontWeight","Number","fontWeightDemiBold","UniquenessError","props","state","setState","React","useState","loading","entries","contentTypesById","useMemo","space","getCachedContentTypes","reduce","prev","ct","sys","id","getTitle","useCallback","entry","entityHelpers","getEntryTitle","defaultTitle","localeCode","defaultLocaleCode","contentType","conflicting","error","useEffect","entryIds","map","conflictIds","every","includes","query","join","getEntries","then","items","title","href","getEntryURL","List","className","styles","testId","ListItem","TextLink","key","icon","ExternalLinkIcon","alignIcon","variant","target","rel","errors","setErrors","field","onSchemaErrorsChanged","length","index","role","name","InfoCircleIcon","message","locale","locales","default"],"mappings":"wVAGO,MAAMA,EAAYC,MAAI,CAC3BC,QAAS,EACTC,SAAU,aACVC,UAAWC,EAAOC,SAClBC,MAA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M0B,WAAYnC,EAAMwC,cAGtErC,gBAACsC,QAAKC,UAAWC,EAAkBC,OAAO,gCACxCzC,gBAAC0C,YAASH,UAAWC,GAClB1C,EAAMI,QACLF,mEAEAF,EAAMK,QAAQuB,IAAKX,GACjBf,gBAAC2C,YACCC,IAAK7B,EAAMH,GACXwB,KAAMrB,EAAMqB,KACZS,KAAM7C,gBAAC8C,yBACPC,UAAU,MACVC,QAAQ,WACRC,OAAO,SACPC,IAAI,uBACHnC,EAAMoB,4CAgBYtC,SACxBsD,EAAQC,GAAapD,EAAMC,SAA4B,WAE9DD,EAAMwB,UAAU,IAKP3B,EAAMwD,MAAMC,sBAJDH,IAChBC,EAAUD,GAAU,MAIrB,CAACtD,EAAMwD,QAEY,IAAlBF,EAAOI,OACF,KAIPvD,gBAACsC,QAAKC,UAAWC,EAAkBC,OAAO,qBACvCU,EAAOzB,IAAI,CAACH,EAAOiC,IAEhBxD,sBACE4C,IAAKY,EACLC,KAAK,gCACgB,wDACYlC,EAAMmC,KACvCnB,UAAWC,GACXxC,gBAAC2D,kBAAeX,QAAQ,aACxBhD,uBAAKuC,UAAWC,GACbjB,EAAMqC,QACS,WAAfrC,EAAMmC,MACL1D,gBAACJ,GACC2B,MAAOA,EACPjB,MAAOT,EAAMS,MACba,WAAYtB,EAAMwD,MAAMQ,OACxBzC,kBAAmBvB,EAAMiE,QAAQC,QACjC1B,YAAaxC,EAAMwC"}
@@ -1,133 +0,0 @@
1
- import React from 'react';
2
- import { List, ListItem, TextLink } from '@contentful/f36-components';
3
- import { InfoCircleIcon, ExternalLinkIcon } from '@contentful/f36-icons';
4
- import { entityHelpers } from '@contentful/field-editor-shared';
5
- import tokens from '@contentful/f36-tokens';
6
- import { css } from 'emotion';
7
-
8
- const errorList = /*#__PURE__*/css({
9
- padding: 0,
10
- wordWrap: 'break-word',
11
- marginTop: tokens.spacingS,
12
- color: tokens.red500,
13
- listStyleType: 'none'
14
- });
15
- const errorMessage = /*#__PURE__*/css({
16
- display: 'inline-flex',
17
- flexDirection: 'column',
18
- marginLeft: tokens.spacingXs
19
- });
20
- const errorItem = /*#__PURE__*/css({
21
- display: 'flex',
22
- alignItems: 'center'
23
- });
24
- const entryLink = /*#__PURE__*/css({
25
- fontWeight: /*#__PURE__*/Number(tokens.fontWeightDemiBold)
26
- });
27
-
28
- function UniquenessError(props) {
29
- const [state, setState] = React.useState({
30
- loading: true,
31
- entries: []
32
- });
33
- const contentTypesById = React.useMemo(() => // Maps ID => Content Type
34
- props.space.getCachedContentTypes().reduce((prev, ct) => ({ ...prev,
35
- [ct.sys.id]: ct
36
- }), {}), [props.space]);
37
- const getTitle = React.useCallback(entry => entityHelpers.getEntryTitle({
38
- entry,
39
- defaultTitle: 'Untitled',
40
- localeCode: props.localeCode,
41
- defaultLocaleCode: props.defaultLocaleCode,
42
- contentType: contentTypesById[entry.sys.contentType.sys.id]
43
- }), [props.localeCode, props.defaultLocaleCode, contentTypesById]);
44
- let conflicting = [];
45
-
46
- if ('conflicting' in props.error) {
47
- conflicting = props.error.conflicting;
48
- }
49
-
50
- React.useEffect(() => {
51
- const entryIds = state.entries.map(entry => entry.id);
52
- const conflictIds = conflicting.map(entry => entry.sys.id); // Avoid unnecessary refetching
53
-
54
- if (conflictIds.every(id => entryIds.includes(id))) {
55
- return;
56
- }
57
-
58
- setState(state => ({ ...state,
59
- loading: true
60
- }));
61
- const query = {
62
- 'sys.id[in]': conflictIds.join(',')
63
- };
64
- props.space.getEntries(query).then(({
65
- items
66
- }) => {
67
- const entries = items.map(entry => ({
68
- id: entry.sys.id,
69
- title: getTitle(entry),
70
- href: props.getEntryURL(entry)
71
- }));
72
- setState({
73
- loading: false,
74
- entries
75
- });
76
- }); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate these dependencies
77
- }, [getTitle, state.entries, conflicting, props.space.getEntries, props.getEntryURL]);
78
- return React.createElement(List, {
79
- className: errorList,
80
- testId: "validation-errors-uniqueness"
81
- }, React.createElement(ListItem, {
82
- className: entryLink
83
- }, state.loading ? React.createElement("div", null, "Loading title for conflicting entry\u2026") : state.entries.map(entry => React.createElement(TextLink, {
84
- key: entry.id,
85
- href: entry.href,
86
- icon: React.createElement(ExternalLinkIcon, null),
87
- alignIcon: "end",
88
- variant: "negative",
89
- target: "_blank",
90
- rel: "noopener noreferrer"
91
- }, entry.title))));
92
- }
93
-
94
- function ValidationErrors(props) {
95
- const [errors, setErrors] = React.useState([]);
96
- React.useEffect(() => {
97
- const onErrors = errors => {
98
- setErrors(errors || []);
99
- };
100
-
101
- return props.field.onSchemaErrorsChanged(onErrors);
102
- }, [props.field]);
103
-
104
- if (errors.length === 0) {
105
- return null;
106
- }
107
-
108
- return React.createElement(List, {
109
- className: errorList,
110
- testId: "validation-errors"
111
- }, errors.map((error, index) => {
112
- return React.createElement("li", {
113
- key: index,
114
- role: "status",
115
- "aria-roledescription": "field-locale-schema",
116
- "data-error-code": `entry.schema.${error.name}`,
117
- className: errorItem
118
- }, React.createElement(InfoCircleIcon, {
119
- variant: "negative"
120
- }), React.createElement("div", {
121
- className: errorMessage
122
- }, error.message, error.name === 'unique' && React.createElement(UniquenessError, {
123
- error: error,
124
- space: props.space,
125
- localeCode: props.field.locale,
126
- defaultLocaleCode: props.locales.default,
127
- getEntryURL: props.getEntryURL
128
- })));
129
- }));
130
- }
131
-
132
- export { ValidationErrors };
133
- //# sourceMappingURL=field-editor-validation-errors.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-editor-validation-errors.esm.js","sources":["../src/styles.ts","../src/ValidationErrors.tsx"],"sourcesContent":["import tokens from '@contentful/f36-tokens';\nimport { css } from 'emotion';\n\nexport const errorList = css({\n padding: 0,\n wordWrap: 'break-word',\n marginTop: tokens.spacingS,\n color: tokens.red500,\n listStyleType: 'none',\n});\n\nexport const errorMessage = css({\n display: 'inline-flex',\n flexDirection: 'column',\n marginLeft: tokens.spacingXs,\n});\n\nexport const errorItem = css({\n display: 'flex',\n alignItems: 'center',\n});\n\nexport const entryLink = css({\n fontWeight: Number(tokens.fontWeightDemiBold),\n});\n","import React from 'react';\n\nimport { ValidationError, Link } from '@contentful/app-sdk';\nimport { TextLink, List, ListItem } from '@contentful/f36-components';\nimport { ExternalLinkIcon, InfoCircleIcon } from '@contentful/f36-icons';\nimport type {\n SpaceAPI,\n Entry,\n ContentType,\n FieldAPI,\n LocalesAPI,\n} from '@contentful/field-editor-shared';\nimport { entityHelpers } from '@contentful/field-editor-shared';\n\nimport * as styles from './styles';\n\ntype UniquenessErrorProps = {\n error: ValidationError;\n space: SpaceAPI;\n localeCode: string;\n defaultLocaleCode: string;\n getEntryURL: (entry: Entry) => string;\n};\n\nfunction UniquenessError(props: UniquenessErrorProps) {\n const [state, setState] = React.useState<{\n loading: boolean;\n entries: { id: string; title: string; href: string }[];\n }>({\n loading: true,\n entries: [],\n });\n\n const contentTypesById = React.useMemo(\n (): Record<string, ContentType> =>\n // Maps ID => Content Type\n props.space.getCachedContentTypes().reduce(\n (prev, ct) => ({\n ...prev,\n [ct.sys.id]: ct,\n }),\n {}\n ),\n [props.space]\n );\n\n const getTitle = React.useCallback(\n (entry: Entry) =>\n entityHelpers.getEntryTitle({\n entry,\n defaultTitle: 'Untitled',\n localeCode: props.localeCode,\n defaultLocaleCode: props.defaultLocaleCode,\n contentType: contentTypesById[entry.sys.contentType.sys.id],\n }),\n [props.localeCode, props.defaultLocaleCode, contentTypesById]\n );\n\n let conflicting: Link<'Entry', 'Link'>[] = [];\n if ('conflicting' in props.error) {\n conflicting = props.error.conflicting;\n }\n React.useEffect(() => {\n const entryIds = state.entries.map((entry) => entry.id);\n const conflictIds = conflicting.map((entry) => entry.sys.id);\n\n // Avoid unnecessary refetching\n if (conflictIds.every((id) => entryIds.includes(id))) {\n return;\n }\n\n setState((state) => ({ ...state, loading: true }));\n\n const query = {\n 'sys.id[in]': conflictIds.join(','),\n };\n\n props.space.getEntries<Entry>(query).then(({ items }) => {\n const entries = items.map((entry) => ({\n id: entry.sys.id,\n title: getTitle(entry),\n href: props.getEntryURL(entry),\n }));\n\n setState({\n loading: false,\n entries,\n });\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate these dependencies\n }, [getTitle, state.entries, conflicting, props.space.getEntries, props.getEntryURL]);\n\n return (\n <List className={styles.errorList} testId=\"validation-errors-uniqueness\">\n <ListItem className={styles.entryLink}>\n {state.loading ? (\n <div>Loading title for conflicting entry…</div>\n ) : (\n state.entries.map((entry) => (\n <TextLink\n key={entry.id}\n href={entry.href}\n icon={<ExternalLinkIcon />}\n alignIcon=\"end\"\n variant=\"negative\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {entry.title}\n </TextLink>\n ))\n )}\n </ListItem>\n </List>\n );\n}\n\nexport interface ValidationErrorsProps {\n field: FieldAPI;\n space: SpaceAPI;\n locales: LocalesAPI;\n getEntryURL: (entry: Entry) => string;\n}\n\nexport function ValidationErrors(props: ValidationErrorsProps) {\n const [errors, setErrors] = React.useState<ValidationError[]>([]);\n\n React.useEffect(() => {\n const onErrors = (errors?: ValidationError[]) => {\n setErrors(errors || []);\n };\n\n return props.field.onSchemaErrorsChanged(onErrors);\n }, [props.field]);\n\n if (errors.length === 0) {\n return null;\n }\n\n return (\n <List className={styles.errorList} testId=\"validation-errors\">\n {errors.map((error, index) => {\n return (\n <li\n key={index}\n role=\"status\"\n aria-roledescription=\"field-locale-schema\"\n data-error-code={`entry.schema.${error.name}`}\n className={styles.errorItem}>\n <InfoCircleIcon variant=\"negative\" />\n <div className={styles.errorMessage}>\n {error.message}\n {error.name === 'unique' && (\n <UniquenessError\n error={error}\n space={props.space}\n localeCode={props.field.locale}\n defaultLocaleCode={props.locales.default}\n getEntryURL={props.getEntryURL}\n />\n )}\n </div>\n </li>\n );\n })}\n </List>\n );\n}\n"],"names":["errorList","css","padding","wordWrap","marginTop","tokens","spacingS","color","red500","listStyleType","errorMessage","display","flexDirection","marginLeft","spacingXs","errorItem","alignItems","entryLink","fontWeight","Number","fontWeightDemiBold","UniquenessError","props","state","setState","React","useState","loading","entries","contentTypesById","useMemo","space","getCachedContentTypes","reduce","prev","ct","sys","id","getTitle","useCallback","entry","entityHelpers","getEntryTitle","defaultTitle","localeCode","defaultLocaleCode","contentType","conflicting","error","useEffect","entryIds","map","conflictIds","every","includes","query","join","getEntries","then","items","title","href","getEntryURL","List","className","styles","testId","ListItem","TextLink","key","icon","ExternalLinkIcon","alignIcon","variant","target","rel","ValidationErrors","errors","setErrors","onErrors","field","onSchemaErrorsChanged","length","index","role","name","InfoCircleIcon","message","locale","locales","default"],"mappings":";;;;;;;AAGO,MAAMA,SAAS,gBAAGC,GAAG,CAAC;AAC3BC,EAAAA,OAAO,EAAE,CADkB;AAE3BC,EAAAA,QAAQ,EAAE,YAFiB;AAG3BC,EAAAA,SAAS,EAAEC,MAAM,CAACC,QAHS;AAI3BC,EAAAA,KAAK,EAAEF,MAAM,CAACG,MAJa;AAK3BC,EAAAA,aAAa,EAAE;AALY,CAAD,CAArB;AAQA,MAAMC,YAAY,gBAAGT,GAAG,CAAC;AAC9BU,EAAAA,OAAO,EAAE,aADqB;AAE9BC,EAAAA,aAAa,EAAE,QAFe;AAG9BC,EAAAA,UAAU,EAAER,MAAM,CAACS;AAHW,CAAD,CAAxB;AAMA,MAAMC,SAAS,gBAAGd,GAAG,CAAC;AAC3BU,EAAAA,OAAO,EAAE,MADkB;AAE3BK,EAAAA,UAAU,EAAE;AAFe,CAAD,CAArB;AAKA,MAAMC,SAAS,gBAAGhB,GAAG,CAAC;AAC3BiB,EAAAA,UAAU,eAAEC,MAAM,CAACd,MAAM,CAACe,kBAAR;AADS,CAAD,CAArB;;ACEP,SAASC,eAAT,CAAyBC,KAAzB;AACE,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBC,KAAK,CAACC,QAAN,CAGvB;AACDC,IAAAA,OAAO,EAAE,IADR;AAEDC,IAAAA,OAAO,EAAE;AAFR,GAHuB,CAA1B;AAQA,QAAMC,gBAAgB,GAAGJ,KAAK,CAACK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AK,EAAEA;AACPjB,MAAAA,KAAK,EAAET,KAAK,CAACS;AACba,MAAAA,UAAU,EAAEtB,KAAK,CAAC0D,KAAN,CAAYQ;AACxB3C,MAAAA,iBAAiB,EAAEvB,KAAK,CAACmE,OAAN,CAAcC;AACjC5B,MAAAA,WAAW,EAAExC,KAAK,CAACwC;KALrB,CAHJ,CAPF,CADF;AAsBD,GAvBA,CADH,CADF;AA4BD;;;;"}
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./field-editor-validation-errors.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./field-editor-validation-errors.cjs.development.js')
8
- }