@threadlabs/looma 0.2.17 → 0.2.18
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/package.json +1 -1
- package/vue/editor/index.js +15 -2
package/package.json
CHANGED
package/vue/editor/index.js
CHANGED
|
@@ -338,6 +338,19 @@ var EMPTY_CAPABILITIES = {
|
|
|
338
338
|
function sameDocument(left, right) {
|
|
339
339
|
return JSON.stringify(left) === JSON.stringify(right);
|
|
340
340
|
}
|
|
341
|
+
function managedMenuAnchorRect(rect) {
|
|
342
|
+
if (!rect) return null;
|
|
343
|
+
return {
|
|
344
|
+
left: rect.left,
|
|
345
|
+
top: rect.top,
|
|
346
|
+
right: rect.right,
|
|
347
|
+
bottom: rect.bottom,
|
|
348
|
+
x: rect.x,
|
|
349
|
+
y: rect.y,
|
|
350
|
+
width: rect.width,
|
|
351
|
+
height: rect.height
|
|
352
|
+
};
|
|
353
|
+
}
|
|
341
354
|
function selectedTableElement(editor) {
|
|
342
355
|
const { node } = editor.view.domAtPos(editor.state.selection.from);
|
|
343
356
|
const element = node instanceof HTMLElement ? node : node.parentElement;
|
|
@@ -1078,7 +1091,7 @@ var LoomaEditor = defineComponent2({
|
|
|
1078
1091
|
query: slash.query,
|
|
1079
1092
|
items: slash.items,
|
|
1080
1093
|
selectedIndex: slash.selectedIndex,
|
|
1081
|
-
anchorRect: slash.rect,
|
|
1094
|
+
anchorRect: managedMenuAnchorRect(slash.rect),
|
|
1082
1095
|
onSlashMenuHighlight: ({ index }) => {
|
|
1083
1096
|
slash.selectedIndex = index;
|
|
1084
1097
|
},
|
|
@@ -1092,7 +1105,7 @@ var LoomaEditor = defineComponent2({
|
|
|
1092
1105
|
query: mention.query,
|
|
1093
1106
|
items: mention.items,
|
|
1094
1107
|
selectedIndex: mention.selectedIndex,
|
|
1095
|
-
anchorRect: mention.rect,
|
|
1108
|
+
anchorRect: managedMenuAnchorRect(mention.rect),
|
|
1096
1109
|
loading: mention.loading,
|
|
1097
1110
|
onMentionMenuHighlight: ({ index }) => {
|
|
1098
1111
|
mention.selectedIndex = index;
|