@contentful/field-editor-rich-text 2.0.0-next.37 → 2.0.0-next.38

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.
@@ -6927,26 +6927,11 @@ var EmbedEntityWidget = function EmbedEntityWidget(_ref) {
6927
6927
  return setEmbedDropdownOpen(!isEmbedDropdownOpen);
6928
6928
  };
6929
6929
 
6930
- var _useState2 = useState(false),
6931
- canAccessAssets = _useState2[0],
6932
- setCanAccessAssets = _useState2[1];
6933
-
6934
- React__default.useEffect(function () {
6935
- var subscribed = true;
6936
- sdk.access.can('read', 'Asset').then(function (can) {
6937
- if (!subscribed) {
6938
- return;
6939
- }
6940
-
6941
- setCanAccessAssets(can);
6942
- });
6943
- return function () {
6944
- subscribed = false;
6945
- };
6946
- }, [sdk]);
6947
6930
  var inlineEntryEmbedEnabled = isNodeTypeEnabled(sdk.field, INLINES.EMBEDDED_ENTRY);
6948
- var blockEntryEmbedEnabled = isNodeTypeEnabled(sdk.field, BLOCKS.EMBEDDED_ENTRY) && canInsertBlocks;
6949
- var blockAssetEmbedEnabled = canAccessAssets && isNodeTypeEnabled(sdk.field, BLOCKS.EMBEDDED_ASSET) && canInsertBlocks;
6931
+ var blockEntryEmbedEnabled = isNodeTypeEnabled(sdk.field, BLOCKS.EMBEDDED_ENTRY) && canInsertBlocks; // Removed access check following https://contentful.atlassian.net/browse/DANTE-486
6932
+ // TODO: refine permissions check in order to account for tags in rules and then readd access.can('read', 'Asset')
6933
+
6934
+ var blockAssetEmbedEnabled = isNodeTypeEnabled(sdk.field, BLOCKS.EMBEDDED_ASSET) && canInsertBlocks;
6950
6935
  var numEnabledEmbeds = [inlineEntryEmbedEnabled, blockEntryEmbedEnabled, blockAssetEmbedEnabled].filter(Boolean).length;
6951
6936
  var shouldDisplayDropdown = numEnabledEmbeds > 1 || isDisabled; // Avoids UI glitching when switching back and forth between
6952
6937
  // different layouts