markupeditor 0.9.45 → 0.9.46

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.
@@ -35409,7 +35409,7 @@ function _getMarkTypes() {
35409
35409
  }
35410
35410
  /**
35411
35411
  * Return the link attributes at the selection.
35412
- *
35412
+ *
35413
35413
  * @returns {object} An Object whose properties are the link attributes (like href, link) at the selection.
35414
35414
  */
35415
35415
  function getLinkAttributes() {
@@ -42154,6 +42154,7 @@ class LinkView {
42154
42154
  link.setAttribute('href', href);
42155
42155
  link.setAttribute('title', title);
42156
42156
  link.addEventListener('click', (ev)=> {
42157
+ ev.preventDefault();
42157
42158
  if (ev.altKey) {
42158
42159
  if (href.startsWith('#')) {
42159
42160
  let id = href.substring(1);
@@ -43319,7 +43320,13 @@ class MarkupEditor {
43319
43320
  'focus': () => { setTimeout(() => focused(target)); },
43320
43321
  'blur': () => { setTimeout(() => blurred(target)); },
43321
43322
  'cut': () => { setTimeout(() => { callbackInput(target); }, 0); },
43322
- 'click': (view) => { setTimeout(() => { clicked(view, target); }, 0); },
43323
+ 'click': (view, event) => {
43324
+ const altKey = event.altKey;
43325
+ // Plain click on a link: LinkView's own listener already decided what
43326
+ // to do (open on Alt+Click, nothing otherwise); don't also report it,
43327
+ // or markupClicked's default behavior would follow the link regardless.
43328
+ setTimeout(() => { if (altKey || !getLinkAttributes().href) clicked(view, target); }, 0);
43329
+ },
43323
43330
  'delete': () => { setTimeout(() => { callbackInput(target); }, 0); },
43324
43331
  },
43325
43332
  handlePaste(view, event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markupeditor",
3
- "version": "0.9.45",
3
+ "version": "0.9.46",
4
4
  "description": "A web component and API for WYSIWYG HTML editing.",
5
5
  "keywords": [
6
6
  "wysiwyg",