@contentful/field-editor-validation-errors 1.1.11 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-validation-errors",
3
- "version": "1.1.11",
4
- "main": "dist/index.js",
5
- "module": "dist/field-editor-validation-errors.esm.js",
6
- "typings": "dist/index.d.ts",
3
+ "version": "1.3.0",
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.1.8",
41
+ "@contentful/field-editor-shared": "^1.3.0",
28
42
  "emotion": "^10.0.17"
29
43
  },
30
44
  "devDependencies": {
31
- "@contentful/field-editor-test-utils": "^1.2.7"
45
+ "@contentful/field-editor-test-utils": "^1.4.0"
32
46
  },
33
47
  "peerDependencies": {
34
48
  "react": ">=16.8.0"
35
49
  },
36
- "gitHead": "4fff7b9534374dcc44cb477240d369fc34f46415"
50
+ "gitHead": "543e02672a8dd4edc810f9f3568d6b69c454e1f9"
37
51
  }
package/CHANGELOG.md DELETED
@@ -1,198 +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.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)
7
-
8
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
9
-
10
- ## [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)
11
-
12
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
13
-
14
- ## [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)
15
-
16
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
17
-
18
- ## [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)
19
-
20
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
21
-
22
- ## [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)
23
-
24
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
25
-
26
- ## [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)
27
-
28
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
29
-
30
- ## [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)
31
-
32
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
33
-
34
- ## [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)
35
-
36
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
37
-
38
- ## [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)
39
-
40
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
41
-
42
- ## [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)
43
-
44
- ### Bug Fixes
45
-
46
- - bump f36 packages ([#1025](https://github.com/contentful/field-editors/issues/1025)) ([ec37a40](https://github.com/contentful/field-editors/commit/ec37a4000db7cd75c66dd9621136b2272c9feeea))
47
-
48
- ## [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)
49
-
50
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
51
-
52
- # [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)
53
-
54
- ### Features
55
-
56
- - 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))
57
-
58
- ## [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)
59
-
60
- ### Bug Fixes
61
-
62
- - markdown buttons ([#968](https://github.com/contentful/field-editors/issues/968)) ([9803b98](https://github.com/contentful/field-editors/commit/9803b98c25d92df6148686ffe2749a77f7efdbb9))
63
-
64
- ## [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)
65
-
66
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
67
-
68
- ## [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)
69
-
70
- ### Bug Fixes
71
-
72
- - **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))
73
-
74
- # [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)
75
-
76
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
77
-
78
- # [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)
79
-
80
- ### Features
81
-
82
- - Forma v4 components adoption ([#805](https://github.com/contentful/field-editors/issues/805)) ([526bde6](https://github.com/contentful/field-editors/commit/526bde6e10e0ee3789705ec10fb31489af7ca59e))
83
-
84
- ### BREAKING CHANGES
85
-
86
- - adopts a new Forma v4 beta
87
-
88
- ## [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)
89
-
90
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
91
-
92
- # [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)
93
-
94
- ### Features
95
-
96
- - [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))
97
-
98
- ## [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)
99
-
100
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
101
-
102
- ## [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)
103
-
104
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
105
-
106
- ## [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)
107
-
108
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
109
-
110
- ## [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)
111
-
112
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
113
-
114
- # [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)
115
-
116
- ### Features
117
-
118
- - 💡 new color tokens ([#778](https://github.com/contentful/field-editors/issues/778)) ([fba548d](https://github.com/contentful/field-editors/commit/fba548de32305016df7f2685634eefb14294828f))
119
-
120
- ## [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)
121
-
122
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
123
-
124
- ## [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)
125
-
126
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
127
-
128
- ## [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)
129
-
130
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
131
-
132
- ## [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)
133
-
134
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
135
-
136
- ## [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)
137
-
138
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
139
-
140
- ## [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)
141
-
142
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
143
-
144
- # [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)
145
-
146
- ### Features
147
-
148
- - bump min version of forma-36 ([#606](https://github.com/contentful/field-editors/issues/606)) ([fd57c7a](https://github.com/contentful/field-editors/commit/fd57c7a4312766af38c01507f17706ab22992617))
149
-
150
- ## [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)
151
-
152
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
153
-
154
- ## [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)
155
-
156
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
157
-
158
- # [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)
159
-
160
- ### Features
161
-
162
- - 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))
163
-
164
- # [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)
165
-
166
- ### Features
167
-
168
- - 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))
169
-
170
- ## [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)
171
-
172
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
173
-
174
- ## [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)
175
-
176
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
177
-
178
- ## [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)
179
-
180
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
181
-
182
- ## [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)
183
-
184
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
185
-
186
- ## [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)
187
-
188
- ### Bug Fixes
189
-
190
- - center vertical align of error items ([#396](https://github.com/contentful/field-editors/issues/396)) ([28de452](https://github.com/contentful/field-editors/commit/28de452c63a2d445549f78edce609c1e2266f96d))
191
-
192
- ## [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)
193
-
194
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
195
-
196
- ## [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)
197
-
198
- **Note:** Version bump only for package @contentful/field-editor-validation-errors
@@ -1,181 +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 fieldEditorShared = require('@contentful/field-editor-shared');
9
- var emotion = require('emotion');
10
- var tokens = _interopDefault(require('@contentful/f36-tokens'));
11
- var f36Components = require('@contentful/f36-components');
12
- var f36Icons = require('@contentful/f36-icons');
13
-
14
- function _extends() {
15
- _extends = Object.assign || function (target) {
16
- for (var i = 1; i < arguments.length; i++) {
17
- var source = arguments[i];
18
-
19
- for (var key in source) {
20
- if (Object.prototype.hasOwnProperty.call(source, key)) {
21
- target[key] = source[key];
22
- }
23
- }
24
- }
25
-
26
- return target;
27
- };
28
-
29
- return _extends.apply(this, arguments);
30
- }
31
-
32
- var errorList = /*#__PURE__*/emotion.css({
33
- padding: 0,
34
- wordWrap: 'break-word',
35
- marginTop: tokens.spacingS,
36
- color: tokens.red500,
37
- listStyleType: 'none'
38
- });
39
- var errorMessage = /*#__PURE__*/emotion.css({
40
- display: 'inline-flex',
41
- flexDirection: 'column',
42
- marginLeft: tokens.spacingXs
43
- });
44
- var errorItem = /*#__PURE__*/emotion.css({
45
- display: 'flex',
46
- alignItems: 'center'
47
- });
48
- var entryLink = /*#__PURE__*/emotion.css({
49
- fontWeight: /*#__PURE__*/Number(tokens.fontWeightDemiBold)
50
- });
51
-
52
- function UniquenessError(props) {
53
- var _React$useState = React.useState({
54
- loading: true,
55
- entries: []
56
- }),
57
- state = _React$useState[0],
58
- setState = _React$useState[1];
59
-
60
- var contentTypesById = React.useMemo(function () {
61
- return (// Maps ID => Content Type
62
- props.space.getCachedContentTypes().reduce(function (prev, ct) {
63
- var _extends2;
64
-
65
- return _extends({}, prev, (_extends2 = {}, _extends2[ct.sys.id] = ct, _extends2));
66
- }, {})
67
- );
68
- }, [props.space]);
69
- var getTitle = React.useCallback(function (entry) {
70
- return fieldEditorShared.entityHelpers.getEntryTitle({
71
- entry: entry,
72
- defaultTitle: 'Untitled',
73
- localeCode: props.localeCode,
74
- defaultLocaleCode: props.defaultLocaleCode,
75
- contentType: contentTypesById[entry.sys.contentType.sys.id]
76
- });
77
- }, [props.localeCode, props.defaultLocaleCode, contentTypesById]);
78
- var conflicting = [];
79
-
80
- if ('conflicting' in props.error) {
81
- conflicting = props.error.conflicting;
82
- }
83
-
84
- React.useEffect(function () {
85
- var entryIds = state.entries.map(function (entry) {
86
- return entry.id;
87
- });
88
- var conflictIds = conflicting.map(function (entry) {
89
- return entry.sys.id;
90
- }); // Avoid unnecessary refetching
91
-
92
- if (conflictIds.every(function (id) {
93
- return entryIds.includes(id);
94
- })) {
95
- return;
96
- }
97
-
98
- setState(function (state) {
99
- return _extends({}, state, {
100
- loading: true
101
- });
102
- });
103
- var query = {
104
- 'sys.id[in]': conflictIds.join(',')
105
- };
106
- props.space.getEntries(query).then(function (_ref) {
107
- var items = _ref.items;
108
- var entries = items.map(function (entry) {
109
- return {
110
- id: entry.sys.id,
111
- title: getTitle(entry),
112
- href: props.getEntryURL(entry)
113
- };
114
- });
115
- setState({
116
- loading: false,
117
- entries: entries
118
- });
119
- }); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate these dependencies
120
- }, [getTitle, state.entries, conflicting, props.space.getEntries, props.getEntryURL]);
121
- return React.createElement(f36Components.List, {
122
- className: errorList,
123
- testId: "validation-errors-uniqueness"
124
- }, React.createElement(f36Components.ListItem, {
125
- className: entryLink
126
- }, state.loading ? React.createElement("div", null, "Loading title for conflicting entry\u2026") : state.entries.map(function (entry) {
127
- return React.createElement(f36Components.TextLink, {
128
- key: entry.id,
129
- href: entry.href,
130
- icon: React.createElement(f36Icons.ExternalLinkIcon, null),
131
- alignIcon: "end",
132
- variant: "negative",
133
- target: "_blank",
134
- rel: "noopener noreferrer"
135
- }, entry.title);
136
- })));
137
- }
138
-
139
- function ValidationErrors(props) {
140
- var _React$useState2 = React.useState([]),
141
- errors = _React$useState2[0],
142
- setErrors = _React$useState2[1];
143
-
144
- React.useEffect(function () {
145
- var onErrors = function onErrors(errors) {
146
- setErrors(errors || []);
147
- };
148
-
149
- return props.field.onSchemaErrorsChanged(onErrors);
150
- }, [props.field]);
151
-
152
- if (errors.length === 0) {
153
- return null;
154
- }
155
-
156
- return React.createElement(f36Components.List, {
157
- className: errorList,
158
- testId: "validation-errors"
159
- }, errors.map(function (error, index) {
160
- return React.createElement("li", {
161
- key: index,
162
- role: "status",
163
- "aria-roledescription": "field-locale-schema",
164
- "data-error-code": "entry.schema." + error.name,
165
- className: errorItem
166
- }, React.createElement(f36Icons.InfoCircleIcon, {
167
- variant: "negative"
168
- }), React.createElement("div", {
169
- className: errorMessage
170
- }, error.message, error.name === 'unique' && React.createElement(UniquenessError, {
171
- error: error,
172
- space: props.space,
173
- localeCode: props.field.locale,
174
- defaultLocaleCode: props.locales["default"],
175
- getEntryURL: props.getEntryURL
176
- })));
177
- }));
178
- }
179
-
180
- exports.ValidationErrors = ValidationErrors;
181
- //# 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 { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\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';\nimport { ValidationError, Link } from '@contentful/app-sdk';\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\nimport { TextLink, List, ListItem } from '@contentful/f36-components';\n\nimport { ExternalLinkIcon, InfoCircleIcon } from '@contentful/f36-icons';\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","React","useState","loading","entries","state","setState","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,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,IAAMC,YAAY,gBAAGT,WAAG,CAAC;AAC9BU,EAAAA,OAAO,EAAE,aADqB;AAE9BC,EAAAA,aAAa,EAAE,QAFe;AAG9BC,EAAAA,UAAU,EAAER,MAAM,CAACS;AAHW,CAAD,CAAxB;AAMA,IAAMC,SAAS,gBAAGd,WAAG,CAAC;AAC3BU,EAAAA,OAAO,EAAE,MADkB;AAE3BK,EAAAA,UAAU,EAAE;AAFe,CAAD,CAArB;AAKA,IAAMC,SAAS,gBAAGhB,WAAG,CAAC;AAC3BiB,EAAAA,UAAU,eAAEC,MAAM,CAACd,MAAM,CAACe,kBAAR;AADS,CAAD,CAArB;;ACGP,SAASC,eAAT,CAAyBC,KAAzB;AACE,wBAA0BC,KAAK,CAACC,QAAN,CAGvB;AACDC,I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AACE8C,MAAAA,GAAG,EAAEc;AACLC,MAAAA,IAAI,EAAC;8BACgB;2CACYpC,KAAK,CAACqC;AACvCrB,MAAAA,SAAS,EAAEC;KALb,EAME1C,mBAAA,CAAC+D,uBAAD;AAAgBb,MAAAA,OAAO,EAAC;KAAxB,CANF,EAOElD,mBAAA,MAAA;AAAKyC,MAAAA,SAAS,EAAEC;KAAhB,EACGjB,KAAK,CAACuC,OADT,EAEGvC,KAAK,CAACqC,IAAN,KAAe,QAAf,IACC9D,mBAAA,CAACF,eAAD;AACE2B,MAAAA,KAAK,EAAEA;AACPjB,MAAAA,KAAK,EAAET,KAAK,CAACS;AACba,MAAAA,UAAU,EAAEtB,KAAK,CAAC0D,KAAN,CAAYQ;AACxB3C,MAAAA,iBAAiB,EAAEvB,KAAK,CAACmE,OAAN;AACnB3B,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/field-editor-shared"),r=require("emotion"),i=e(require("@contentful/f36-tokens")),a=require("@contentful/f36-components"),o=require("@contentful/f36-icons");function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=r.css({padding:0,wordWrap:"break-word",marginTop:i.spacingS,color:i.red500,listStyleType:"none"}),s=r.css({display:"inline-flex",flexDirection:"column",marginLeft:i.spacingXs}),u=r.css({display:"flex",alignItems:"center"}),f=r.css({fontWeight:Number(i.fontWeightDemiBold)});function d(e){var r=t.useState({loading:!0,entries:[]}),i=r[0],s=r[1],u=t.useMemo((function(){return e.space.getCachedContentTypes().reduce((function(e,t){var n;return l({},e,((n={})[t.sys.id]=t,n))}),{})}),[e.space]),d=t.useCallback((function(t){return n.entityHelpers.getEntryTitle({entry:t,defaultTitle:"Untitled",localeCode:e.localeCode,defaultLocaleCode:e.defaultLocaleCode,contentType:u[t.sys.contentType.sys.id]})}),[e.localeCode,e.defaultLocaleCode,u]),m=[];return"conflicting"in e.error&&(m=e.error.conflicting),t.useEffect((function(){var t=i.entries.map((function(e){return e.id})),n=m.map((function(e){return e.sys.id}));if(!n.every((function(e){return t.includes(e)}))){s((function(e){return l({},e,{loading:!0})}));var r={"sys.id[in]":n.join(",")};e.space.getEntries(r).then((function(t){var n=t.items.map((function(t){return{id:t.sys.id,title:d(t),href:e.getEntryURL(t)}}));s({loading:!1,entries:n})}))}}),[d,i.entries,m,e.space.getEntries,e.getEntryURL]),t.createElement(a.List,{className:c,testId:"validation-errors-uniqueness"},t.createElement(a.ListItem,{className:f},i.loading?t.createElement("div",null,"Loading title for conflicting entry…"):i.entries.map((function(e){return t.createElement(a.TextLink,{key:e.id,href:e.href,icon:t.createElement(o.ExternalLinkIcon,null),alignIcon:"end",variant:"negative",target:"_blank",rel:"noopener noreferrer"},e.title)}))))}exports.ValidationErrors=function(e){var n=t.useState([]),r=n[0],i=n[1];return t.useEffect((function(){return e.field.onSchemaErrorsChanged((function(e){i(e||[])}))}),[e.field]),0===r.length?null:t.createElement(a.List,{className:c,testId:"validation-errors"},r.map((function(n,r){return t.createElement("li",{key:r,role:"status","aria-roledescription":"field-locale-schema","data-error-code":"entry.schema."+n.name,className:u},t.createElement(o.InfoCircleIcon,{variant:"negative"}),t.createElement("div",{className:s},n.message,"unique"===n.name&&t.createElement(d,{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 { css } from 'emotion';\nimport tokens from '@contentful/f36-tokens';\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';\nimport { ValidationError, Link } from '@contentful/app-sdk';\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\nimport { TextLink, List, ListItem } from '@contentful/f36-components';\n\nimport { ExternalLinkIcon, InfoCircleIcon } from '@contentful/f36-icons';\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","React","useState","loading","entries","state","setState","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"],"mappings":"uiBAGO,IAAMA,EAAYC,MAAI,CAC3BC,QAAS,EACTC,SAAU,aACVC,UAAWC,EAAOC,SAClBC,MAAOF,EAAOG,OACdC,cAAe,SAGJC,EAAeT,MAAI,CAC9BU,QAAS,cACTC,cAAe,SACfC,WAAYR,EAAOS,YAGRC,EAAYd,MAAI,CAC3BU,QAAS,OACTK,WAAY,WAGDC,EAAYhB,MAAI,CAC3BiB,WAAYC,OAAOd,EAAOe,sBCE5B,SAASC,EAAgBC,SACGC,EAAMC,SAG7B,CACDC,SAAS,EACTC,QAAS,KALJC,OAAOC,OAQRC,EAAmBN,EAAMO,SAC7B,kBAEER,EAAMS,MAAMC,wBAAwBC,QAClC,SAACC,EAAMC,qBACFD,UACFC,EAAGC,IAAIC,IAAKF,QAEf,MAEJ,CAACb,EAAMS,QAGHO,EAAWf,EAAMgB,aACrB,SAACC,UACCC,gBAAcC,cAAc,CAC1BF,MAAAA,EACAG,aAAc,WACdC,WAAYtB,EAAMsB,WAClBC,kBAAmBvB,EAAMuB,kBACzBC,YAAajB,EAAiBW,EAA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