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