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