@tiptap/core 3.15.2 → 3.15.3
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 +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/focus.ts +9 -0
- package/src/utilities/index.ts +1 -0
- package/src/utilities/isSafari.ts +11 -0
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,
|