@contentful/field-editor-reference 4.0.0 → 4.0.4
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 +24 -0
- package/dist/field-editor-reference.cjs.development.js +18 -3
- 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 +18 -3
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +7 -7
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.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)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **references:** sort content types alphabetically ([#942](https://github.com/contentful/field-editors/issues/942)) ([3afb1ee](https://github.com/contentful/field-editors/commit/3afb1ee79e19b30f776d45790c482f60cd532fb3))
|
|
11
|
+
|
|
12
|
+
## [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)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **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))
|
|
17
|
+
|
|
18
|
+
## [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)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- controllable combined link actions visibility ([e500cbb](https://github.com/contentful/field-editors/commit/e500cbbe01de4864eb15338095dc453bd339e4a9))
|
|
23
|
+
|
|
24
|
+
## [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)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
- show create-entry-menu list only when it's open ([fa2371f](https://github.com/contentful/field-editors/commit/fa2371fbc05c7f172d90b8f3ec227782364a47d5))
|
|
29
|
+
|
|
6
30
|
# [4.0.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@3.0.0...@contentful/field-editor-reference@4.0.0) (2021-11-04)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @contentful/field-editor-reference
|
|
@@ -265,7 +265,7 @@ var CreateEntryMenuTrigger = function CreateEntryMenuTrigger(_ref) {
|
|
|
265
265
|
}, React__default.createElement(f36Components.Menu.Trigger, null, children({
|
|
266
266
|
isOpen: isOpen,
|
|
267
267
|
isSelecting: isSelecting
|
|
268
|
-
})), React__default.createElement(f36Components.Menu.List, {
|
|
268
|
+
})), isOpen && React__default.createElement(f36Components.Menu.List, {
|
|
269
269
|
className: styles.dropdownList,
|
|
270
270
|
style: {
|
|
271
271
|
width: dropdownWidth != undefined ? dropdownWidth + "px" : undefined,
|
|
@@ -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,
|
|
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,
|