@tiptap/core
Advanced tools
| /** | ||
| * Detects if the current browser is Safari (but not iOS Safari or Chrome). | ||
| * @returns `true` if the browser is Safari, `false` otherwise. | ||
| * @example | ||
| * if (isSafari()) { | ||
| * // Safari-specific handling | ||
| * } | ||
| */ | ||
| export function isSafari(): boolean { | ||
| return typeof navigator !== 'undefined' ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : false | ||
| } |
+3
-3
| { | ||
| "name": "@tiptap/core", | ||
| "description": "headless rich text editor", | ||
| "version": "3.15.2", | ||
| "version": "3.15.3", | ||
| "homepage": "https://tiptap.dev", | ||
@@ -55,6 +55,6 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@tiptap/pm": "^3.15.2" | ||
| "@tiptap/pm": "^3.15.3" | ||
| }, | ||
| "peerDependencies": { | ||
| "@tiptap/pm": "^3.15.2" | ||
| "@tiptap/pm": "^3.15.3" | ||
| }, | ||
@@ -61,0 +61,0 @@ "repository": { |
@@ -6,2 +6,3 @@ import { isTextSelection } from '../helpers/isTextSelection.js' | ||
| import { isiOS } from '../utilities/isiOS.js' | ||
| import { isSafari } from '../utilities/isSafari.js' | ||
@@ -51,2 +52,10 @@ declare module '@tiptap/core' { | ||
| // Safari requires preventScroll to avoid the browser scrolling to the | ||
| // top of the editor when focus is called before the selection is set. | ||
| // We exclude iOS and Android since they are already handled above. | ||
| // see: https://github.com/ueberdosis/tiptap/issues/7318 | ||
| if (isSafari() && !isiOS() && !isAndroid()) { | ||
| ;(view.dom as HTMLElement).focus({ preventScroll: true }) | ||
| } | ||
| // For React we have to focus asynchronously. Otherwise wild things happen. | ||
@@ -53,0 +62,0 @@ // see: https://github.com/ueberdosis/tiptap/issues/1520 |
@@ -17,2 +17,3 @@ export * from './callOrReturn.js' | ||
| export * from './isRegExp.js' | ||
| export * from './isSafari.js' | ||
| export * from './isString.js' | ||
@@ -19,0 +20,0 @@ export * from './markdown/index.js' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2252357
0.19%209
0.48%30073
0.16%