@limetech/lime-elements 37.54.0 → 37.54.2

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.
@@ -16559,6 +16559,16 @@ const LevelMapping = {
16559
16559
  two: 2,
16560
16560
  three: 3,
16561
16561
  };
16562
+ /**
16563
+ * The `MouseButtons` type is used to represent the different mouse buttons.
16564
+ * The values correspond to the button codes used in the `MouseEvent` interface.
16565
+ * @beta
16566
+ */
16567
+ const MouseButtons = {
16568
+ Left: 0,
16569
+ Middle: 1,
16570
+ Right: 2,
16571
+ };
16562
16572
 
16563
16573
  const setActiveMethodForMark = (command, markType) => {
16564
16574
  command.active = (state) => {
@@ -25738,7 +25748,7 @@ const openLinkMenu = (view, href, text) => {
25738
25748
  let lastClickTime = 0;
25739
25749
  const DOUBLE_CLICK_DELAY = 200;
25740
25750
  let clickTimeout;
25741
- const processDoubleClickEvent = (view, event) => {
25751
+ const processClickEvent = (view, event) => {
25742
25752
  const now = Date.now();
25743
25753
  if (now - lastClickTime < DOUBLE_CLICK_DELAY) {
25744
25754
  clearTimeout(clickTimeout);
@@ -25797,7 +25807,22 @@ const createLinkPlugin = (updateLinkCallback) => {
25797
25807
  event.button === 0) {
25798
25808
  return processModClickEvent(view, event);
25799
25809
  }
25800
- return processDoubleClickEvent(view, event);
25810
+ if (event.button !== MouseButtons.Right) {
25811
+ // We want to ignore right-clicks
25812
+ return processClickEvent(view, event);
25813
+ }
25814
+ return true;
25815
+ },
25816
+ click: (_view, event) => {
25817
+ if (!(event.target instanceof HTMLElement)) {
25818
+ return;
25819
+ }
25820
+ // Prevent unhandled navigation and bubbling for link clicks
25821
+ const link = event.target.closest('a');
25822
+ if (link) {
25823
+ event.preventDefault();
25824
+ event.stopPropagation();
25825
+ }
25801
25826
  },
25802
25827
  },
25803
25828
  },