@contentful/field-editor-reference 5.21.2 → 5.21.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.
Files changed (136) hide show
  1. package/dist/cjs/__fixtures__/asset/index.js +5 -5
  2. package/dist/cjs/__fixtures__/content-type/index.js +1 -1
  3. package/dist/cjs/__fixtures__/entry/index.js +4 -4
  4. package/dist/cjs/__fixtures__/fixtures.js +5 -5
  5. package/dist/cjs/__fixtures__/locale/index.js +2 -2
  6. package/dist/cjs/__fixtures__/space/index.js +1 -1
  7. package/dist/cjs/assets/MultipleMediaEditor.js +4 -4
  8. package/dist/cjs/assets/SingleMediaEditor.js +3 -3
  9. package/dist/cjs/assets/WrappedAssetCard/AssetCardActions.js +13 -13
  10. package/dist/cjs/assets/WrappedAssetCard/FetchingWrappedAssetCard.js +7 -12
  11. package/dist/cjs/assets/WrappedAssetCard/WrappedAssetCard.js +9 -16
  12. package/dist/cjs/assets/WrappedAssetCard/WrappedAssetLink.js +7 -8
  13. package/dist/cjs/common/EntityStore.js +6 -23
  14. package/dist/cjs/common/MultipleReferenceEditor.js +7 -14
  15. package/dist/cjs/common/ReferenceEditor.js +4 -4
  16. package/dist/cjs/common/SingleReferenceEditor.js +5 -7
  17. package/dist/cjs/common/SortableLinkList.js +9 -9
  18. package/dist/cjs/common/customCardTypes.js +1 -1
  19. package/dist/cjs/common/queryClient.js +3 -6
  20. package/dist/cjs/common/useContentTypePermissions.js +0 -2
  21. package/dist/cjs/common/useEditorPermissions.js +0 -12
  22. package/dist/cjs/common/useEditorPermissions.spec.js +0 -1
  23. package/dist/cjs/components/AssetThumbnail/AssetThumbnail.js +2 -2
  24. package/dist/cjs/components/CreateEntryLinkButton/CreateEntryLinkButton.js +7 -9
  25. package/dist/cjs/components/CreateEntryLinkButton/CreateEntryLinkButton.spec.js +14 -14
  26. package/dist/cjs/components/CreateEntryLinkButton/CreateEntryMenuTrigger.js +16 -24
  27. package/dist/cjs/components/CreateEntryLinkButton/CreateEntryMenuTrigger.spec.js +11 -11
  28. package/dist/cjs/components/LinkActions/CombinedLinkActions.js +20 -25
  29. package/dist/cjs/components/LinkActions/LinkActions.js +11 -11
  30. package/dist/cjs/components/LinkActions/LinkEntityActions.js +8 -15
  31. package/dist/cjs/components/LinkActions/NoLinkPermissionsInfo.js +2 -2
  32. package/dist/cjs/components/LinkActions/helpers.js +0 -9
  33. package/dist/cjs/components/LinkActions/redesignStyles.js +1 -1
  34. package/dist/cjs/components/LinkActions/styles.js +1 -1
  35. package/dist/cjs/components/MissingEntityCard/MissingEntityCard.js +8 -8
  36. package/dist/cjs/components/ResourceEntityErrorCard/ResourceEntityErrorCard.js +3 -3
  37. package/dist/cjs/components/ResourceEntityErrorCard/UnsupportedEntityCard.js +3 -3
  38. package/dist/cjs/components/ScheduledIconWithTooltip/ScheduleTooltip.js +2 -2
  39. package/dist/cjs/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.js +2 -5
  40. package/dist/cjs/components/ScheduledIconWithTooltip/formatDateAndTime.js +1 -2
  41. package/dist/cjs/components/SpaceName/SpaceName.js +6 -6
  42. package/dist/cjs/entries/MultipleEntryReferenceEditor.js +4 -4
  43. package/dist/cjs/entries/SingleEntryReferenceEditor.js +3 -3
  44. package/dist/cjs/entries/WrappedEntryCard/FetchingWrappedEntryCard.js +7 -14
  45. package/dist/cjs/entries/WrappedEntryCard/WrappedEntryCard.js +14 -18
  46. package/dist/cjs/resources/Cards/ContentfulEntryCard.js +2 -9
  47. package/dist/cjs/resources/Cards/ResourceCard.js +8 -10
  48. package/dist/cjs/resources/Cards/ResourceCard.spec.js +7 -8
  49. package/dist/cjs/resources/MultipleResourceReferenceEditor.js +11 -12
  50. package/dist/cjs/resources/MultipleResourceReferenceEditor.spec.js +8 -27
  51. package/dist/cjs/resources/SingleResourceReferenceEditor.js +6 -6
  52. package/dist/cjs/resources/SingleResourceReferenceEditor.spec.js +5 -10
  53. package/dist/cjs/resources/testHelpers/resourceEditorHelpers.js +0 -7
  54. package/dist/cjs/resources/useResourceLinkActions.js +1 -10
  55. package/dist/cjs/utils/fromFieldValidations.js +1 -2
  56. package/dist/cjs/utils/useSortIDs.js +1 -1
  57. package/dist/esm/assets/MultipleMediaEditor.js +3 -3
  58. package/dist/esm/assets/SingleMediaEditor.js +2 -2
  59. package/dist/esm/assets/WrappedAssetCard/AssetCardActions.js +10 -10
  60. package/dist/esm/assets/WrappedAssetCard/FetchingWrappedAssetCard.js +6 -11
  61. package/dist/esm/assets/WrappedAssetCard/WrappedAssetCard.js +6 -14
  62. package/dist/esm/assets/WrappedAssetCard/WrappedAssetLink.js +5 -6
  63. package/dist/esm/common/EntityStore.js +3 -20
  64. package/dist/esm/common/MultipleReferenceEditor.js +6 -13
  65. package/dist/esm/common/ReferenceEditor.js +2 -2
  66. package/dist/esm/common/SingleReferenceEditor.js +4 -6
  67. package/dist/esm/common/SortableLinkList.js +7 -7
  68. package/dist/esm/common/queryClient.js +3 -10
  69. package/dist/esm/common/useContentTypePermissions.js +0 -2
  70. package/dist/esm/common/useEditorPermissions.js +0 -12
  71. package/dist/esm/common/useEditorPermissions.spec.js +0 -1
  72. package/dist/esm/components/AssetThumbnail/AssetThumbnail.js +1 -1
  73. package/dist/esm/components/CreateEntryLinkButton/CreateEntryLinkButton.js +4 -6
  74. package/dist/esm/components/CreateEntryLinkButton/CreateEntryLinkButton.spec.js +12 -12
  75. package/dist/esm/components/CreateEntryLinkButton/CreateEntryMenuTrigger.js +13 -21
  76. package/dist/esm/components/CreateEntryLinkButton/CreateEntryMenuTrigger.spec.js +8 -9
  77. package/dist/esm/components/LinkActions/CombinedLinkActions.js +19 -30
  78. package/dist/esm/components/LinkActions/LinkActions.js +9 -9
  79. package/dist/esm/components/LinkActions/LinkEntityActions.js +7 -14
  80. package/dist/esm/components/LinkActions/NoLinkPermissionsInfo.js +1 -1
  81. package/dist/esm/components/LinkActions/helpers.js +0 -9
  82. package/dist/esm/components/MissingEntityCard/MissingEntityCard.js +6 -6
  83. package/dist/esm/components/ResourceEntityErrorCard/ResourceEntityErrorCard.js +2 -2
  84. package/dist/esm/components/ResourceEntityErrorCard/UnsupportedEntityCard.js +2 -2
  85. package/dist/esm/components/ScheduledIconWithTooltip/ScheduleTooltip.js +1 -1
  86. package/dist/esm/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.js +1 -4
  87. package/dist/esm/components/ScheduledIconWithTooltip/formatDateAndTime.js +2 -11
  88. package/dist/esm/components/SpaceName/SpaceName.js +4 -4
  89. package/dist/esm/entries/MultipleEntryReferenceEditor.js +3 -3
  90. package/dist/esm/entries/SingleEntryReferenceEditor.js +2 -2
  91. package/dist/esm/entries/WrappedEntryCard/FetchingWrappedEntryCard.js +5 -12
  92. package/dist/esm/entries/WrappedEntryCard/WrappedEntryCard.js +12 -16
  93. package/dist/esm/resources/Cards/ContentfulEntryCard.js +1 -8
  94. package/dist/esm/resources/Cards/ResourceCard.js +7 -9
  95. package/dist/esm/resources/Cards/ResourceCard.spec.js +2 -3
  96. package/dist/esm/resources/MultipleResourceReferenceEditor.js +8 -9
  97. package/dist/esm/resources/MultipleResourceReferenceEditor.spec.js +7 -26
  98. package/dist/esm/resources/SingleResourceReferenceEditor.js +4 -4
  99. package/dist/esm/resources/SingleResourceReferenceEditor.spec.js +4 -9
  100. package/dist/esm/resources/testHelpers/resourceEditorHelpers.js +0 -7
  101. package/dist/esm/resources/useResourceLinkActions.js +1 -10
  102. package/dist/esm/utils/fromFieldValidations.js +0 -1
  103. package/dist/types/assets/MultipleMediaEditor.d.ts +2 -2
  104. package/dist/types/assets/SingleMediaEditor.d.ts +2 -2
  105. package/dist/types/assets/WrappedAssetCard/AssetCardActions.d.ts +3 -3
  106. package/dist/types/assets/WrappedAssetCard/FetchingWrappedAssetCard.d.ts +2 -2
  107. package/dist/types/assets/WrappedAssetCard/WrappedAssetCard.d.ts +2 -2
  108. package/dist/types/assets/WrappedAssetCard/WrappedAssetLink.d.ts +2 -2
  109. package/dist/types/common/EntityStore.d.ts +1 -1
  110. package/dist/types/common/MultipleReferenceEditor.d.ts +1 -1
  111. package/dist/types/common/ReferenceEditor.d.ts +1 -1
  112. package/dist/types/common/SingleReferenceEditor.d.ts +1 -1
  113. package/dist/types/common/SortableLinkList.d.ts +1 -1
  114. package/dist/types/common/queryClient.d.ts +1 -1
  115. package/dist/types/components/AssetThumbnail/AssetThumbnail.d.ts +2 -2
  116. package/dist/types/components/CreateEntryLinkButton/CreateEntryLinkButton.d.ts +1 -1
  117. package/dist/types/components/CreateEntryLinkButton/CreateEntryMenuTrigger.d.ts +1 -1
  118. package/dist/types/components/LinkActions/CombinedLinkActions.d.ts +2 -2
  119. package/dist/types/components/LinkActions/LinkActions.d.ts +1 -1
  120. package/dist/types/components/LinkActions/LinkEntityActions.d.ts +2 -2
  121. package/dist/types/components/LinkActions/NoLinkPermissionsInfo.d.ts +2 -2
  122. package/dist/types/components/MissingEntityCard/MissingEntityCard.d.ts +2 -2
  123. package/dist/types/components/ResourceEntityErrorCard/ResourceEntityErrorCard.d.ts +2 -2
  124. package/dist/types/components/ResourceEntityErrorCard/UnsupportedEntityCard.d.ts +2 -2
  125. package/dist/types/components/ScheduledIconWithTooltip/ScheduleTooltip.d.ts +1 -1
  126. package/dist/types/components/ScheduledIconWithTooltip/ScheduledIconWithTooltip.d.ts +1 -1
  127. package/dist/types/components/SpaceName/SpaceName.d.ts +2 -2
  128. package/dist/types/entries/MultipleEntryReferenceEditor.d.ts +2 -2
  129. package/dist/types/entries/SingleEntryReferenceEditor.d.ts +2 -2
  130. package/dist/types/entries/WrappedEntryCard/FetchingWrappedEntryCard.d.ts +2 -2
  131. package/dist/types/entries/WrappedEntryCard/WrappedEntryCard.d.ts +1 -1
  132. package/dist/types/resources/Cards/ContentfulEntryCard.d.ts +2 -2
  133. package/dist/types/resources/Cards/ResourceCard.d.ts +2 -2
  134. package/dist/types/resources/MultipleResourceReferenceEditor.d.ts +2 -2
  135. package/dist/types/resources/SingleResourceReferenceEditor.d.ts +2 -2
  136. package/package.json +8 -5
