@modusoperandi/licit 1.3.3 → 1.3.5

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.
@@ -110,6 +110,7 @@ var LinkTooltipView = /*#__PURE__*/function () {
110
110
  }
111
111
  return;
112
112
  }
113
+ var urlObj = new URL(href);
113
114
  if (href) {
114
115
  var _this$_view;
115
116
  var url = sanitizeURL(href);
@@ -119,7 +120,7 @@ var LinkTooltipView = /*#__PURE__*/function () {
119
120
  } else {
120
121
  popupString = '';
121
122
  }
122
- if ((_this$_view = _this._view) !== null && _this$_view !== void 0 && (_this$_view = _this$_view.runtime) !== null && _this$_view !== void 0 && _this$_view.openLinkDialog) {
123
+ if ((_this$_view = _this._view) !== null && _this$_view !== void 0 && (_this$_view = _this$_view.runtime) !== null && _this$_view !== void 0 && _this$_view.openLinkDialog && urlObj.hostname !== window.location.hostname) {
123
124
  _this._view.runtime.openLinkDialog(url, popupString);
124
125
  } else {
125
126
  window.open(url);
@@ -167,6 +167,7 @@ class LinkTooltipView {
167
167
  }
168
168
  return;
169
169
  }
170
+ const urlObj = new URL(href);
170
171
  if (href) {
171
172
  const url = sanitizeURL(href);
172
173
  let popupString;
@@ -177,7 +178,7 @@ class LinkTooltipView {
177
178
  popupString = '';
178
179
  }
179
180
 
180
- if (this._view?.runtime?.openLinkDialog) {
181
+ if (this._view?.runtime?.openLinkDialog && urlObj.hostname !== window.location.hostname) {
181
182
  this._view.runtime.openLinkDialog(url, popupString);
182
183
  } else {
183
184
  window.open(url);
@@ -18,6 +18,7 @@ import { EditorView } from 'prosemirror-view';
18
18
  import * as React from 'react';
19
19
  import { clearMarks, clearHeading } from '@modusoperandi/licit-ui-commands';
20
20
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
21
+ import { CellSelection } from 'prosemirror-tables';
21
22
  var MarksClearCommand = /*#__PURE__*/function (_UICommand) {
22
23
  function MarksClearCommand() {
23
24
  var _this;
@@ -31,7 +32,7 @@ var MarksClearCommand = /*#__PURE__*/function (_UICommand) {
31
32
  });
32
33
  _defineProperty(_this, "isEnabled", function (state) {
33
34
  var selection = state.selection;
34
- return !selection.empty && (selection instanceof TextSelection || selection instanceof AllSelection);
35
+ return !selection.empty && (selection instanceof TextSelection || selection instanceof AllSelection || selection instanceof CellSelection);
35
36
  });
36
37
  _defineProperty(_this, "execute", function (state, dispatch, view) {
37
38
  var tr = clearMarks(state.tr.setSelection(state.selection), state.schema);
@@ -6,6 +6,7 @@ import { EditorView } from 'prosemirror-view';
6
6
  import * as React from 'react';
7
7
  import { clearMarks, clearHeading } from '@modusoperandi/licit-ui-commands';
8
8
  import { UICommand } from '@modusoperandi/licit-doc-attrs-step';
9
+ import { CellSelection } from 'prosemirror-tables';
9
10
 
10
11
  class MarksClearCommand extends UICommand {
11
12
  isActive = (state: EditorState): boolean => {
@@ -16,7 +17,7 @@ class MarksClearCommand extends UICommand {
16
17
  const { selection } = state;
17
18
  return (
18
19
  !selection.empty &&
19
- (selection instanceof TextSelection || selection instanceof AllSelection)
20
+ (selection instanceof TextSelection || selection instanceof AllSelection || selection instanceof CellSelection)
20
21
  );
21
22
  };
22
23