@tiptap/extension-bubble-menu
Advanced tools
Comparing version 2.0.0-beta.3 to 2.0.0-beta.4
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-beta.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-bubble-menu@2.0.0-beta.3...@tiptap/extension-bubble-menu@2.0.0-beta.4) (2021-04-01) | ||
**Note:** Version bump only for package @tiptap/extension-bubble-menu | ||
# [2.0.0-beta.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-bubble-menu@2.0.0-beta.2...@tiptap/extension-bubble-menu@2.0.0-beta.3) (2021-03-31) | ||
@@ -8,0 +16,0 @@ |
@@ -122,3 +122,3 @@ 'use strict'; | ||
const box = this.element.getBoundingClientRect(); | ||
const left = (start.left + end.left) / 2 - parentBox.left; | ||
const left = (start.left + end.left) / 2 - parentBox.left - box.width / 2; | ||
this.isActive = true; | ||
@@ -128,3 +128,3 @@ this.top = Math.round(end.bottom - parentBox.top); | ||
this.left = Math.round(this.keepInBounds | ||
? Math.min(parentBox.width - box.width / 2, Math.max(left, box.width / 2)) | ||
? Math.min(parentBox.width - box.width, Math.max(left, 0)) | ||
: left); | ||
@@ -142,3 +142,2 @@ this.render(); | ||
bottom: `${this.bottom}px`, | ||
transform: 'translateX(-50%)', | ||
}); | ||
@@ -145,0 +144,0 @@ } |
@@ -118,3 +118,3 @@ import { Extension } from '@tiptap/core'; | ||
const box = this.element.getBoundingClientRect(); | ||
const left = (start.left + end.left) / 2 - parentBox.left; | ||
const left = (start.left + end.left) / 2 - parentBox.left - box.width / 2; | ||
this.isActive = true; | ||
@@ -124,3 +124,3 @@ this.top = Math.round(end.bottom - parentBox.top); | ||
this.left = Math.round(this.keepInBounds | ||
? Math.min(parentBox.width - box.width / 2, Math.max(left, box.width / 2)) | ||
? Math.min(parentBox.width - box.width, Math.max(left, 0)) | ||
: left); | ||
@@ -138,3 +138,2 @@ this.render(); | ||
bottom: `${this.bottom}px`, | ||
transform: 'translateX(-50%)', | ||
}); | ||
@@ -141,0 +140,0 @@ } |
@@ -121,3 +121,3 @@ (function (global, factory) { | ||
const box = this.element.getBoundingClientRect(); | ||
const left = (start.left + end.left) / 2 - parentBox.left; | ||
const left = (start.left + end.left) / 2 - parentBox.left - box.width / 2; | ||
this.isActive = true; | ||
@@ -127,3 +127,3 @@ this.top = Math.round(end.bottom - parentBox.top); | ||
this.left = Math.round(this.keepInBounds | ||
? Math.min(parentBox.width - box.width / 2, Math.max(left, box.width / 2)) | ||
? Math.min(parentBox.width - box.width, Math.max(left, 0)) | ||
: left); | ||
@@ -141,3 +141,2 @@ this.render(); | ||
bottom: `${this.bottom}px`, | ||
transform: 'translateX(-50%)', | ||
}); | ||
@@ -144,0 +143,0 @@ } |
{ | ||
"name": "@tiptap/extension-bubble-menu", | ||
"description": "bubble-menu extension for tiptap", | ||
"version": "2.0.0-beta.3", | ||
"version": "2.0.0-beta.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "3cf22b02c6cfba27b13f21422546f9076d5653e7" | ||
"gitHead": "95642d979c27742a3e7b6a28059939d09fd1fbc4" | ||
} |
@@ -99,3 +99,3 @@ import { Editor } from '@tiptap/core' | ||
const box = this.element.getBoundingClientRect() | ||
const left = (start.left + end.left) / 2 - parentBox.left | ||
const left = (start.left + end.left) / 2 - parentBox.left - box.width / 2 | ||
@@ -107,3 +107,9 @@ this.isActive = true | ||
this.keepInBounds | ||
? Math.min(parentBox.width - box.width / 2, Math.max(left, box.width / 2)) | ||
? Math.min( | ||
parentBox.width - box.width, | ||
Math.max( | ||
left, | ||
0, | ||
), | ||
) | ||
: left, | ||
@@ -124,3 +130,2 @@ ) | ||
bottom: `${this.bottom}px`, | ||
transform: 'translateX(-50%)', | ||
}) | ||
@@ -127,0 +132,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
511917
1130