@tiptap/core 3.15.2 → 3.16.0

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.
package/dist/index.cjs CHANGED
@@ -107,6 +107,7 @@ __export(index_exports, {
107
107
  isNumber: () => isNumber,
108
108
  isPlainObject: () => isPlainObject,
109
109
  isRegExp: () => isRegExp,
110
+ isSafari: () => isSafari,
110
111
  isString: () => isString,
111
112
  isTextSelection: () => isTextSelection,
112
113
  isiOS: () => isiOS,
@@ -650,6 +651,11 @@ function isiOS() {
650
651
  navigator.userAgent.includes("Mac") && "ontouchend" in document;
651
652
  }
652
653
 
654
+ // src/utilities/isSafari.ts
655
+ function isSafari() {
656
+ return typeof navigator !== "undefined" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : false;
657
+ }
658
+
653
659
  // src/commands/focus.ts
654
660
  var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch }) => {
655
661
  options = {
@@ -661,6 +667,10 @@ var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch })
661
667
  ;
662
668
  view.dom.focus();
663
669
  }
670
+ if (isSafari() && !isiOS() && !isAndroid()) {
671
+ ;
672
+ view.dom.focus({ preventScroll: true });
673
+ }
664
674
  requestAnimationFrame(() => {
665
675
  if (!editor.isDestroyed) {
666
676
  view.focus();
@@ -6959,6 +6969,7 @@ var Tracker = class {
6959
6969
  isNumber,
6960
6970
  isPlainObject,
6961
6971
  isRegExp,
6972
+ isSafari,
6962
6973
  isString,
6963
6974
  isTextSelection,
6964
6975
  isiOS,