@lobehub/editor 1.21.0 → 1.21.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/es/plugins/link-highlight/command/index.js +6 -4
- package/es/plugins/link-highlight/node/link-highlight.d.ts +9 -13
- package/es/plugins/link-highlight/node/link-highlight.js +41 -88
- package/es/plugins/link-highlight/plugin/index.js +15 -17
- package/es/plugins/link-highlight/react/style.js +2 -3
- package/package.json +1 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
2
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
3
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4
|
-
import { $getSelection, $insertNodes, $isRangeSelection, COMMAND_PRIORITY_EDITOR, createCommand } from 'lexical';
|
|
5
|
-
import { $createCursorNode } from "../../common/node/cursor";
|
|
4
|
+
import { $createTextNode, $getSelection, $insertNodes, $isRangeSelection, COMMAND_PRIORITY_EDITOR, createCommand } from 'lexical';
|
|
6
5
|
import { $createLinkHighlightNode, $isLinkHighlightNode, getLinkHighlightNode } from "../node/link-highlight";
|
|
7
6
|
export var INSERT_LINK_HIGHLIGHT_COMMAND = createCommand('INSERT_LINK_HIGHLIGHT_COMMAND');
|
|
8
7
|
export function registerLinkHighlightCommand(editor) {
|
|
@@ -37,8 +36,11 @@ export function registerLinkHighlightCommand(editor) {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
// Create link highlight with selected text
|
|
40
|
-
var
|
|
41
|
-
|
|
39
|
+
var selectedText = selection.getTextContent();
|
|
40
|
+
var linkHighlightNode = $createLinkHighlightNode();
|
|
41
|
+
var textNode = $createTextNode(selectedText);
|
|
42
|
+
linkHighlightNode.append(textNode);
|
|
43
|
+
$insertNodes([linkHighlightNode]);
|
|
42
44
|
linkHighlightNode.select();
|
|
43
45
|
});
|
|
44
46
|
return true;
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import { EditorConfig, LexicalEditor, LexicalNode, SerializedElementNode } from 'lexical';
|
|
2
|
-
import { CardLikeElementNode } from "../../common/node/cursor";
|
|
1
|
+
import { EditorConfig, ElementNode, LexicalEditor, LexicalNode, SerializedElementNode } from 'lexical';
|
|
3
2
|
export type SerializedLinkHighlightNode = SerializedElementNode;
|
|
4
|
-
export declare class LinkHighlightNode extends
|
|
3
|
+
export declare class LinkHighlightNode extends ElementNode {
|
|
5
4
|
static getType(): string;
|
|
6
5
|
static clone(node: LinkHighlightNode): LinkHighlightNode;
|
|
7
6
|
static importJSON(serializedNode: SerializedLinkHighlightNode): LinkHighlightNode;
|
|
8
|
-
createDOM(config: EditorConfig
|
|
7
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
9
8
|
/**
|
|
10
9
|
* Format URL to ensure it has proper protocol
|
|
11
10
|
*/
|
|
12
11
|
private formatUrl;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
canIndent(): boolean;
|
|
18
|
-
canInsertTextBefore(): boolean;
|
|
19
|
-
canInsertTextAfter(): boolean;
|
|
12
|
+
canBeEmpty(): false;
|
|
13
|
+
isInline(): true;
|
|
14
|
+
canInsertTextBefore(): false;
|
|
15
|
+
canInsertTextAfter(): false;
|
|
20
16
|
updateDOM(prevNode: LinkHighlightNode, dom: HTMLElement, config: EditorConfig): boolean;
|
|
21
17
|
/**
|
|
22
18
|
* Get the URL from the text content
|
|
23
19
|
*/
|
|
24
20
|
getURL(): string;
|
|
25
21
|
}
|
|
26
|
-
export declare function $createLinkHighlightNode(
|
|
22
|
+
export declare function $createLinkHighlightNode(): LinkHighlightNode;
|
|
27
23
|
export declare function $isLinkHighlightNode(node: unknown): node is LinkHighlightNode;
|
|
28
|
-
export declare function getLinkHighlightNode(node: LexicalNode):
|
|
24
|
+
export declare function getLinkHighlightNode(node: LexicalNode): LinkHighlightNode | null;
|
|
29
25
|
export declare function $isSelectionInLinkHighlight(editor: LexicalEditor): boolean;
|
|
@@ -4,8 +4,6 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
8
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
9
7
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
8
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -15,10 +13,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
15
13
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
14
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
17
15
|
import { addClassNamesToElement } from '@lexical/utils';
|
|
18
|
-
import { $applyNodeReplacement, $
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_inherits(LinkHighlightNode, _CardLikeElementNode);
|
|
16
|
+
import { $applyNodeReplacement, $getSelection, $isNodeSelection, $isRangeSelection, ElementNode } from 'lexical';
|
|
17
|
+
export var LinkHighlightNode = /*#__PURE__*/function (_ElementNode) {
|
|
18
|
+
_inherits(LinkHighlightNode, _ElementNode);
|
|
22
19
|
var _super = _createSuper(LinkHighlightNode);
|
|
23
20
|
function LinkHighlightNode() {
|
|
24
21
|
_classCallCheck(this, LinkHighlightNode);
|
|
@@ -26,33 +23,17 @@ export var LinkHighlightNode = /*#__PURE__*/function (_CardLikeElementNode) {
|
|
|
26
23
|
}
|
|
27
24
|
_createClass(LinkHighlightNode, [{
|
|
28
25
|
key: "createDOM",
|
|
29
|
-
value: function createDOM(config
|
|
30
|
-
var
|
|
31
|
-
var element = document.createElement('span');
|
|
32
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-dataset
|
|
33
|
-
element.setAttribute('data-lexical-key', this.getKey());
|
|
34
|
-
var childContainer = document.createElement('ne-content');
|
|
35
|
-
element.append(childContainer);
|
|
36
|
-
addClassNamesToElement(element, config.theme.linkHighlight);
|
|
37
|
-
|
|
38
|
-
// Add click handler to open link in new window
|
|
39
|
-
element.addEventListener('click', function (event) {
|
|
40
|
-
// Only handle left click without modifier keys
|
|
41
|
-
if (event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey) {
|
|
42
|
-
event.preventDefault();
|
|
43
|
-
event.stopPropagation();
|
|
26
|
+
value: function createDOM(config) {
|
|
27
|
+
var element = document.createElement('a');
|
|
44
28
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
29
|
+
// Set link attributes
|
|
30
|
+
var url = this.getURL();
|
|
31
|
+
if (url) {
|
|
32
|
+
element.href = this.formatUrl(url);
|
|
33
|
+
}
|
|
34
|
+
element.setAttribute('target', '_blank');
|
|
35
|
+
element.setAttribute('rel', 'noopener noreferrer');
|
|
36
|
+
addClassNamesToElement(element, config.theme.linkHighlight);
|
|
56
37
|
return element;
|
|
57
38
|
}
|
|
58
39
|
|
|
@@ -88,44 +69,25 @@ export var LinkHighlightNode = /*#__PURE__*/function (_CardLikeElementNode) {
|
|
|
88
69
|
}
|
|
89
70
|
return url;
|
|
90
71
|
}
|
|
91
|
-
}, {
|
|
92
|
-
key: "getDOMSlot",
|
|
93
|
-
value: function getDOMSlot(element) {
|
|
94
|
-
var neContent = element.querySelector('ne-content');
|
|
95
|
-
if (!neContent) {
|
|
96
|
-
throw new Error('LinkHighlightNode: ne-content not found');
|
|
97
|
-
}
|
|
98
|
-
return _get(_getPrototypeOf(LinkHighlightNode.prototype), "getDOMSlot", this).call(this, element).withElement(neContent);
|
|
99
|
-
}
|
|
100
72
|
}, {
|
|
101
73
|
key: "canBeEmpty",
|
|
102
74
|
value: function canBeEmpty() {
|
|
103
75
|
return false;
|
|
104
76
|
}
|
|
105
|
-
}, {
|
|
106
|
-
key: "isCardLike",
|
|
107
|
-
value: function isCardLike() {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
77
|
}, {
|
|
111
78
|
key: "isInline",
|
|
112
79
|
value: function isInline() {
|
|
113
80
|
return true;
|
|
114
81
|
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "canIndent",
|
|
117
|
-
value: function canIndent() {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
82
|
}, {
|
|
121
83
|
key: "canInsertTextBefore",
|
|
122
84
|
value: function canInsertTextBefore() {
|
|
123
|
-
return
|
|
85
|
+
return false;
|
|
124
86
|
}
|
|
125
87
|
}, {
|
|
126
88
|
key: "canInsertTextAfter",
|
|
127
89
|
value: function canInsertTextAfter() {
|
|
128
|
-
return
|
|
90
|
+
return false;
|
|
129
91
|
}
|
|
130
92
|
}, {
|
|
131
93
|
key: "updateDOM",
|
|
@@ -135,6 +97,16 @@ export var LinkHighlightNode = /*#__PURE__*/function (_CardLikeElementNode) {
|
|
|
135
97
|
if (prevTheme !== this) {
|
|
136
98
|
addClassNamesToElement(dom, config.theme.linkHighlight);
|
|
137
99
|
}
|
|
100
|
+
|
|
101
|
+
// Update href attribute if it's an anchor element
|
|
102
|
+
if (dom instanceof HTMLAnchorElement) {
|
|
103
|
+
var url = this.getURL();
|
|
104
|
+
if (url) {
|
|
105
|
+
dom.href = this.formatUrl(url);
|
|
106
|
+
} else {
|
|
107
|
+
dom.removeAttribute('href');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
138
110
|
return false;
|
|
139
111
|
}
|
|
140
112
|
|
|
@@ -163,35 +135,20 @@ export var LinkHighlightNode = /*#__PURE__*/function (_CardLikeElementNode) {
|
|
|
163
135
|
}
|
|
164
136
|
}]);
|
|
165
137
|
return LinkHighlightNode;
|
|
166
|
-
}(
|
|
167
|
-
export function $createLinkHighlightNode(
|
|
168
|
-
|
|
169
|
-
var cursorNode = $createCursorNode();
|
|
170
|
-
linkHighlightNode.append(cursorNode);
|
|
171
|
-
if (textContent) {
|
|
172
|
-
linkHighlightNode.append($createTextNode(textContent));
|
|
173
|
-
}
|
|
174
|
-
return linkHighlightNode;
|
|
138
|
+
}(ElementNode);
|
|
139
|
+
export function $createLinkHighlightNode() {
|
|
140
|
+
return $applyNodeReplacement(new LinkHighlightNode());
|
|
175
141
|
}
|
|
176
142
|
export function $isLinkHighlightNode(node) {
|
|
177
143
|
return node instanceof LinkHighlightNode;
|
|
178
144
|
}
|
|
179
145
|
export function getLinkHighlightNode(node) {
|
|
180
|
-
if ($
|
|
181
|
-
|
|
182
|
-
if ($isLinkHighlightNode(parent)) {
|
|
183
|
-
return parent;
|
|
184
|
-
}
|
|
185
|
-
if ($isLinkHighlightNode(node.getNextSibling())) {
|
|
186
|
-
return node.getNextSibling();
|
|
187
|
-
}
|
|
188
|
-
if ($isLinkHighlightNode(node.getPreviousSibling())) {
|
|
189
|
-
return node.getPreviousSibling();
|
|
190
|
-
}
|
|
191
|
-
return null;
|
|
146
|
+
if ($isLinkHighlightNode(node)) {
|
|
147
|
+
return node;
|
|
192
148
|
}
|
|
193
|
-
|
|
194
|
-
|
|
149
|
+
var parent = node.getParent();
|
|
150
|
+
if ($isLinkHighlightNode(parent)) {
|
|
151
|
+
return parent;
|
|
195
152
|
}
|
|
196
153
|
return null;
|
|
197
154
|
}
|
|
@@ -204,19 +161,15 @@ export function $isSelectionInLinkHighlight(editor) {
|
|
|
204
161
|
if ($isRangeSelection(selection)) {
|
|
205
162
|
var focusNode = selection.focus.getNode();
|
|
206
163
|
var anchorNode = selection.anchor.getNode();
|
|
207
|
-
var
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return false;
|
|
215
|
-
} else if ($isNodeSelection(selection)) {
|
|
164
|
+
var focusLinkHighlight = getLinkHighlightNode(focusNode);
|
|
165
|
+
var anchorLinkHighlight = getLinkHighlightNode(anchorNode);
|
|
166
|
+
|
|
167
|
+
// Both nodes should be in the same link-highlight node
|
|
168
|
+
return focusLinkHighlight !== null && anchorLinkHighlight !== null && focusLinkHighlight === anchorLinkHighlight;
|
|
169
|
+
}
|
|
170
|
+
if ($isNodeSelection(selection)) {
|
|
216
171
|
var nodes = selection.getNodes();
|
|
217
|
-
|
|
218
|
-
return true;
|
|
219
|
-
}
|
|
172
|
+
return nodes.length === 1 && $isLinkHighlightNode(nodes[0]);
|
|
220
173
|
}
|
|
221
174
|
return false;
|
|
222
175
|
});
|
|
@@ -19,10 +19,9 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
19
19
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
21
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
22
|
-
import { $getSelection, $isRangeSelection, COMMAND_PRIORITY_NORMAL, PASTE_COMMAND } from 'lexical';
|
|
22
|
+
import { $createTextNode, $getSelection, $isRangeSelection, COMMAND_PRIORITY_NORMAL, PASTE_COMMAND } from 'lexical';
|
|
23
23
|
import { INodeHelper } from "../../../editor-kernel/inode/helper";
|
|
24
24
|
import { KernelPlugin } from "../../../editor-kernel/plugin";
|
|
25
|
-
import { $createCursorNode, cursorNodeSerialized } from "../../common/node/cursor";
|
|
26
25
|
import { IMarkdownShortCutService, MARKDOWN_READER_LEVEL_HIGH } from "../../markdown/service/shortcut";
|
|
27
26
|
import { createDebugLogger } from "../../../utils/debug";
|
|
28
27
|
import { registerLinkHighlightCommand } from "../command";
|
|
@@ -77,9 +76,10 @@ export var LinkHighlightPlugin = (_class = /*#__PURE__*/function (_KernelPlugin)
|
|
|
77
76
|
editor.update(function () {
|
|
78
77
|
var selection = $getSelection();
|
|
79
78
|
if ($isRangeSelection(selection)) {
|
|
80
|
-
var linkHighlightNode = $createLinkHighlightNode(
|
|
81
|
-
var
|
|
82
|
-
|
|
79
|
+
var linkHighlightNode = $createLinkHighlightNode();
|
|
80
|
+
var textNode = $createTextNode(data);
|
|
81
|
+
linkHighlightNode.append(textNode);
|
|
82
|
+
selection.insertNodes([linkHighlightNode]);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
return true;
|
|
@@ -95,7 +95,7 @@ export var LinkHighlightPlugin = (_class = /*#__PURE__*/function (_KernelPlugin)
|
|
|
95
95
|
|
|
96
96
|
// Register markdown writer for <link> format
|
|
97
97
|
markdownService.registerMarkdownWriter(LinkHighlightNode.getType(), function (ctx, node) {
|
|
98
|
-
ctx.appendLine(
|
|
98
|
+
ctx.appendLine(node.getTextContent());
|
|
99
99
|
return true;
|
|
100
100
|
});
|
|
101
101
|
|
|
@@ -110,10 +110,10 @@ export var LinkHighlightPlugin = (_class = /*#__PURE__*/function (_KernelPlugin)
|
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
_this2.logger.debug('Converting markdown auto-link to LinkHighlightNode:', url);
|
|
113
|
-
var linkHighlightNode = $createLinkHighlightNode(
|
|
114
|
-
var
|
|
113
|
+
var linkHighlightNode = $createLinkHighlightNode();
|
|
114
|
+
var textNodeContent = $createTextNode(url);
|
|
115
|
+
linkHighlightNode.append(textNodeContent);
|
|
115
116
|
textNode.replace(linkHighlightNode);
|
|
116
|
-
linkHighlightNode.insertAfter(cursorNode);
|
|
117
117
|
return undefined;
|
|
118
118
|
},
|
|
119
119
|
trigger: '>',
|
|
@@ -129,14 +129,14 @@ export var LinkHighlightPlugin = (_class = /*#__PURE__*/function (_KernelPlugin)
|
|
|
129
129
|
if (match) {
|
|
130
130
|
var url = match[1].replaceAll(/[\u200B-\u200D\u2060\uFEFF]/g, '');
|
|
131
131
|
_this2.logger.debug('Converting HTML auto-link to LinkHighlightNode:', url);
|
|
132
|
-
return
|
|
133
|
-
children: [
|
|
132
|
+
return INodeHelper.createElementNode('linkHighlight', {
|
|
133
|
+
children: [INodeHelper.createTextNode(url, {})],
|
|
134
134
|
direction: 'ltr',
|
|
135
135
|
format: '',
|
|
136
136
|
indent: 0,
|
|
137
137
|
type: 'linkHighlight',
|
|
138
138
|
version: 1
|
|
139
|
-
})
|
|
139
|
+
});
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// Not an auto-link, let other handlers process it
|
|
@@ -164,16 +164,14 @@ export var LinkHighlightPlugin = (_class = /*#__PURE__*/function (_KernelPlugin)
|
|
|
164
164
|
// If text matches URL exactly (auto-link syntax), convert to LinkHighlightNode
|
|
165
165
|
if (textContent === url) {
|
|
166
166
|
_this2.logger.debug('Converting markdown auto-link to LinkHighlightNode:', url);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return [INodeHelper.createElementNode('linkHighlight', {
|
|
170
|
-
children: [cursorNodeSerialized, INodeHelper.createTextNode(url, {})],
|
|
167
|
+
return INodeHelper.createElementNode('linkHighlight', {
|
|
168
|
+
children: [INodeHelper.createTextNode(url, {})],
|
|
171
169
|
direction: 'ltr',
|
|
172
170
|
format: '',
|
|
173
171
|
indent: 0,
|
|
174
172
|
type: 'linkHighlight',
|
|
175
173
|
version: 1
|
|
176
|
-
})
|
|
174
|
+
});
|
|
177
175
|
}
|
|
178
176
|
|
|
179
177
|
// Otherwise, let standard Link plugin handle it
|
|
@@ -2,9 +2,8 @@ var _templateObject;
|
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref) {
|
|
5
|
-
var css = _ref.css
|
|
6
|
-
token = _ref.token;
|
|
5
|
+
var css = _ref.css;
|
|
7
6
|
return {
|
|
8
|
-
linkHighlight: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor:
|
|
7
|
+
linkHighlight: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: unset;\n\n margin-block: 1em;\n margin-inline: 0;\n padding: 2px;\n border: none;\n "])))
|
|
9
8
|
};
|
|
10
9
|
});
|
package/package.json
CHANGED