@limetech/lime-elements 37.54.0 → 37.54.1
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/CHANGELOG.md +9 -0
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +27 -2
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/types.js +10 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/types.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link-plugin.js +18 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link-plugin.js.map +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +27 -2
- package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-58d0b6b0.entry.js → p-ed214c35.entry.js} +2 -2
- package/dist/lime-elements/p-ed214c35.entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-58d0b6b0.entry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [37.54.1](https://github.com/Lundalogik/lime-elements/compare/v37.54.0...v37.54.1) (2024-07-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **text editor:** allow only browser expected behaviour on right clicks ([766645a](https://github.com/Lundalogik/lime-elements/commit/766645aed5052d344d4913982091553b930b5e66))
|
|
8
|
+
* **text editor:** prevent default behaviour on link clicks ([67d7c51](https://github.com/Lundalogik/lime-elements/commit/67d7c51794b7bc76efb49495bdebc254b47f8535))
|
|
9
|
+
|
|
1
10
|
## [37.54.0](https://github.com/Lundalogik/lime-elements/compare/v37.53.5...v37.54.0) (2024-07-04)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -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
|
|
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
|
-
|
|
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
|
},
|