@contentful/field-editor-reference 5.6.0 → 5.8.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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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
+ # [5.8.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.6.0...@contentful/field-editor-reference@5.8.0) (2023-01-11)
7
+
8
+ ### Features
9
+
10
+ - custom actions in resource reference editors [DANTE-793] ([#1317](https://github.com/contentful/field-editors/issues/1317)) ([9702049](https://github.com/contentful/field-editors/commit/97020490219033edce2f71635f098b76f8a1f4b4))
11
+
12
+ # [5.7.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.6.0...@contentful/field-editor-reference@5.7.0) (2023-01-11)
13
+
14
+ ### Features
15
+
16
+ - custom actions in resource reference editors [DANTE-793] ([#1317](https://github.com/contentful/field-editors/issues/1317)) ([9702049](https://github.com/contentful/field-editors/commit/97020490219033edce2f71635f098b76f8a1f4b4))
17
+
6
18
  # [5.6.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.5.4...@contentful/field-editor-reference@5.6.0) (2023-01-02)
7
19
 
8
20
  ### Bug Fixes
@@ -18,4 +18,7 @@ export declare function useLinkActionsProps(props: LinkEntityActionsProps): Link
18
18
  export declare function LinkEntityActions({ renderCustomActions, ...props }: LinkActionsProps & {
19
19
  renderCustomActions?: (props: LinkActionsProps) => React.ReactElement;
20
20
  }): JSX.Element;
21
+ export declare function CombinedLinkEntityActions({ renderCustomActions, ...props }: LinkActionsProps & {
22
+ renderCustomActions?: (props: LinkActionsProps) => React.ReactElement;
23
+ }): JSX.Element;
21
24
  export {};
@@ -1604,7 +1604,8 @@ function _selectMultipleEntities() {
1604
1604
  return _selectMultipleEntities.apply(this, arguments);
1605
1605
  }
1606
1606
 
1607
- var _excluded = ["renderCustomActions"];
1607
+ var _excluded = ["renderCustomActions"],
1608
+ _excluded2 = ["renderCustomActions"];
1608
1609
  function useLinkActionsProps(props) {
1609
1610
  var _editorPermissions$va;
1610
1611
 
@@ -1803,10 +1804,13 @@ function LinkEntityActions(_ref4) {
1803
1804
  var renderCustomActions = _ref4.renderCustomActions,
1804
1805
  props = _objectWithoutPropertiesLoose(_ref4, _excluded);
1805
1806
 
1806
- var renderLinkActions = renderCustomActions ? renderCustomActions : function (props) {
1807
- return React.createElement(LinkActions, _extends({}, props));
1808
- };
1809
- return renderLinkActions(props);
1807
+ return renderCustomActions ? renderCustomActions(props) : React.createElement(LinkActions, _extends({}, props));
1808
+ }
1809
+ function CombinedLinkEntityActions(_ref5) {
1810
+ var renderCustomActions = _ref5.renderCustomActions,
1811
+ props = _objectWithoutPropertiesLoose(_ref5, _excluded2);
1812
+
1813
+ return renderCustomActions ? renderCustomActions(props) : React.createElement(CombinedLinkActions, _extends({}, props));
1810
1814
  }
1811
1815
 
1812
1816
  // eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
@@ -1925,7 +1929,7 @@ function AssetThumbnail(props) {
1925
1929
  }
1926
1930
 
1927
1931
  var _excluded$1 = ["priority"],
1928
- _excluded2 = ["children"];
1932
+ _excluded2$1 = ["children"];
1929
1933
 
1930
1934
  var globalQueue = /*#__PURE__*/new PQueue({
1931
1935
  concurrency: 50
@@ -2375,7 +2379,7 @@ function useResource(resourceType, urn, options) {
2375
2379
 
2376
2380
  function EntityProvider(_ref9) {
2377
2381
  var children = _ref9.children,
2378
- props = _objectWithoutPropertiesLoose(_ref9, _excluded2);
2382
+ props = _objectWithoutPropertiesLoose(_ref9, _excluded2$1);
2379
2383
 
2380
2384
  var reactQueryClient = React.useMemo(function () {
2381
2385
  var queryCache = new reactQuery.QueryCache();
@@ -4238,7 +4242,9 @@ function ResourceEditor(props) {
4238
4242
  onSortEnd: onSortEnd,
4239
4243
  onMove: onMove,
4240
4244
  onRemoteItemAtIndex: onRemoteItemAtIndex
4241
- })), React.createElement(CombinedLinkActions, _extends({}, linkActionsProps)));
4245
+ })), React.createElement(CombinedLinkEntityActions, _extends({}, linkActionsProps, {
4246
+ renderCustomActions: props.renderCustomActions
4247
+ })));
4242
4248
  } // provides memoized callbacks bound to a given item
4243
4249
 
4244
4250
 
@@ -4286,6 +4292,7 @@ function MultipleResourceReferenceEditor(props) {
4286
4292
  items: value || EMPTY_ARRAY,
4287
4293
  isDisabled: disabled,
4288
4294
  setValue: setValue,
4295
+ renderCustomActions: props.renderCustomActions,
4289
4296
  key: externalReset + "-list"
4290
4297
  }), function (editorProps) {
4291
4298
  return React.createElement(SortableLinkList, _extends({}, editorProps), function (_ref4) {
@@ -4344,8 +4351,9 @@ function SingleResourceReferenceEditor(props) {
4344
4351
  resourceLink: value,
4345
4352
  isDisabled: disabled,
4346
4353
  getEntryRouteHref: props.getEntryRouteHref
4347
- }) : // TODO: support custom actions once publicly available
4348
- React.createElement(CombinedLinkActions, _extends({}, linkActionsProps));
4354
+ }) : React.createElement(CombinedLinkEntityActions, _extends({}, linkActionsProps, {
4355
+ renderCustomActions: props.renderCustomActions
4356
+ }));
4349
4357
  }));
4350
4358
  }
4351
4359