@contentful/field-editor-rich-text 2.0.0-next.42 → 2.0.0-next.43

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.
@@ -401,17 +401,8 @@ function getParents(el) {
401
401
  return parents;
402
402
  }
403
403
 
404
- // "modern" Edge was released at 79.x
405
- var IS_EDGE_LEGACY = typeof navigator !== 'undefined' && /*#__PURE__*/ /Edge?\/(?:[0-6][0-9]|[0-7][0-8])/i.test(navigator.userAgent); // Native `beforeInput` events don't work well with react on Chrome 75
406
- // and older, Chrome 76+ can use `beforeInput` though.
407
-
408
- var IS_CHROME_LEGACY = typeof navigator !== 'undefined' && /*#__PURE__*/ /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent); // COMPAT: Firefox/Edge Legacy don't support the `beforeinput` event
409
- // Chrome Legacy doesn't support `beforeinput` correctly
410
-
411
- var HAS_BEFORE_INPUT_SUPPORT = !IS_CHROME_LEGACY && !IS_EDGE_LEGACY && // globalThis is undefined in older browsers
412
- typeof globalThis !== 'undefined' && globalThis.InputEvent && typeof globalThis.InputEvent.prototype.getTargetRanges === 'function'; // The `getTargetRanges` property isn't recognized.
413
-
414
404
  var IS_SAFARI = typeof navigator !== 'undefined' && /*#__PURE__*/ /Version\/[\d.]+.*Safari/.test(navigator.userAgent);
405
+ var IS_CHROME = /*#__PURE__*/ /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/.test(navigator.userAgent);
415
406
 
416
407
  var LINK_TYPES = [Contentful.INLINES.HYPERLINK, Contentful.INLINES.ENTRY_HYPERLINK, Contentful.INLINES.ASSET_HYPERLINK];
417
408
  function isBlockSelected(editor, type) {
@@ -1054,12 +1045,12 @@ function LinkedEntityBlock(props) {
1054
1045
  "data-entity-type": entityType,
1055
1046
  "data-entity-id": entityId,
1056
1047
  // COMPAT: This makes copy & paste work for Firefox
1057
- contentEditable: !HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
1058
- draggable: !HAS_BEFORE_INPUT_SUPPORT ? true : undefined
1048
+ contentEditable: IS_CHROME ? undefined : false,
1049
+ draggable: IS_CHROME ? true : undefined
1059
1050
  }), /*#__PURE__*/React__default.createElement("div", {
1060
1051
  // COMPAT: This makes copy & paste work for Chromium/Blink browsers and Safari
1061
- contentEditable: HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
1062
- draggable: HAS_BEFORE_INPUT_SUPPORT ? true : undefined,
1052
+ contentEditable: IS_CHROME ? false : undefined,
1053
+ draggable: IS_CHROME ? true : undefined,
1063
1054
  className: styles$3.container
1064
1055
  }, entityType === 'Entry' && /*#__PURE__*/React__default.createElement(FetchingWrappedEntryCard, {
1065
1056
  sdk: sdk,
@@ -2313,12 +2304,12 @@ function EmbeddedEntityInline(props) {
2313
2304
  className: styles$6.root,
2314
2305
  "data-embedded-entity-inline-id": entryId,
2315
2306
  // COMPAT: This makes copy & paste work for Firefox
2316
- contentEditable: !HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
2317
- draggable: !HAS_BEFORE_INPUT_SUPPORT ? true : undefined
2307
+ contentEditable: IS_CHROME ? undefined : false,
2308
+ draggable: IS_CHROME ? true : undefined
2318
2309
  }), /*#__PURE__*/React.createElement("span", {
2319
2310
  // COMPAT: This makes copy & paste work for Chromium/Blink browsers and Safari
2320
- contentEditable: HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
2321
- draggable: HAS_BEFORE_INPUT_SUPPORT ? true : undefined
2311
+ contentEditable: IS_CHROME ? false : undefined,
2312
+ draggable: IS_CHROME ? true : undefined
2322
2313
  }, /*#__PURE__*/React.createElement(FetchingWrappedInlineEntryCard, {
2323
2314
  sdk: sdk,
2324
2315
  entryId: entryId,