@datocms/content-link
Advanced tools
+1
-1
| { | ||
| "name": "@datocms/content-link", | ||
| "version": "0.3.20", | ||
| "version": "0.3.21", | ||
| "description": "Lightweight library for DatoCMS visual editing overlays and content links.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -9,2 +9,3 @@ /** | ||
| inIframe, | ||
| isEditableElementFocused, | ||
| isKeyboardEvent, | ||
@@ -313,2 +314,6 @@ isMouseEvent, | ||
| if (isEditableElementFocused(this.document)) { | ||
| return; | ||
| } | ||
| this.enableTemporaryClickToEditState(); | ||
@@ -326,2 +331,6 @@ } | ||
| if (isEditableElementFocused(this.document)) { | ||
| return; | ||
| } | ||
| this.disableTemporaryClickToEditState(); | ||
@@ -328,0 +337,0 @@ } |
+12
-0
@@ -61,2 +61,14 @@ import { type Options, compute as computeScrollIntoView } from 'compute-scroll-into-view'; | ||
| export function isEditableElementFocused(document: Document): boolean { | ||
| const active = document.activeElement as HTMLElement | null; | ||
| if (!active) { | ||
| return false; | ||
| } | ||
| const tag = active.tagName; | ||
| if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') { | ||
| return true; | ||
| } | ||
| return active.isContentEditable; | ||
| } | ||
| /** Compute the bounding box for the target element, ignoring zero-size or hidden nodes. */ | ||
@@ -63,0 +75,0 @@ export function measure( |
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
708474
0.47%6774
0.77%