@threadlabs/looma 0.2.16 → 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.
@@ -5478,7 +5478,7 @@ function createLoomaMentionExtension(options = {}) {
5478
5478
  const state = LoomaMentionSuggestionPluginKey.getState(
5479
5479
  props.editor.state
5480
5480
  );
5481
- return state?.active === true && state.query === props.query && state.range?.from === props.range.from && state.range?.to === props.range.to;
5481
+ return state?.active === true && state.query === props.query && state.range?.from === props.range.from;
5482
5482
  };
5483
5483
  const publish = (props, loading = false) => {
5484
5484
  if (!props) {
@@ -27,7 +27,7 @@ import {
27
27
  setActiveTableCellAlignment,
28
28
  setActiveTableCellBackground,
29
29
  shouldShowTextFormattingToolbar
30
- } from "../chunk-BXICJBWS.js";
30
+ } from "../chunk-EUIH3TBV.js";
31
31
  import {
32
32
  TABLE_CELL_BACKGROUND_PRESETS
33
33
  } from "../chunk-JK53ENSG.js";
package/editor/index.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  setActiveTableCellAlignment,
32
32
  setActiveTableCellBackground,
33
33
  shouldShowTextFormattingToolbar
34
- } from "./chunk-BXICJBWS.js";
34
+ } from "./chunk-EUIH3TBV.js";
35
35
  import {
36
36
  TABLE_CELL_BACKGROUND_OPTIONS,
37
37
  TABLE_CELL_BACKGROUND_PRESETS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "type": "module",
5
5
  "description": "Looma declarative components, responsive layout primitives, a complete editor, and supported Vue adapters.",
6
6
  "license": "MIT",
@@ -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;