@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.
@@ -394,17 +394,8 @@ function getParents(el) {
394
394
  return parents;
395
395
  }
396
396
 
397
- // "modern" Edge was released at 79.x
398
- 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
399
- // and older, Chrome 76+ can use `beforeInput` though.
400
-
401
- 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
402
- // Chrome Legacy doesn't support `beforeinput` correctly
403
-
404
- var HAS_BEFORE_INPUT_SUPPORT = !IS_CHROME_LEGACY && !IS_EDGE_LEGACY && // globalThis is undefined in older browsers
405
- typeof globalThis !== 'undefined' && globalThis.InputEvent && typeof globalThis.InputEvent.prototype.getTargetRanges === 'function'; // The `getTargetRanges` property isn't recognized.
406
-
407
397
  var IS_SAFARI = typeof navigator !== 'undefined' && /*#__PURE__*/ /Version\/[\d.]+.*Safari/.test(navigator.userAgent);
398
+ var IS_CHROME = /*#__PURE__*/ /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/.test(navigator.userAgent);
408
399
 
409
400
  var LINK_TYPES = [INLINES.HYPERLINK, INLINES.ENTRY_HYPERLINK, INLINES.ASSET_HYPERLINK];
410
401
  function isBlockSelected(editor, type) {
@@ -1047,12 +1038,12 @@ function LinkedEntityBlock(props) {
1047
1038
  "data-entity-type": entityType,
1048
1039
  "data-entity-id": entityId,
1049
1040
  // COMPAT: This makes copy & paste work for Firefox
1050
- contentEditable: !HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
1051
- draggable: !HAS_BEFORE_INPUT_SUPPORT ? true : undefined
1041
+ contentEditable: IS_CHROME ? undefined : false,
1042
+ draggable: IS_CHROME ? true : undefined
1052
1043
  }), /*#__PURE__*/React__default.createElement("div", {
1053
1044
  // COMPAT: This makes copy & paste work for Chromium/Blink browsers and Safari
1054
- contentEditable: HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
1055
- draggable: HAS_BEFORE_INPUT_SUPPORT ? true : undefined,
1045
+ contentEditable: IS_CHROME ? false : undefined,
1046
+ draggable: IS_CHROME ? true : undefined,
1056
1047
  className: styles$3.container
1057
1048
  }, entityType === 'Entry' && /*#__PURE__*/React__default.createElement(FetchingWrappedEntryCard, {
1058
1049
  sdk: sdk,
@@ -2306,12 +2297,12 @@ function EmbeddedEntityInline(props) {
2306
2297
  className: styles$6.root,
2307
2298
  "data-embedded-entity-inline-id": entryId,
2308
2299
  // COMPAT: This makes copy & paste work for Firefox
2309
- contentEditable: !HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
2310
- draggable: !HAS_BEFORE_INPUT_SUPPORT ? true : undefined
2300
+ contentEditable: IS_CHROME ? undefined : false,
2301
+ draggable: IS_CHROME ? true : undefined
2311
2302
  }), /*#__PURE__*/createElement("span", {
2312
2303
  // COMPAT: This makes copy & paste work for Chromium/Blink browsers and Safari
2313
- contentEditable: HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
2314
- draggable: HAS_BEFORE_INPUT_SUPPORT ? true : undefined
2304
+ contentEditable: IS_CHROME ? false : undefined,
2305
+ draggable: IS_CHROME ? true : undefined
2315
2306
  }, /*#__PURE__*/createElement(FetchingWrappedInlineEntryCard, {
2316
2307
  sdk: sdk,
2317
2308
  entryId: entryId,