@threadlabs/looma 0.26.23 → 0.26.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.26.23",
3
+ "version": "0.26.24",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -2178,7 +2178,10 @@ var LoomaEditor = defineComponent({
2178
2178
  }
2179
2179
  }).catch(() => {});
2180
2180
  }
2181
- nextTick(() => (linkMode.value === "url" ? linkDestinationInput() : linkFormRoot.value?.querySelector("[data-link-search]"))?.focus());
2181
+ nextTick(() => {
2182
+ if (context) (props.toolbarMode === "contextual" && floatingFormattingMode() && formattingSelectionActive(instance) ? formattingPopup : linkPopup)?.setProps({ getReferenceClientRect: () => posToDOMRect(instance.view, instance.state.selection.from, instance.state.selection.to) });
2183
+ (linkMode.value === "url" ? linkDestinationInput() : linkFormRoot.value?.querySelector("[data-link-search]"))?.focus();
2184
+ });
2182
2185
  };
2183
2186
  const saveLink = () => {
2184
2187
  const instance = editor.value;
@@ -3378,7 +3381,10 @@ var LoomaEditor = defineComponent({
3378
3381
  placement: "top",
3379
3382
  inverse: true
3380
3383
  }, () => "Drag to resize column") : null,
3381
- instance && (props.editable || props.selectionActions.length || props.rangeActions.length) && !mobile.value && (props.toolbarMode === "bubble" || props.toolbarMode === "popover" || props.toolbarMode === "contextual") ? h(BubbleMenu, {
3384
+ h(Stack, {
3385
+ key: "looma-formatting-popup-host",
3386
+ gap: "none"
3387
+ }, () => [instance && (props.editable || props.selectionActions.length || props.rangeActions.length) && !mobile.value && (props.toolbarMode === "bubble" || props.toolbarMode === "popover" || props.toolbarMode === "contextual") ? h(BubbleMenu, {
3382
3388
  editor: instance,
3383
3389
  pluginKey: "looma-text-formatting-menu",
3384
3390
  updateDelay: 0,
@@ -3407,8 +3413,11 @@ var LoomaEditor = defineComponent({
3407
3413
  }
3408
3414
  }] } } : {}
3409
3415
  }
3410
- }, { default: () => props.toolbarMode === "contextual" ? h(Stack, { gap: "xs" }, () => [renderToolbar(instance, true), (linkContextEditing.value || instance.state.selection.empty && instance.isActive("link")) && !linkOpen.value && formattingSelectionActive(instance) ? renderLinkContextCard(instance) : null]) : renderToolbar(instance, true, props.toolbarMode === "popover") }) : null,
3411
- instance && props.editable ? h(BubbleMenu, {
3416
+ }, { default: () => props.toolbarMode === "contextual" ? h(Stack, { gap: "xs" }, () => [renderToolbar(instance, true), (linkContextEditing.value || instance.state.selection.empty && instance.isActive("link")) && !linkOpen.value && formattingSelectionActive(instance) ? renderLinkContextCard(instance) : null]) : renderToolbar(instance, true, props.toolbarMode === "popover") }) : null]),
3417
+ h(Stack, {
3418
+ key: "looma-link-popup-host",
3419
+ gap: "none"
3420
+ }, () => [instance && props.editable ? h(BubbleMenu, {
3412
3421
  editor: instance,
3413
3422
  pluginKey: "looma-link-context-menu",
3414
3423
  updateDelay: 0,
@@ -3426,7 +3435,7 @@ var LoomaEditor = defineComponent({
3426
3435
  maxWidth: Math.min(480, window.innerWidth - 24),
3427
3436
  placement: "top"
3428
3437
  }
3429
- }, { default: () => props.toolbarMode === "contextual" && floatingFormattingMode() && formattingSelectionActive(instance) ? null : renderLinkContextCard(instance) }) : null,
3438
+ }, { default: () => props.toolbarMode === "contextual" && floatingFormattingMode() && formattingSelectionActive(instance) ? null : renderLinkContextCard(instance) }) : null]),
3430
3439
  instance && props.editable && !mobile.value && props.toolbarMode === "popover" && props.toolbarTriggerId ? h(Popover, {
3431
3440
  class: "looma-editor__formatting-popover",
3432
3441
  role: "region",
@@ -3576,7 +3585,7 @@ var LoomaEditor = defineComponent({
3576
3585
  const current = editor.value?.state.selection;
3577
3586
  if (current && !current.empty && linkSelection && current.from === linkSelection.from && current.to === linkSelection.to) editor.value?.commands.setTextSelection(current.to);
3578
3587
  }
3579
- }, renderLinkForm),
3588
+ }, () => linkOpen.value ? renderLinkForm() : null),
3580
3589
  props.editable && props.compactToolbar && !mobile.value ? h(Popover, {
3581
3590
  class: "looma-editor__compact-formatting",
3582
3591
  for: formatAnchorId,