@contentful/field-editor-reference 5.5.4 → 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,28 @@
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
+
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)
19
+
20
+ ### Bug Fixes
21
+
22
+ - solve multi ref drag issue [TOL-823] ([#1314](https://github.com/contentful/field-editors/issues/1314)) ([2d37f1c](https://github.com/contentful/field-editors/commit/2d37f1ca2b9a89710e7999278afcb492a069c8a8))
23
+
24
+ ### Features
25
+
26
+ - lower search and update width entry ref [TOL-247] ([#1313](https://github.com/contentful/field-editors/issues/1313)) ([ed6edbc](https://github.com/contentful/field-editors/commit/ed6edbc2ddce352d6ac7a7f8aced2129c4c2e5b4))
27
+
6
28
  ## [5.5.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.5.3...@contentful/field-editor-reference@5.5.4) (2022-12-23)
7
29
 
8
30
  **Note:** Version bump only for package @contentful/field-editor-reference
@@ -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 {};
@@ -8,9 +8,9 @@ var React = require('react');
8
8
  var React__default = _interopDefault(React);
9
9
  var emotion = require('emotion');
10
10
  var tokens = _interopDefault(require('@contentful/f36-tokens'));
11
- var get = _interopDefault(require('lodash/get'));
12
11
  var f36Components = require('@contentful/f36-components');
13
12
  var f36Icons = require('@contentful/f36-icons');
13
+ var get = _interopDefault(require('lodash/get'));
14
14
  var moment = _interopDefault(require('moment'));
15
15
  var fieldEditorShared = require('@contentful/field-editor-shared');
16
16
  var deepEqual = _interopDefault(require('deep-equal'));
@@ -197,7 +197,7 @@ var action = /*#__PURE__*/emotion.css({
197
197
  });
198
198
 
199
199
  /* eslint-disable @typescript-eslint/no-explicit-any */
200
- var MAX_ITEMS_WITHOUT_SEARCH = 20;
200
+ var MAX_ITEMS_WITHOUT_SEARCH = 5;
201
201
  var menuPlacementMap = {
202
202
  'bottom-left': 'bottom-start',
203
203
  'bottom-right': 'bottom-end'
@@ -403,7 +403,8 @@ var standardStyles = {
403
403
  var redesignStyles = /*#__PURE__*/_extends({}, standardStyles, {
404
404
  action: /*#__PURE__*/emotion.css({
405
405
  textDecoration: 'none',
406
- fontWeight: 'bold'
406
+ fontWeight: 'bold',
407
+ maxWidth: '300px'
407
408
  })
408
409
  });
409
410
 
@@ -1603,7 +1604,8 @@ function _selectMultipleEntities() {
1603
1604
  return _selectMultipleEntities.apply(this, arguments);
1604
1605
  }
1605
1606
 
1606
- var _excluded = ["renderCustomActions"];
1607
+ var _excluded = ["renderCustomActions"],
1608
+ _excluded2 = ["renderCustomActions"];
1607
1609
  function useLinkActionsProps(props) {
1608
1610
  var _editorPermissions$va;
1609
1611
 
@@ -1802,10 +1804,13 @@ function LinkEntityActions(_ref4) {
1802
1804
  var renderCustomActions = _ref4.renderCustomActions,
1803
1805
  props = _objectWithoutPropertiesLoose(_ref4, _excluded);
1804
1806
 
1805
- var renderLinkActions = renderCustomActions ? renderCustomActions : function (props) {
1806
- return React.createElement(LinkActions, _extends({}, props));
1807
- };
1808
- 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));
1809
1814
  }
1810
1815
 
1811
1816
  // eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
@@ -1924,7 +1929,7 @@ function AssetThumbnail(props) {
1924
1929
  }
1925
1930
 
1926
1931
  var _excluded$1 = ["priority"],
1927
- _excluded2 = ["children"];
1932
+ _excluded2$1 = ["children"];
1928
1933
 
1929
1934
  var globalQueue = /*#__PURE__*/new PQueue({
1930
1935
  concurrency: 50
@@ -2374,7 +2379,7 @@ function useResource(resourceType, urn, options) {
2374
2379
 
2375
2380
  function EntityProvider(_ref9) {
2376
2381
  var children = _ref9.children,
2377
- props = _objectWithoutPropertiesLoose(_ref9, _excluded2);
2382
+ props = _objectWithoutPropertiesLoose(_ref9, _excluded2$1);
2378
2383
 
2379
2384
  var reactQueryClient = React.useMemo(function () {
2380
2385
  var queryCache = new reactQuery.QueryCache();
@@ -3364,7 +3369,9 @@ var styles$3 = {
3364
3369
  position: 'relative'
3365
3370
  }),
3366
3371
  item: /*#__PURE__*/emotion.css({
3367
- marginBottom: tokens.spacingM
3372
+ marginBottom: tokens.spacingM,
3373
+ zIndex: tokens.zIndexModalContent // setting this to an index above 99 fixes dragged item disappearing issue
3374
+
3368
3375
  })
3369
3376
  };
3370
3377
 
@@ -4235,7 +4242,9 @@ function ResourceEditor(props) {
4235
4242
  onSortEnd: onSortEnd,
4236
4243
  onMove: onMove,
4237
4244
  onRemoteItemAtIndex: onRemoteItemAtIndex
4238
- })), React.createElement(CombinedLinkActions, _extends({}, linkActionsProps)));
4245
+ })), React.createElement(CombinedLinkEntityActions, _extends({}, linkActionsProps, {
4246
+ renderCustomActions: props.renderCustomActions
4247
+ })));
4239
4248
  } // provides memoized callbacks bound to a given item
4240
4249
 
4241
4250
 
@@ -4283,6 +4292,7 @@ function MultipleResourceReferenceEditor(props) {
4283
4292
  items: value || EMPTY_ARRAY,
4284
4293
  isDisabled: disabled,
4285
4294
  setValue: setValue,
4295
+ renderCustomActions: props.renderCustomActions,
4286
4296
  key: externalReset + "-list"
4287
4297
  }), function (editorProps) {
4288
4298
  return React.createElement(SortableLinkList, _extends({}, editorProps), function (_ref4) {
@@ -4341,8 +4351,9 @@ function SingleResourceReferenceEditor(props) {
4341
4351
  resourceLink: value,
4342
4352
  isDisabled: disabled,
4343
4353
  getEntryRouteHref: props.getEntryRouteHref
4344
- }) : // TODO: support custom actions once publicly available
4345
- React.createElement(CombinedLinkActions, _extends({}, linkActionsProps));
4354
+ }) : React.createElement(CombinedLinkEntityActions, _extends({}, linkActionsProps, {
4355
+ renderCustomActions: props.renderCustomActions
4356
+ }));
4346
4357
  }));
4347
4358
  }
4348
4359