@contentful/field-editor-reference 4.0.1 → 4.0.5

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,30 @@
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.0.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.0.4...@contentful/field-editor-reference@4.0.5) (2021-11-27)
7
+
8
+ ### Bug Fixes
9
+
10
+ - correctly determine default widget ([#943](https://github.com/contentful/field-editors/issues/943)) ([4816929](https://github.com/contentful/field-editors/commit/4816929b33348f89a1eb8af9b1a5fe9fc5b98743))
11
+
12
+ ## [4.0.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.0.3...@contentful/field-editor-reference@4.0.4) (2021-11-26)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **references:** sort content types alphabetically ([#942](https://github.com/contentful/field-editors/issues/942)) ([3afb1ee](https://github.com/contentful/field-editors/commit/3afb1ee79e19b30f776d45790c482f60cd532fb3))
17
+
18
+ ## [4.0.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.0.2...@contentful/field-editor-reference@4.0.3) (2021-11-17)
19
+
20
+ ### Bug Fixes
21
+
22
+ - **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))
23
+
24
+ ## [4.0.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.0.1...@contentful/field-editor-reference@4.0.2) (2021-11-08)
25
+
26
+ ### Bug Fixes
27
+
28
+ - controllable combined link actions visibility ([e500cbb](https://github.com/contentful/field-editors/commit/e500cbbe01de4864eb15338095dc453bd339e4a9))
29
+
6
30
  ## [4.0.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.0.0...@contentful/field-editor-reference@4.0.1) (2021-11-08)
7
31
 
8
32
  ### Bug Fixes
@@ -335,6 +335,9 @@ var CreateEntryLinkButton = function CreateEntryLinkButton(_ref) {
335
335
  dropdownSettings = _ref.dropdownSettings,
336
336
  _ref$disabled = _ref.disabled,
337
337
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
338
+ contentTypes = contentTypes.sort(function (a, b) {
339
+ return a.name.localeCompare(b.name);
340
+ });
338
341
  var suggestedContentType = contentTypes.find(function (ct) {
339
342
  return ct.sys.id === suggestedContentTypeId;
340
343
  });
@@ -516,6 +519,10 @@ function CombinedEntryLinkActions(props) {
516
519
  }
517
520
 
518
521
  function CombinedAssetLinkActions(props) {
522
+ var _React$useState = React.useState(false),
523
+ isOpen = _React$useState[0],
524
+ setOpen = _React$useState[1];
525
+
519
526
  if (!props.canLinkEntity || !props.canCreateEntity) {
520
527
  if (props.canLinkEntity) {
521
528
  return React.createElement(f36Components.Button, {
@@ -550,7 +557,15 @@ function CombinedAssetLinkActions(props) {
550
557
  // that works without content types to cover asset use-case.
551
558
 
552
559
 
553
- return React.createElement(f36Components.Menu, null, React.createElement(f36Components.Menu.Trigger, null, React.createElement(f36Components.Button, {
560
+ return React.createElement(f36Components.Menu, {
561
+ isOpen: isOpen,
562
+ onClose: function onClose() {
563
+ setOpen(false);
564
+ },
565
+ onOpen: function onOpen() {
566
+ setOpen(true);
567
+ }
568
+ }, React.createElement(f36Components.Menu.Trigger, null, React.createElement(f36Components.Button, {
554
569
  endIcon: React.createElement(f36Icons.ChevronDownIcon, null),
555
570
  isDisabled: props.isDisabled,
556
571
  testId: testIds$1.actionsWrapper,
@@ -558,7 +573,7 @@ function CombinedAssetLinkActions(props) {
558
573
  variant: "secondary",
559
574
  startIcon: React.createElement(f36Icons.PlusIcon, null),
560
575
  size: "small"
561
- }, "Add media")), React.createElement(f36Components.Menu.List, {
576
+ }, "Add media")), isOpen && React.createElement(f36Components.Menu.List, {
562
577
  testId: testIds$1.dropdown
563
578
  }, React.createElement(f36Components.Menu.Item, {
564
579
  testId: testIds$1.linkExisting,