@contentful/field-editor-reference 4.3.9 → 4.3.10
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 +4 -0
- package/dist/field-editor-reference.cjs.development.js +28 -20
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +28 -20
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @contentful/field-editor-reference
|
|
9
|
+
|
|
6
10
|
## [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)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @contentful/field-editor-reference
|
|
@@ -1548,7 +1548,8 @@ function useLinkActionsProps(props) {
|
|
|
1548
1548
|
slide: slide,
|
|
1549
1549
|
index: index
|
|
1550
1550
|
});
|
|
1551
|
-
},
|
|
1551
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1552
|
+
[entityType, props.onCreate, props.onAction]);
|
|
1552
1553
|
var onLinkedExisting = React.useCallback(function (entities, index) {
|
|
1553
1554
|
if (index === void 0) {
|
|
1554
1555
|
index = itemsLength;
|
|
@@ -1565,7 +1566,8 @@ function useLinkActionsProps(props) {
|
|
|
1565
1566
|
index: index === undefined ? undefined : index + i
|
|
1566
1567
|
});
|
|
1567
1568
|
});
|
|
1568
|
-
},
|
|
1569
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1570
|
+
[entityType, props.onLink, props.onAction]);
|
|
1569
1571
|
var onCreate = React.useCallback( /*#__PURE__*/function () {
|
|
1570
1572
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(contentTypeId, index) {
|
|
1571
1573
|
var _yield$createEntity, entity, slide;
|
|
@@ -1687,7 +1689,7 @@ function useLinkActionsProps(props) {
|
|
|
1687
1689
|
return function onLinkSeveralExisting(_x4) {
|
|
1688
1690
|
return _ref3.apply(this, arguments);
|
|
1689
1691
|
};
|
|
1690
|
-
}(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
|
|
1692
|
+
}(); // FIXME: The memoization might rerun every time due to the always changing callback identities above
|
|
1691
1693
|
|
|
1692
1694
|
|
|
1693
1695
|
return React.useMemo(function () {
|
|
@@ -1707,7 +1709,9 @@ function useLinkActionsProps(props) {
|
|
|
1707
1709
|
onLinkedExisting: onLinkedExisting,
|
|
1708
1710
|
itemsLength: itemsLength
|
|
1709
1711
|
};
|
|
1710
|
-
},
|
|
1712
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1713
|
+
[entityType, canLinkMultiple, isDisabled, isEmpty, isFull, editorPermissions.canCreateEntity, editorPermissions.canLinkEntity, actionLabels, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
1714
|
+
editorPermissions.creatableContentTypes.map(function (ct) {
|
|
1711
1715
|
return ct.sys.id;
|
|
1712
1716
|
}).join(':'), onCreate, onLinkExisting, onLinkSeveralExisting, onCreated, onLinkedExisting, itemsLength]);
|
|
1713
1717
|
}
|
|
@@ -1721,7 +1725,7 @@ function LinkEntityActions(_ref4) {
|
|
|
1721
1725
|
return renderLinkActions(props);
|
|
1722
1726
|
}
|
|
1723
1727
|
|
|
1724
|
-
// eslint-disable-next-line no-restricted-imports
|
|
1728
|
+
// eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
|
|
1725
1729
|
/**
|
|
1726
1730
|
* @param {Date|string} date A valid constructor argument for moment()
|
|
1727
1731
|
* @param {boolean=} short Render only Today/Tomorrow/Yesterday if valid. Defaults to false
|
|
@@ -1801,7 +1805,7 @@ var ScheduledIconWithTooltip = function ScheduledIconWithTooltip(_ref) {
|
|
|
1801
1805
|
});
|
|
1802
1806
|
}); // This should only be ever called once. Following the eslint hint to add used
|
|
1803
1807
|
// dependencies will cause page freeze (infinite loop)
|
|
1804
|
-
// eslint-disable-next-line
|
|
1808
|
+
// eslint-disable-next-line -- TODO: describe this disable
|
|
1805
1809
|
}, []);
|
|
1806
1810
|
|
|
1807
1811
|
if (status.type === 'loading' || status.type === 'error') {
|
|
@@ -1997,7 +2001,7 @@ function useEntitiesStore(props) {
|
|
|
1997
2001
|
}
|
|
1998
2002
|
});
|
|
1999
2003
|
}
|
|
2000
|
-
});
|
|
2004
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2001
2005
|
}, [props.sdk, state.assets, state.entries]);
|
|
2002
2006
|
return _extends({
|
|
2003
2007
|
getOrLoadEntry: getOrLoadEntry,
|
|
@@ -2179,7 +2183,7 @@ function useContentTypePermissions(props) {
|
|
|
2179
2183
|
return _checkContentTypeAccess.apply(this, arguments);
|
|
2180
2184
|
}
|
|
2181
2185
|
|
|
2182
|
-
void checkContentTypeAccess();
|
|
2186
|
+
void checkContentTypeAccess(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2183
2187
|
}, [availableContentTypes]);
|
|
2184
2188
|
return {
|
|
2185
2189
|
creatableContentTypes: creatableContentTypes,
|
|
@@ -2191,7 +2195,7 @@ function useContentTypePermissions(props) {
|
|
|
2191
2195
|
function fromFieldValidations(field) {
|
|
2192
2196
|
var _field$items$validati, _field$items, _linkContentTypeValid, _linkMimetypeGroupVal;
|
|
2193
2197
|
|
|
2194
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2198
|
+
// eslint-disable-next-line -- TODO: describe this disable @typescript-eslint/no-explicit-any
|
|
2195
2199
|
var validations = [].concat(field.validations, (_field$items$validati = (_field$items = field.items) == null ? void 0 : _field$items.validations) != null ? _field$items$validati : []);
|
|
2196
2200
|
var linkContentTypeValidations = validations.find(function (v) {
|
|
2197
2201
|
return 'linkContentType' in v;
|
|
@@ -2319,7 +2323,7 @@ function useEditorPermissions(props) {
|
|
|
2319
2323
|
return _checkCreateAccess.apply(this, arguments);
|
|
2320
2324
|
}
|
|
2321
2325
|
|
|
2322
|
-
void checkCreateAccess();
|
|
2326
|
+
void checkCreateAccess(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2323
2327
|
}, [entityType, parameters.instance, creatableContentTypes]);
|
|
2324
2328
|
React.useEffect(function () {
|
|
2325
2329
|
if (parameters.instance.showLinkEntityAction === false) {
|
|
@@ -2381,7 +2385,7 @@ function useEditorPermissions(props) {
|
|
|
2381
2385
|
return _checkLinkAccess.apply(this, arguments);
|
|
2382
2386
|
}
|
|
2383
2387
|
|
|
2384
|
-
void checkLinkAccess();
|
|
2388
|
+
void checkLinkAccess(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2385
2389
|
}, [entityType, parameters.instance, readableContentTypes]);
|
|
2386
2390
|
return {
|
|
2387
2391
|
canCreateEntity: canCreateEntity,
|
|
@@ -2425,7 +2429,8 @@ function Editor(props) {
|
|
|
2425
2429
|
|
|
2426
2430
|
var customCardRenderer = React.useCallback(function (cardProps, _, renderDefaultCard) {
|
|
2427
2431
|
return props.renderCustomCard ? props.renderCustomCard(cardProps, linkActionsProps, renderDefaultCard) : false;
|
|
2428
|
-
},
|
|
2432
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2433
|
+
[linkActionsProps]);
|
|
2429
2434
|
|
|
2430
2435
|
if (!props.entityId) {
|
|
2431
2436
|
return React.createElement(LinkEntityActions, Object.assign({
|
|
@@ -2644,7 +2649,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2644
2649
|
entries = _useEntities.entries;
|
|
2645
2650
|
|
|
2646
2651
|
React.useEffect(function () {
|
|
2647
|
-
getOrLoadEntry(props.entryId);
|
|
2652
|
+
getOrLoadEntry(props.entryId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2648
2653
|
}, [props.entryId]);
|
|
2649
2654
|
var size = props.viewType === 'link' ? 'small' : 'default';
|
|
2650
2655
|
var entry = entries[props.entryId];
|
|
@@ -2702,7 +2707,8 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2702
2707
|
type: 'rendered',
|
|
2703
2708
|
entity: 'Entry'
|
|
2704
2709
|
});
|
|
2705
|
-
}
|
|
2710
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2711
|
+
|
|
2706
2712
|
}, [entry]);
|
|
2707
2713
|
return React.useMemo(function () {
|
|
2708
2714
|
if (entry === 'failed') {
|
|
@@ -2776,7 +2782,7 @@ function FetchingWrappedEntryCard(props) {
|
|
|
2776
2782
|
}
|
|
2777
2783
|
}
|
|
2778
2784
|
|
|
2779
|
-
return renderDefaultCard();
|
|
2785
|
+
return renderDefaultCard(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2780
2786
|
}, [props, entityKey]);
|
|
2781
2787
|
}
|
|
2782
2788
|
|
|
@@ -2875,7 +2881,8 @@ function Editor$1(props) {
|
|
|
2875
2881
|
}));
|
|
2876
2882
|
var customCardRenderer = React.useCallback(function (cardProps, _, renderDefaultCard) {
|
|
2877
2883
|
return props.renderCustomCard ? props.renderCustomCard(cardProps, linkActionsProps, renderDefaultCard) : false;
|
|
2878
|
-
},
|
|
2884
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
2885
|
+
[linkActionsProps]);
|
|
2879
2886
|
return React.createElement(React.Fragment, null, props.children(_extends({}, props, {
|
|
2880
2887
|
onSortStart: onSortStart,
|
|
2881
2888
|
onSortEnd: onSortEnd,
|
|
@@ -3046,7 +3053,7 @@ var styles$3 = {
|
|
|
3046
3053
|
};
|
|
3047
3054
|
var defaultProps$1 = {
|
|
3048
3055
|
isClickable: true
|
|
3049
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3056
|
+
}; // eslint-disable-next-line -- TODO: describe this disable @typescript-eslint/no-explicit-any
|
|
3050
3057
|
|
|
3051
3058
|
function getFileType(file) {
|
|
3052
3059
|
if (!file) {
|
|
@@ -3207,7 +3214,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3207
3214
|
assets = _useEntities.assets;
|
|
3208
3215
|
|
|
3209
3216
|
React.useEffect(function () {
|
|
3210
|
-
getOrLoadAsset(props.assetId);
|
|
3217
|
+
getOrLoadAsset(props.assetId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3211
3218
|
}, [props.assetId]);
|
|
3212
3219
|
var asset = assets[props.assetId];
|
|
3213
3220
|
var entityKey = asset === 'failed' ? 'failed' : asset === undefined ? 'undefined' : ":" + asset.sys.id + ":" + asset.sys.version;
|
|
@@ -3217,7 +3224,8 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3217
3224
|
type: 'rendered',
|
|
3218
3225
|
entity: 'Asset'
|
|
3219
3226
|
});
|
|
3220
|
-
}
|
|
3227
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3228
|
+
|
|
3221
3229
|
}, [asset]);
|
|
3222
3230
|
|
|
3223
3231
|
var onEdit = /*#__PURE__*/function () {
|
|
@@ -3349,7 +3357,7 @@ function FetchingWrappedAssetCard(props) {
|
|
|
3349
3357
|
}
|
|
3350
3358
|
}
|
|
3351
3359
|
|
|
3352
|
-
return renderDefaultCard();
|
|
3360
|
+
return renderDefaultCard(); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
|
|
3353
3361
|
}, [props, entityKey]);
|
|
3354
3362
|
}
|
|
3355
3363
|
|