@contentful/field-editor-reference 4.3.8 → 4.3.11
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/CHANGELOG.md +14 -0
- package/dist/field-editor-reference.cjs.development.js +34 -36
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +34 -36
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.3.11](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.10...@contentful/field-editor-reference@4.3.11) (2022-06-30)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- search input styles [HOMER-1048] ([#1170](https://github.com/contentful/field-editors/issues/1170)) ([bc96fb9](https://github.com/contentful/field-editors/commit/bc96fb93bcca5508bdca38eafc8377878e97fb4b))
|
|
11
|
+
|
|
12
|
+
## [4.3.10](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.9...@contentful/field-editor-reference@4.3.10) (2022-06-22)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @contentful/field-editor-reference
|
|
15
|
+
|
|
16
|
+
## [4.3.9](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.8...@contentful/field-editor-reference@4.3.9) (2022-06-21)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @contentful/field-editor-reference
|
|
19
|
+
|
|
6
20
|
## [4.3.8](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.7...@contentful/field-editor-reference@4.3.8) (2022-06-15)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
|
@@ -9,8 +9,8 @@ var React__default = _interopDefault(React);
|
|
|
9
9
|
var emotion = require('emotion');
|
|
10
10
|
var tokens = _interopDefault(require('@contentful/f36-tokens'));
|
|
11
11
|
var get = _interopDefault(require('lodash/get'));
|
|
12
|
-
var f36Icons = require('@contentful/f36-icons');
|
|
13
12
|
var f36Components = require('@contentful/f36-components');
|
|
13
|
+
var f36Icons = require('@contentful/f36-icons');
|
|
14
14
|
var moment = _interopDefault(require('moment'));
|
|
15
15
|
var deepEqual = _interopDefault(require('deep-equal'));
|
|
16
16
|
var fieldEditorShared = require('@contentful/field-editor-shared');
|
|
@@ -115,20 +115,10 @@ var styles = {
|
|
|
115
115
|
position: 'relative',
|
|
116
116
|
padding: "0 " + tokens.spacing2Xs
|
|
117
117
|
}),
|
|
118
|
-
searchInput:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
borderRadius: parentHasDropdown ? 0 : undefined,
|
|
123
|
-
borderLeft: parentHasDropdown ? 'none' : undefined,
|
|
124
|
-
borderRight: parentHasDropdown ? 'none' : undefined,
|
|
125
|
-
paddingRight: tokens.spacing2Xl,
|
|
126
|
-
'::placeholder': {
|
|
127
|
-
color: tokens.gray600
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
},
|
|
118
|
+
searchInput: /*#__PURE__*/emotion.css({
|
|
119
|
+
paddingRight: tokens.spacingXl,
|
|
120
|
+
textOverflow: 'ellipsis'
|
|
121
|
+
}),
|
|
132
122
|
searchIcon: /*#__PURE__*/emotion.css({
|
|
133
123
|
position: 'absolute',
|
|
134
124
|
right: tokens.spacingM,
|
|
@@ -277,7 +267,7 @@ var CreateEntryMenuTrigger = function CreateEntryMenuTrigger(_ref) {
|
|
|
277
267
|
ref: textField,
|
|
278
268
|
className: styles.inputWrapper
|
|
279
269
|
}, React__default.createElement(f36Components.TextInput, {
|
|
280
|
-
className: styles.searchInput
|
|
270
|
+
className: styles.searchInput,
|
|
281
271
|
placeholder: "Search all content types",
|
|
282
272
|
testId: "add-entry-menu-search",
|
|
283
273
|
value: searchInput,
|
|
@@ -1548,7 +1538,8 @@ function useLinkActionsProps(props) {
|
|
|
1548
1538
|
slide: slide,
|
|
1549
1539
|
index: index
|
|
1550
1540
|
});
|
|
1551
|
-
},
|
|
1541
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1542
|
+
[entityType, props.onCreate, props.onAction]);
|
|
1552
1543
|
var onLinkedExisting = React.useCallback(function (entities, index) {
|
|
1553
1544
|
if (index === void 0) {
|
|
1554
1545
|
index = itemsLength;
|
|
@@ -1565,7 +1556,8 @@ function useLinkActionsProps(props) {
|
|
|
1565
1556
|
index: index === undefined ? undefined : index + i
|
|
1566
1557
|
});
|
|
1567
1558
|
});
|
|
1568
|
-
},
|
|
1559
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1560
|
+
[entityType, props.onLink, props.onAction]);
|
|
1569
1561
|
var onCreate = React.useCallback( /*#__PURE__*/function () {
|
|
1570
1562
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(contentTypeId, index) {
|
|
1571
1563
|
var _yield$createEntity, entity, slide;
|
|
@@ -1687,7 +1679,7 @@ function useLinkActionsProps(props) {
|
|
|
1687
1679
|
return function onLinkSeveralExisting(_x4) {
|
|
1688
1680
|
return _ref3.apply(this, arguments);
|
|
1689
1681
|
};
|
|
1690
|
-
}(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
|
|
1682
|
+
}(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
|
|
1691
1683
|
|
|
1692
1684
|
|
|
1693
1685
|
return React.useMemo(function () {
|
|
@@ -1707,7 +1699,9 @@ function useLinkActionsProps(props) {
|
|
|
1707
1699
|
onLinkedExisting: onLinkedExisting,
|
|
1708
1700
|
itemsLength: itemsLength
|
|
1709
1701
|
};
|
|
1710
|
-
},
|
|
1702
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1703
|
+
[entityType, canLinkMultiple, isDisabled, isEmpty, isFull, editorPermissions.canCreateEntity, editorPermissions.canLinkEntity, actionLabels, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1704
|
+
editorPermissions.creatableContentTypes.map(function (ct) {
|
|
1711
1705
|
return ct.sys.id;
|
|
1712
1706
|
}).join(':'), onCreate, onLinkExisting, onLinkSeveralExisting, onCreated, onLinkedExisting, itemsLength]);
|
|
1713
1707
|
}
|
|
@@ -1721,7 +1715,7 @@ function LinkEntityActions(_ref4) {
|
|
|
1721
1715
|
return renderLinkActions(props);
|
|
1722
1716
|
}
|
|
1723
1717
|
|
|
1724
|
-
// eslint-disable-next-line no-restricted-imports
|
|
1718
|
+
// eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
|
|
1725
1719
|
/**
|
|
1726
1720
|
* @param {Date|string} date A valid constructor argument for moment()
|
|
1727
1721
|
* @param {boolean=} short Render only Today/Tomorrow/Yesterday if valid. Defaults to false
|
|
@@ -1801,7 +1795,7 @@ var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
|
|
|
1801
1795
|
});
|
|
1802
1796
|
}); // This should only be ever called once. Following the eslint hint to add used
|
|
1803
1797
|
// dependencies will cause page freeze (infinite loop)
|
|
1804
|
-
// eslint-disable-next-line
|
|
1798
|
+
// eslint-disable-next-line -- TODO: describe this disable
|
|
1805
1799
|
}, []);
|
|
1806
1800
|
|
|
1807
1801
|
if (status.type === 'loading' || status.type === 'error') {
|
|
@@ -1997,7 +1991,7 @@ function useEntitiesStore(props) {
|
|
|
1997
1991
|
}
|
|
1998
1992
|
});
|
|
1999
1993
|
}
|
|
2000
|
-
});
|
|
1994
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2001
1995
|
}, [props.sdk, state.assets, state.entries]);
|
|
2002
1996
|
return _extends({
|
|
2003
1997
|
getOrLoadEntry: getOrLoadEntry,
|
|
@@ -2179,7 +2173,7 @@ function useContentTypePermissions(props) {
|
|
|
2179
2173
|
return _checkContentTypeAccess.apply(this, arguments);
|
|
2180
2174
|
}
|
|
2181
2175
|
|
|
2182
|
-
void checkContentTypeAccess();
|
|
2176
|
+
void checkContentTypeAccess(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2183
2177
|
}, [availableContentTypes]);
|
|
2184
2178
|
return {
|
|
2185
2179
|
creatableContentTypes: creatableContentTypes,
|
|
@@ -2191,7 +2185,7 @@ function useContentTypePermissions(props) {
|
|
|
2191
2185
|
function fromFieldValidations(field) {
|
|
2192
2186
|
var _field$items$validati, _field$items, _linkContentTypeValid, _linkMimetypeGroupVal;
|
|
2193
2187
|
|
|
2194
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2188
|
+
// eslint-disable-next-line -- TODO: describe this disable @typescript-eslint/no-explicit-any
|
|
2195
2189
|
var validations = [].concat(field.validations, (_field$items$validati = (_field$items = field.items) == null ? void 0 : _field$items.validations) != null ? _field$items$validati : []);
|
|
2196
2190
|
var linkContentTypeValidations = validations.find(function (v) {
|
|
2197
2191
|
return 'linkContentType' in v;
|
|
@@ -2319,7 +2313,7 @@ function useEditorPermissions(props) {
|
|
|
2319
2313
|
return _checkCreateAccess.apply(this, arguments);
|
|
2320
2314
|
}
|
|
2321
2315
|
|
|
2322
|
-
void checkCreateAccess();
|
|
2316
|
+
void checkCreateAccess(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2323
2317
|
}, [entityType, parameters.instance, creatableContentTypes]);
|
|
2324
2318
|
React.useEffect(function () {
|
|
2325
2319
|
if (parameters.instance.showLinkEntityAction === false) {
|
|
@@ -2381,7 +2375,7 @@ function useEditorPermissions(props) {
|
|
|
2381
2375
|
return _checkLinkAccess.apply(this, arguments);
|
|
2382
2376
|
}
|
|
2383
2377
|
|
|
2384
|
-
void checkLinkAccess();
|
|
2378
|
+
void checkLinkAccess(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2385
2379
|
}, [entityType, parameters.instance, readableContentTypes]);
|
|
2386
2380
|
return {
|
|
2387
2381
|
canCreateEntity: canCreateEntity,
|
|
@@ -2425,7 +2419,8 @@ function Editor(props) {
|
|
|
2425
2419
|
|
|
2426
2420
|
var customCardRenderer = React.useCallback(function (cardProps, _, renderDefaultCard) {
|
|
2427
2421
|
return props.renderCustomCard ? props.renderCustomCard(cardProps, linkActionsProps, renderDefaultCard) : false;
|
|
2428
|
-
},
|
|
2422
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2423
|
+
[linkActionsProps]);
|
|
2429
2424
|
|
|
2430
2425
|
if (!props.entityId) {
|
|
2431
2426
|
return React.createElement(LinkEntityActions, Object.assign({
|
|
@@ -2644,7 +2639,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2644
2639
|
entries = _useEntities.entries;
|
|
2645
2640
|
|
|
2646
2641
|
React.useEffect(function () {
|
|
2647
|
-
getOrLoadEntry(props.entryId);
|
|
2642
|
+
getOrLoadEntry(props.entryId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2648
2643
|
}, [props.entryId]);
|
|
2649
2644
|
var size = props.viewType === 'link' ? 'small' : 'default';
|
|
2650
2645
|
var entry = entries[props.entryId];
|
|
@@ -2702,7 +2697,8 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2702
2697
|
type: 'rendered',
|
|
2703
2698
|
entity: 'Entry'
|
|
2704
2699
|
});
|
|
2705
|
-
}
|
|
2700
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2701
|
+
|
|
2706
2702
|
}, [entry]);
|
|
2707
2703
|
return React.useMemo(function () {
|
|
2708
2704
|
if (entry === 'failed') {
|
|
@@ -2776,7 +2772,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2776
2772
|
}
|
|
2777
2773
|
}
|
|
2778
2774
|
|
|
2779
|
-
return renderDefaultCard();
|
|
2775
|
+
return renderDefaultCard(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2780
2776
|
}, [props, entityKey]);
|
|
2781
2777
|
}
|
|
2782
2778
|
|
|
@@ -2875,7 +2871,8 @@ function Editor$1(props) {
|
|
|
2875
2871
|
}));
|
|
2876
2872
|
var customCardRenderer = React.useCallback(function (cardProps, _, renderDefaultCard) {
|
|
2877
2873
|
return props.renderCustomCard ? props.renderCustomCard(cardProps, linkActionsProps, renderDefaultCard) : false;
|
|
2878
|
-
},
|
|
2874
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2875
|
+
[linkActionsProps]);
|
|
2879
2876
|
return React.createElement(React.Fragment, null, props.children(_extends({}, props, {
|
|
2880
2877
|
onSortStart: onSortStart,
|
|
2881
2878
|
onSortEnd: onSortEnd,
|
|
@@ -3046,7 +3043,7 @@ var styles$3 = {
|
|
|
3046
3043
|
};
|
|
3047
3044
|
var defaultProps$1 = {
|
|
3048
3045
|
isClickable: true
|
|
3049
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3046
|
+
}; // eslint-disable-next-line -- TODO: describe this disable @typescript-eslint/no-explicit-any
|
|
3050
3047
|
|
|
3051
3048
|
function getFileType(file) {
|
|
3052
3049
|
if (!file) {
|
|
@@ -3207,7 +3204,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3207
3204
|
assets = _useEntities.assets;
|
|
3208
3205
|
|
|
3209
3206
|
React.useEffect(function () {
|
|
3210
|
-
getOrLoadAsset(props.assetId);
|
|
3207
|
+
getOrLoadAsset(props.assetId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3211
3208
|
}, [props.assetId]);
|
|
3212
3209
|
var asset = assets[props.assetId];
|
|
3213
3210
|
var entityKey = asset === 'failed' ? 'failed' : asset === undefined ? 'undefined' : ":" + asset.sys.id + ":" + asset.sys.version;
|
|
@@ -3217,7 +3214,8 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3217
3214
|
type: 'rendered',
|
|
3218
3215
|
entity: 'Asset'
|
|
3219
3216
|
});
|
|
3220
|
-
}
|
|
3217
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3218
|
+
|
|
3221
3219
|
}, [asset]);
|
|
3222
3220
|
|
|
3223
3221
|
var onEdit = /*#__PURE__*/function () {
|
|
@@ -3349,7 +3347,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3349
3347
|
}
|
|
3350
3348
|
}
|
|
3351
3349
|
|
|
3352
|
-
return renderDefaultCard();
|
|
3350
|
+
return renderDefaultCard(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3353
3351
|
}, [props, entityKey]);
|
|
3354
3352
|
}
|
|
3355
3353
|
|