@modusoperandi/licit 1.3.2 → 1.3.4
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/LinkTooltipPlugin.js +2 -2
- package/LinkTooltipPlugin.js.flow +2 -2
- package/MarksClearCommand.js +2 -1
- package/MarksClearCommand.js.flow +2 -1
- package/bom.xml +144 -500
- package/package.json +2 -2
package/LinkTooltipPlugin.js
CHANGED
|
@@ -23,7 +23,6 @@ import lookUpElement from './lookUpElement.js';
|
|
|
23
23
|
import LinkTooltip from './ui/LinkTooltip.js';
|
|
24
24
|
import scrollIntoView from 'smooth-scroll-into-view-if-needed';
|
|
25
25
|
import sanitizeURL from './sanitizeURL.js';
|
|
26
|
-
import '@modusoperandi/licit-ui-commands/ui/czi-pop-up.css';
|
|
27
26
|
var SPEC = {
|
|
28
27
|
key: new PluginKey('LinkTooltipPlugin'),
|
|
29
28
|
props: {
|
|
@@ -111,6 +110,7 @@ var LinkTooltipView = /*#__PURE__*/function () {
|
|
|
111
110
|
}
|
|
112
111
|
return;
|
|
113
112
|
}
|
|
113
|
+
var urlObj = new URL(href);
|
|
114
114
|
if (href) {
|
|
115
115
|
var _this$_view;
|
|
116
116
|
var url = sanitizeURL(href);
|
|
@@ -120,7 +120,7 @@ var LinkTooltipView = /*#__PURE__*/function () {
|
|
|
120
120
|
} else {
|
|
121
121
|
popupString = '';
|
|
122
122
|
}
|
|
123
|
-
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) {
|
|
124
124
|
_this._view.runtime.openLinkDialog(url, popupString);
|
|
125
125
|
} else {
|
|
126
126
|
window.open(url);
|
|
@@ -14,7 +14,6 @@ import LinkTooltip from './ui/LinkTooltip.js';
|
|
|
14
14
|
import scrollIntoView from 'smooth-scroll-into-view-if-needed';
|
|
15
15
|
|
|
16
16
|
import sanitizeURL from './sanitizeURL.js';
|
|
17
|
-
import '@modusoperandi/licit-ui-commands/ui/czi-pop-up.css';
|
|
18
17
|
|
|
19
18
|
const SPEC = {
|
|
20
19
|
key: new PluginKey('LinkTooltipPlugin'),
|
|
@@ -168,6 +167,7 @@ class LinkTooltipView {
|
|
|
168
167
|
}
|
|
169
168
|
return;
|
|
170
169
|
}
|
|
170
|
+
const urlObj = new URL(href);
|
|
171
171
|
if (href) {
|
|
172
172
|
const url = sanitizeURL(href);
|
|
173
173
|
let popupString;
|
|
@@ -178,7 +178,7 @@ class LinkTooltipView {
|
|
|
178
178
|
popupString = '';
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
if (this._view?.runtime?.openLinkDialog) {
|
|
181
|
+
if (this._view?.runtime?.openLinkDialog && urlObj.hostname !== window.location.hostname) {
|
|
182
182
|
this._view.runtime.openLinkDialog(url, popupString);
|
|
183
183
|
} else {
|
|
184
184
|
window.open(url);
|
package/MarksClearCommand.js
CHANGED
|
@@ -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
|
|