@@ -8,13 +8,13 @@ Object.defineProperty(exports, "CombinedLinkActions", {
8
8
  return CombinedLinkActions;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
13
  const _f36icons = require("@contentful/f36-icons");
14
14
  const _CreateEntryLinkButton = require("../CreateEntryLinkButton/CreateEntryLinkButton");
15
15
  const _LinkActions = require("./LinkActions");
16
16
  const _NoLinkPermissionsInfo = require("./NoLinkPermissionsInfo");
17
- const _redesignStyles = /*#__PURE__*/ _interop_require_wildcard(require("./redesignStyles"));
17
+ const _redesignStyles = _interop_require_wildcard(require("./redesignStyles"));
18
18
  function _getRequireWildcardCache(nodeInterop) {
19
19
  if (typeof WeakMap !== "function") return null;
20
20
  var cacheBabelInterop = new WeakMap();
@@ -62,19 +62,16 @@ const testIds = {
62
62
  };
63
63
  function CombinedLinkActions(props) {
64
64
  if (props.isFull) {
65
- return null; // Don't render link actions if we reached max allowed links.
65
+ return null;
66
66
  }
67
- // We don't want to render a spacious container in case there are are already
68
- // assets linked (in case of entries, always show it) as the border wouldn't be
69
- // nicely aligned with asset cards.
70
67
  const hideEmptyCard = props.entityType === 'Asset' && !props.isEmpty;
71
- return /*#__PURE__*/ _react.createElement("div", {
68
+ return _react.createElement("div", {
72
69
  className: hideEmptyCard ? '' : _redesignStyles.container
73
- }, !props.canCreateEntity && !props.canLinkEntity && /*#__PURE__*/ _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null), props.entityType === 'Entry' && /*#__PURE__*/ _react.createElement(CombinedEntryLinkActions, props), props.entityType === 'Asset' && /*#__PURE__*/ _react.createElement(CombinedAssetLinkActions, props));
70
+ }, !props.canCreateEntity && !props.canLinkEntity && _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null), props.entityType === 'Entry' && _react.createElement(CombinedEntryLinkActions, props), props.entityType === 'Asset' && _react.createElement(CombinedAssetLinkActions, props));
74
71
  }
75
72
  function CombinedEntryLinkActions(props) {
76
73
  if (props.canCreateEntity) {
77
- return /*#__PURE__*/ _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
74
+ return _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
78
75
  testId: testIds.actionsWrapper,
79
76
  disabled: props.isDisabled,
80
77
  text: props.combinedActionsLabel || 'Add content',
@@ -87,7 +84,7 @@ function CombinedEntryLinkActions(props) {
87
84
  onSelect: (contentTypeId)=>{
88
85
  return contentTypeId ? props.onCreate(contentTypeId) : Promise.resolve();
89
86
  },
90
- customDropdownItems: props.canLinkEntity ? /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
87
+ customDropdownItems: props.canLinkEntity ? _react.createElement(_f36components.Menu.Item, {
91
88
  testId: testIds.linkExisting,
92
89
  onClick: ()=>{
93
90
  props.onLinkExisting();
@@ -95,7 +92,7 @@ function CombinedEntryLinkActions(props) {
95
92
  }, "Add existing content") : undefined
96
93
  });
97
94
  } else if (props.canLinkEntity) {
98
- return /*#__PURE__*/ _react.createElement(_f36components.Button, {
95
+ return _react.createElement(_f36components.Button, {
99
96
  isDisabled: props.isDisabled,
100
97
  testId: testIds.linkExisting,
101
98
  className: _redesignStyles.action,
@@ -103,7 +100,7 @@ function CombinedEntryLinkActions(props) {
103
100
  props.onLinkExisting();
104
101
  },
105
102
  variant: "secondary",
106
- startIcon: /*#__PURE__*/ _react.createElement(_f36icons.LinkIcon, null),
103
+ startIcon: _react.createElement(_f36icons.LinkIcon, null),
107
104
  size: "small"
108
105
  }, "Add existing content");
109
106
  }
@@ -113,7 +110,7 @@ function CombinedAssetLinkActions(props) {
113
110
  const [isOpen, setOpen] = _react.useState(false);
114
111
  if (!props.canLinkEntity || !props.canCreateEntity) {
115
112
  if (props.canLinkEntity) {
116
- return /*#__PURE__*/ _react.createElement(_f36components.Button, {
113
+ return _react.createElement(_f36components.Button, {
117
114
  isDisabled: props.isDisabled,
118
115
  testId: testIds.linkExisting,
119
116
  className: _redesignStyles.action,
@@ -121,12 +118,12 @@ function CombinedAssetLinkActions(props) {
121
118
  props.onLinkExisting();
122
119
  },
123
120
  variant: "secondary",
124
- startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
121
+ startIcon: _react.createElement(_f36icons.PlusIcon, null),
125
122
  size: "small"
126
123
  }, "Add existing media");
127
124
  }
128
125
  if (props.canCreateEntity) {
129
- return /*#__PURE__*/ _react.createElement(_f36components.Button, {
126
+ return _react.createElement(_f36components.Button, {
130
127
  isDisabled: props.isDisabled,
131
128
  testId: testIds.createAndLink,
132
129
  className: _redesignStyles.action,
@@ -134,15 +131,13 @@ function CombinedAssetLinkActions(props) {
134
131
  props.onCreate();
135
132
  },
136
133
  variant: "secondary",
137
- startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
134
+ startIcon: _react.createElement(_f36icons.PlusIcon, null),
138
135
  size: "small"
139
136
  }, "Add media");
140
137
  }
141
138
  return null;
142
139
  }
143
- // TODO: If we fully switch to this new layout, make a more generic `CreateEntityLinkButton`
144
- // that works without content types to cover asset use-case.
145
- return /*#__PURE__*/ _react.createElement(_f36components.Menu, {
140
+ return _react.createElement(_f36components.Menu, {
146
141
  isOpen: isOpen,
147
142
  onClose: ()=>{
148
143
  setOpen(false);
@@ -150,22 +145,22 @@ function CombinedAssetLinkActions(props) {
150
145
  onOpen: ()=>{
151
146
  setOpen(true);
152
147
  }
153
- }, /*#__PURE__*/ _react.createElement(_f36components.Menu.Trigger, null, /*#__PURE__*/ _react.createElement(_f36components.Button, {
154
- endIcon: /*#__PURE__*/ _react.createElement(_f36icons.ChevronDownIcon, null),
148
+ }, _react.createElement(_f36components.Menu.Trigger, null, _react.createElement(_f36components.Button, {
149
+ endIcon: _react.createElement(_f36icons.ChevronDownIcon, null),
155
150
  isDisabled: props.isDisabled,
156
151
  testId: testIds.actionsWrapper,
157
152
  className: _redesignStyles.action,
158
153
  variant: "secondary",
159
- startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
154
+ startIcon: _react.createElement(_f36icons.PlusIcon, null),
160
155
  size: "small"
161
- }, "Add media")), isOpen && /*#__PURE__*/ _react.createElement(_f36components.Menu.List, {
156
+ }, "Add media")), isOpen && _react.createElement(_f36components.Menu.List, {
162
157
  testId: testIds.dropdown
163
- }, /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
158
+ }, _react.createElement(_f36components.Menu.Item, {
164
159
  testId: testIds.linkExisting,
165
160
  onClick: ()=>{
166
161
  props.onLinkExisting();
167
162
  }
168
- }, "Add existing media"), /*#__PURE__*/ _react.createElement(_f36components.Menu.Item, {
163
+ }, "Add existing media"), _react.createElement(_f36components.Menu.Item, {
169
164
  testId: testIds.createAndLink,
170
165
  onClick: ()=>{
171
166
  props.onCreate();
@@ -16,12 +16,12 @@ _export(exports, {
16
16
  return testIds;
17
17
  }
18
18
  });
19
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
19
+ const _react = _interop_require_wildcard(require("react"));
20
20
  const _f36components = require("@contentful/f36-components");
21
21
  const _f36icons = require("@contentful/f36-icons");
22
22
  const _CreateEntryLinkButton = require("../CreateEntryLinkButton/CreateEntryLinkButton");
23
23
  const _NoLinkPermissionsInfo = require("./NoLinkPermissionsInfo");
24
- const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
24
+ const _styles = _interop_require_wildcard(require("./styles"));
25
25
  function _getRequireWildcardCache(nodeInterop) {
26
26
  if (typeof WeakMap !== "function") return null;
27
27
  var cacheBabelInterop = new WeakMap();
@@ -79,16 +79,16 @@ const testIds = {
79
79
  };
80
80
  function LinkActions(props) {
81
81
  if (props.isFull) {
82
- return null; // Don't render link actions if we reached max allowed links.
82
+ return null;
83
83
  }
84
84
  const defaultLabels = props.entityType === 'Entry' ? defaultEntryLabels : defaultAssetLabels;
85
85
  const labels = {
86
86
  ...defaultLabels,
87
87
  ...props.actionLabels
88
88
  };
89
- return /*#__PURE__*/ _react.createElement("div", {
89
+ return _react.createElement("div", {
90
90
  className: _styles.container
91
- }, props.canCreateEntity && /*#__PURE__*/ _react.createElement(_react.Fragment, null, props.entityType === 'Entry' && /*#__PURE__*/ _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
91
+ }, props.canCreateEntity && _react.createElement(_react.Fragment, null, props.entityType === 'Entry' && _react.createElement(_CreateEntryLinkButton.CreateEntryLinkButton, {
92
92
  testId: testIds.createAndLink,
93
93
  disabled: props.isDisabled,
94
94
  text: labels.createNew({
@@ -99,27 +99,27 @@ function LinkActions(props) {
99
99
  onSelect: (contentTypeId)=>{
100
100
  return contentTypeId ? props.onCreate(contentTypeId, props.itemsLength) : Promise.resolve();
101
101
  }
102
- }), props.entityType === 'Asset' && /*#__PURE__*/ _react.createElement(_f36components.Button, {
102
+ }), props.entityType === 'Asset' && _react.createElement(_f36components.Button, {
103
103
  isDisabled: props.isDisabled,
104
104
  testId: testIds.createAndLink,
105
105
  onClick: ()=>{
106
106
  props.onCreate(undefined, props.itemsLength);
107
107
  },
108
108
  variant: "secondary",
109
- startIcon: /*#__PURE__*/ _react.createElement(_f36icons.PlusIcon, null),
109
+ startIcon: _react.createElement(_f36icons.PlusIcon, null),
110
110
  size: "small"
111
- }, labels.createNew()), /*#__PURE__*/ _react.createElement("span", {
111
+ }, labels.createNew()), _react.createElement("span", {
112
112
  className: _styles.separator
113
- })), props.canLinkEntity && /*#__PURE__*/ _react.createElement(_f36components.Button, {
113
+ })), props.canLinkEntity && _react.createElement(_f36components.Button, {
114
114
  isDisabled: props.isDisabled,
115
115
  testId: testIds.linkExisting,
116
116
  onClick: ()=>{
117
117
  props.onLinkExisting();
118
118
  },
119
119
  variant: "secondary",
120
- startIcon: /*#__PURE__*/ _react.createElement(_f36icons.LinkIcon, null),
120
+ startIcon: _react.createElement(_f36icons.LinkIcon, null),
121
121
  size: "small"
122
122
  }, labels.linkExisting({
123
123
  canLinkMultiple: props.canLinkMultiple
124
- })), !props.canCreateEntity && !props.canLinkEntity && /*#__PURE__*/ _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null));
124
+ })), !props.canCreateEntity && !props.canLinkEntity && _react.createElement(_NoLinkPermissionsInfo.NoLinkPermissionsInfo, null));
125
125
  }
@@ -19,7 +19,7 @@ _export(exports, {
19
19
  return useLinkActionsProps;
20
20
  }
21
21
  });
22
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
22
+ const _react = _interop_require_wildcard(require("react"));
23
23
  const _CombinedLinkActions = require("./CombinedLinkActions");
24
24
  const _helpers = require("./helpers");
25
25
  const _LinkActions = require("./LinkActions");
@@ -80,8 +80,7 @@ function useLinkActionsProps(props) {
80
80
  slide,
81
81
  index
82
82
  });
83
- }, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
84
- [
83
+ }, [
85
84
  entityType,
86
85
  props.onCreate,
87
86
  props.onAction
@@ -96,8 +95,7 @@ function useLinkActionsProps(props) {
96
95
  index: index === undefined ? undefined : index + i
97
96
  });
98
97
  });
99
- }, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
100
- [
98
+ }, [
101
99
  entityType,
102
100
  props.onLink,
103
101
  props.onAction
@@ -129,8 +127,7 @@ function useLinkActionsProps(props) {
129
127
  onLinkedExisting([
130
128
  entity
131
129
  ], index);
132
- }, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
133
- [
130
+ }, [
134
131
  sdk,
135
132
  entityType,
136
133
  onLinkedExisting
@@ -145,13 +142,11 @@ function useLinkActionsProps(props) {
145
142
  return;
146
143
  }
147
144
  onLinkedExisting(entities, index);
148
- }, // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
149
- [
145
+ }, [
150
146
  sdk,
151
147
  entityType,
152
148
  onLinkedExisting
153
149
  ]);
154
- // FIXME: The memoization might rerun every time due to the always changing callback identities above
155
150
  return (0, _react.useMemo)(()=>({
156
151
  entityType,
157
152
  canLinkMultiple,
@@ -167,8 +162,7 @@ function useLinkActionsProps(props) {
167
162
  onCreated,
168
163
  onLinkedExisting,
169
164
  itemsLength
170
- }), // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
171
- [
165
+ }), [
172
166
  entityType,
173
167
  canLinkMultiple,
174
168
  isDisabled,
@@ -177,7 +171,6 @@ function useLinkActionsProps(props) {
177
171
  editorPermissions.canCreateEntity,
178
172
  editorPermissions.canLinkEntity,
179
173
  actionLabels,
180
- // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
181
174
  editorPermissions.creatableContentTypes.map((ct)=>ct.sys.id).join(':'),
182
175
  onCreate,
183
176
  onLinkExisting,
@@ -188,8 +181,8 @@ function useLinkActionsProps(props) {
188
181
  ]);
189
182
  }
190
183
  function LinkEntityActions({ renderCustomActions, ...props }) {
191
- return renderCustomActions ? renderCustomActions(props) : /*#__PURE__*/ _react.createElement(_LinkActions.LinkActions, props);
184
+ return renderCustomActions ? renderCustomActions(props) : _react.createElement(_LinkActions.LinkActions, props);
192
185
  }
193
186
  function CombinedLinkEntityActions({ renderCustomActions, ...props }) {
194
- return renderCustomActions ? renderCustomActions(props) : /*#__PURE__*/ _react.createElement(_CombinedLinkActions.CombinedLinkActions, props);
187
+ return renderCustomActions ? renderCustomActions(props) : _react.createElement(_CombinedLinkActions.CombinedLinkActions, props);
195
188
  }
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "NoLinkPermissionsInfo", {
8
8
  return NoLinkPermissionsInfo;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
13
  function _getRequireWildcardCache(nodeInterop) {
14
14
  if (typeof WeakMap !== "function") return null;
@@ -52,5 +52,5 @@ function _interop_require_wildcard(obj, nodeInterop) {
52
52
  return newObj;
53
53
  }
54
54
  function NoLinkPermissionsInfo() {
55
- return /*#__PURE__*/ _react.createElement(_f36components.Paragraph, null, "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help.");
55
+ return _react.createElement(_f36components.Paragraph, null, "You don't have permission to view this content or this field is not correctly configured. Contact your administrator for help.");
56
56
  }
@@ -46,8 +46,6 @@ async function selectSingleEntity(props) {
46
46
  if (props.entityType === 'Entry') {
47
47
  return await props.sdk.dialogs.selectSingleEntry({
48
48
  locale: props.sdk.field.locale,
49
- // readable CTs do not cover cases where user has partial access to a CT entry,
50
- // e.g. via tags so we're passing in all available CTs (based on field validations)
51
49
  contentTypes: getContentTypeIds(props.editorPermissions.availableContentTypes)
52
50
  });
53
51
  } else {
@@ -60,18 +58,11 @@ async function selectSingleEntity(props) {
60
58
  async function selectMultipleEntities(props) {
61
59
  const value = props.sdk.field.getValue();
62
60
  const linkCount = Array.isArray(value) ? value.length : value ? 1 : 0;
63
- // TODO: Why not always set `min: 1` by default? Does it make sense to enforce
64
- // user to select as many entities as the field's "min" requires? What if e.g.
65
- // "min" is 4 and the user wants to insert 2 entities first, then create 2 new ones?
66
61
  const min = Math.max((props.editorPermissions.validations.numberOfLinks?.min || 1) - linkCount, 1);
67
- // TODO: Consider same for max. If e.g. "max" is 4, we disable the button if the
68
- // user wants to select 5 but we show no information why the button is disabled.
69
62
  const max = (props.editorPermissions.validations.numberOfLinks?.max || +Infinity) - linkCount;
70
63
  if (props.entityType === 'Entry') {
71
64
  return await props.sdk.dialogs.selectMultipleEntries({
72
65
  locale: props.sdk.field.locale,
73
- // readable CTs do not cover cases where user has partial access to a CT entry,
74
- // e.g. via tags so we're passing in all available CTs (based on field validations)
75
66
  contentTypes: getContentTypeIds(props.editorPermissions.availableContentTypes),
76
67
  min,
77
68
  max
@@ -19,7 +19,7 @@ _export(exports, {
19
19
  return container;
20
20
  }
21
21
  });
22
- const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
22
+ const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
23
23
  const _emotion = require("emotion");
24
24
  function _interop_require_default(obj) {
25
25
  return obj && obj.__esModule ? obj : {
@@ -16,7 +16,7 @@ _export(exports, {
16
16
  return separator;
17
17
  }
18
18
  });
19
- const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
19
+ const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
20
20
  const _emotion = require("emotion");
21
21
  function _interop_require_default(obj) {
22
22
  return obj && obj.__esModule ? obj : {
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "MissingEntityCard", {
8
8
  return MissingEntityCard;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
13
  const _f36icons = require("@contentful/f36-icons");
14
- const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
14
+ const _styles = _interop_require_wildcard(require("./styles"));
15
15
  function _getRequireWildcardCache(nodeInterop) {
16
16
  if (typeof WeakMap !== "function") return null;
17
17
  var cacheBabelInterop = new WeakMap();
@@ -54,20 +54,20 @@ function _interop_require_wildcard(obj, nodeInterop) {
54
54
  return newObj;
55
55
  }
56
56
  function MissingEntityCard(props) {
57
- return /*#__PURE__*/ _react.createElement(_f36components.Card, {
57
+ return _react.createElement(_f36components.Card, {
58
58
  className: _styles.card,
59
59
  testId: "cf-ui-missing-entry-card",
60
60
  isSelected: props.isSelected
61
- }, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
61
+ }, _react.createElement(_f36components.Flex, {
62
62
  alignItems: "center",
63
63
  justifyContent: "space-between"
64
- }, /*#__PURE__*/ _react.createElement("div", {
64
+ }, _react.createElement("div", {
65
65
  className: props.asSquare ? _styles.squareCard : ''
66
- }, /*#__PURE__*/ _react.createElement(_f36components.SectionHeading, {
66
+ }, _react.createElement(_f36components.SectionHeading, {
67
67
  marginBottom: "none"
68
- }, props.entityType, " is missing or inaccessible")), !props.isDisabled && props.onRemove && /*#__PURE__*/ _react.createElement(_f36components.IconButton, {
68
+ }, props.entityType, " is missing or inaccessible")), !props.isDisabled && props.onRemove && _react.createElement(_f36components.IconButton, {
69
69
  variant: "transparent",
70
- icon: /*#__PURE__*/ _react.createElement(_f36icons.CloseIcon, {
70
+ icon: _react.createElement(_f36icons.CloseIcon, {
71
71
  variant: "muted"
72
72
  }),
73
73
  "aria-label": "Delete",
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ResourceEntityErrorCard", {
8
8
  return ResourceEntityErrorCard;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _EntityStore = require("../../common/EntityStore");
13
13
  const _MissingEntityCard = require("../MissingEntityCard/MissingEntityCard");
14
14
  const _UnsupportedEntityCard = require("./UnsupportedEntityCard");
@@ -55,12 +55,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
55
55
  }
56
56
  function ResourceEntityErrorCard(props) {
57
57
  if ((0, _EntityStore.isUnsupportedError)(props.error)) {
58
- return /*#__PURE__*/ _react.createElement(_UnsupportedEntityCard.UnsupportedEntityCard, {
58
+ return _react.createElement(_UnsupportedEntityCard.UnsupportedEntityCard, {
59
59
  linkType: props.linkType,
60
60
  isSelected: props.isSelected
61
61
  });
62
62
  }
63
- return /*#__PURE__*/ _react.createElement(_MissingEntityCard.MissingEntityCard, {
63
+ return _react.createElement(_MissingEntityCard.MissingEntityCard, {
64
64
  entityType: "Entry",
65
65
  isDisabled: props.isDisabled,
66
66
  isSelected: props.isSelected,
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "UnsupportedEntityCard", {
8
8
  return UnsupportedEntityCard;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
13
  const _emotion = require("emotion");
14
14
  function _getRequireWildcardCache(nodeInterop) {
@@ -58,10 +58,10 @@ const styles = {
58
58
  })
59
59
  };
60
60
  function UnsupportedEntityCard(props) {
61
- return /*#__PURE__*/ _react.createElement(_f36components.Card, {
61
+ return _react.createElement(_f36components.Card, {
62
62
  className: styles.card,
63
63
  isSelected: props.isSelected
64
- }, /*#__PURE__*/ _react.createElement(_f36components.SectionHeading, {
64
+ }, _react.createElement(_f36components.SectionHeading, {
65
65
  marginBottom: "none"
66
66
  }, "Resource type ", props.linkType, " is currently not supported"));
67
67
  }
@@ -16,7 +16,7 @@ _export(exports, {
16
16
  return getScheduleTooltipContent;
17
17
  }
18
18
  });
19
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
19
+ const _react = _interop_require_wildcard(require("react"));
20
20
  const _f36components = require("@contentful/f36-components");
21
21
  const _formatDateAndTime = require("./formatDateAndTime");
22
22
  function _getRequireWildcardCache(nodeInterop) {
@@ -65,7 +65,7 @@ const getScheduleTooltipContent = ({ job, jobsCount })=>{
65
65
  ${jobsCount > 1 ? `+ ${jobsCount - 1} more` : ''}`;
66
66
  };
67
67
  const ScheduleTooltip = ({ job, jobsCount, children })=>{
68
- return /*#__PURE__*/ _react.createElement(_f36components.Tooltip, {
68
+ return _react.createElement(_f36components.Tooltip, {
69
69
  placement: "top",
70
70
  testId: job.sys.id,
71
71
  as: "div",
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ScheduledIconWithTooltip", {
8
8
  return ScheduledIconWithTooltip;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _ScheduleTooltip = require("./ScheduleTooltip");
13
13
  function _getRequireWildcardCache(nodeInterop) {
14
14
  if (typeof WeakMap !== "function") return null;
@@ -67,9 +67,6 @@ const ScheduledIconWithTooltip = ({ entityType, entityId, getEntityScheduledActi
67
67
  error: e
68
68
  });
69
69
  });
70
- // This should only be ever called once. Following the eslint hint to add used
71
- // dependencies will cause page freeze (infinite loop)
72
- // eslint-disable-next-line -- TODO: describe this disable
73
70
  }, []);
74
71
  if (status.type === 'loading' || status.type === 'error') {
75
72
  return null;
@@ -79,7 +76,7 @@ const ScheduledIconWithTooltip = ({ entityType, entityId, getEntityScheduledActi
79
76
  return null;
80
77
  }
81
78
  const mostRelevantJob = jobs[0];
82
- return /*#__PURE__*/ _react.createElement(_ScheduleTooltip.ScheduleTooltip, {
79
+ return _react.createElement(_ScheduleTooltip.ScheduleTooltip, {
83
80
  job: mostRelevantJob,
84
81
  jobsCount: jobs.length
85
82
  }, children);
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line -- TODO: describe this disable no-restricted-imports
2
1
  "use strict";
3
2
  Object.defineProperty(exports, "__esModule", {
4
3
  value: true
@@ -20,7 +19,7 @@ _export(exports, {
20
19
  return formatTime;
21
20
  }
22
21
  });
23
- const _moment = /*#__PURE__*/ _interop_require_default(require("moment"));
22
+ const _moment = _interop_require_default(require("moment"));
24
23
  function _interop_require_default(obj) {
25
24
  return obj && obj.__esModule ? obj : {
26
25
  default: obj
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "SpaceName", {
8
8
  return SpaceName;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
13
  const _f36icons = require("@contentful/f36-icons");
14
- const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
14
+ const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
15
15
  const _emotion = require("emotion");
16
16
  function _interop_require_default(obj) {
17
17
  return obj && obj.__esModule ? obj : {
@@ -77,18 +77,18 @@ const styles = {
77
77
  function SpaceName(props) {
78
78
  let content = `Space: ${props.spaceName}`;
79
79
  if (props.environmentName) content += ` (Env.: ${props.environmentName})`;
80
- return /*#__PURE__*/ _react.createElement(_f36components.Tooltip, {
80
+ return _react.createElement(_f36components.Tooltip, {
81
81
  placement: "top",
82
82
  as: "div",
83
83
  content: content
84
- }, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
84
+ }, _react.createElement(_f36components.Flex, {
85
85
  alignItems: "center",
86
86
  gap: "spacingXs"
87
- }, /*#__PURE__*/ _react.createElement(_f36icons.FolderOpenTrimmedIcon, {
87
+ }, _react.createElement(_f36icons.FolderOpenTrimmedIcon, {
88
88
  className: styles.spaceIcon,
89
89
  size: "tiny",
90
90
  "aria-label": "Source space"
91
- }), /*#__PURE__*/ _react.createElement(_f36components.Text, {
91
+ }), _react.createElement(_f36components.Text, {
92
92
  className: styles.spaceName
93
93
  }, props.spaceName)));
94
94
  }
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "MultipleEntryReferenceEditor", {
8
8
  return MultipleEntryReferenceEditor;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _sortable = require("@dnd-kit/sortable");
13
13
  const _MultipleReferenceEditor = require("../common/MultipleReferenceEditor");
14
14
  const _SortableLinkList = require("../common/SortableLinkList");
@@ -59,17 +59,17 @@ function MultipleEntryReferenceEditor(props) {
59
59
  const updateBeforeSortStart = ({ index })=>{
60
60
  setIndexToUpdate(index);
61
61
  };
62
- return /*#__PURE__*/ _react.createElement(_MultipleReferenceEditor.MultipleReferenceEditor, {
62
+ return _react.createElement(_MultipleReferenceEditor.MultipleReferenceEditor, {
63
63
  ...props,
64
64
  entityType: "Entry",
65
65
  setIndexToUpdate: setIndexToUpdate
66
- }, (childrenProps)=>/*#__PURE__*/ _react.createElement(_SortableLinkList.SortableLinkList, {
66
+ }, (childrenProps)=>_react.createElement(_SortableLinkList.SortableLinkList, {
67
67
  ...childrenProps,
68
68
  sortingStrategy: _sortable.verticalListSortingStrategy,
69
69
  updateBeforeSortStart: updateBeforeSortStart
70
70
  }, ({ items, item, index, isDisabled, DragHandle })=>{
71
71
  const lastIndex = items.length - 1;
72
- return /*#__PURE__*/ _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
72
+ return _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
73
73
  ...childrenProps,
74
74
  key: `${item.sys.id}-${index}`,
75
75
  index: index,
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "SingleEntryReferenceEditor", {
8
8
  return SingleEntryReferenceEditor;
9
9
  }
10
10
  });
11
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
11
+ const _react = _interop_require_wildcard(require("react"));
12
12
  const _SingleReferenceEditor = require("../common/SingleReferenceEditor");
13
13
  const _FetchingWrappedEntryCard = require("./WrappedEntryCard/FetchingWrappedEntryCard");
14
14
  function _getRequireWildcardCache(nodeInterop) {
@@ -53,11 +53,11 @@ function _interop_require_wildcard(obj, nodeInterop) {
53
53
  return newObj;
54
54
  }
55
55
  function SingleEntryReferenceEditor(props) {
56
- return /*#__PURE__*/ _react.createElement(_SingleReferenceEditor.SingleReferenceEditor, {
56
+ return _react.createElement(_SingleReferenceEditor.SingleReferenceEditor, {
57
57
  ...props,
58
58
  entityType: "Entry"
59
59
  }, ({ allContentTypes, isDisabled, entityId, setValue, renderCustomCard, hasCardRemoveActions, hasCardEditActions })=>{
60
- return /*#__PURE__*/ _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
60
+ return _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
61
61
  ...props,
62
62
  allContentTypes: allContentTypes,
63
63
  isDisabled: isDisabled,