@atlaskit/editor-plugin-hyperlink 8.1.11 → 8.1.13
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 +16 -0
- package/dist/cjs/pm-plugins/fake-cursor-for-toolbar.js +0 -9
- package/dist/cjs/pm-plugins/main.js +0 -10
- package/dist/cjs/pm-plugins/toolbar-buttons.js +0 -4
- package/dist/es2019/pm-plugins/fake-cursor-for-toolbar.js +0 -12
- package/dist/es2019/pm-plugins/main.js +0 -12
- package/dist/es2019/pm-plugins/toolbar-buttons.js +0 -4
- package/dist/esm/pm-plugins/fake-cursor-for-toolbar.js +0 -9
- package/dist/esm/pm-plugins/main.js +0 -10
- package/dist/esm/pm-plugins/toolbar-buttons.js +0 -4
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-hyperlink
|
|
2
2
|
|
|
3
|
+
## 8.1.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e3779b75fdeca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3779b75fdeca) -
|
|
8
|
+
EDITOR-1643 Promote syncBlock and bodiedSyncBlock to full schema
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 8.1.12
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
|
|
16
|
+
tsignores added for help-center local consumpton removed
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 8.1.11
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -33,11 +33,9 @@ var getInsertLinkToolbarState = function getInsertLinkToolbarState(editorState)
|
|
|
33
33
|
var fakeCursorToolbarPlugin = new _safePlugin.SafePlugin({
|
|
34
34
|
key: _fakeCurorForToolbarPluginKey.fakeCursorForToolbarPluginKey,
|
|
35
35
|
state: {
|
|
36
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
37
36
|
init: function init() {
|
|
38
37
|
return _view.DecorationSet.empty;
|
|
39
38
|
},
|
|
40
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
41
39
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
42
40
|
var oldInsertToolbarState = getInsertLinkToolbarState(oldState);
|
|
43
41
|
var insertToolbarState = getInsertLinkToolbarState(newState);
|
|
@@ -45,15 +43,9 @@ var fakeCursorToolbarPlugin = new _safePlugin.SafePlugin({
|
|
|
45
43
|
if (oldInsertToolbarState && insertToolbarState) {
|
|
46
44
|
var from = insertToolbarState.from,
|
|
47
45
|
to = insertToolbarState.to;
|
|
48
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
49
|
-
|
|
50
46
|
var oldFrom = tr.mapping.map(oldInsertToolbarState.from);
|
|
51
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
52
|
-
|
|
53
47
|
var oldTo = tr.mapping.map(oldInsertToolbarState.to);
|
|
54
48
|
if (oldFrom === from && oldTo === to) {
|
|
55
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
56
|
-
|
|
57
49
|
return pluginState.map(tr.mapping, tr.doc);
|
|
58
50
|
}
|
|
59
51
|
}
|
|
@@ -67,7 +59,6 @@ var fakeCursorToolbarPlugin = new _safePlugin.SafePlugin({
|
|
|
67
59
|
}
|
|
68
60
|
},
|
|
69
61
|
props: {
|
|
70
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
71
62
|
decorations: function decorations(state) {
|
|
72
63
|
return _fakeCurorForToolbarPluginKey.fakeCursorForToolbarPluginKey.getState(state);
|
|
73
64
|
}
|
|
@@ -36,11 +36,7 @@ var mapTransactionToState = function mapTransactionToState(state, tr) {
|
|
|
36
36
|
return;
|
|
37
37
|
} else if (state.type === _link3.InsertStatus.INSERT_LINK_TOOLBAR) {
|
|
38
38
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
39
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
40
|
-
|
|
41
39
|
from: tr.mapping.map(state.from),
|
|
42
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
43
|
-
|
|
44
40
|
to: tr.mapping.map(state.to)
|
|
45
41
|
});
|
|
46
42
|
}
|
|
@@ -140,7 +136,6 @@ var stateKey = exports.stateKey = new _state.PluginKey('hyperlinkPlugin');
|
|
|
140
136
|
var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance, pluginInjectionApi, onClickCallback, __livePage) {
|
|
141
137
|
return new _safePlugin.SafePlugin({
|
|
142
138
|
state: {
|
|
143
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
144
139
|
init: function init(_, state) {
|
|
145
140
|
var canInsertLink = (0, _utils.canLinkBeCreatedInRange)(state.selection.from, state.selection.to)(state);
|
|
146
141
|
return {
|
|
@@ -151,7 +146,6 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
|
|
|
151
146
|
editorAppearance: editorAppearance
|
|
152
147
|
};
|
|
153
148
|
},
|
|
154
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
155
149
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
156
150
|
var state = pluginState;
|
|
157
151
|
var action = tr.getMeta(stateKey) && tr.getMeta(stateKey).type;
|
|
@@ -206,11 +200,8 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
|
|
|
206
200
|
decorations: function decorations() {
|
|
207
201
|
return _view.DecorationSet.empty;
|
|
208
202
|
},
|
|
209
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
210
|
-
|
|
211
203
|
handleDOMEvents: {
|
|
212
204
|
// Ignored via go/ees005
|
|
213
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
214
205
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
215
206
|
mouseup: function mouseup(_, event) {
|
|
216
207
|
// this prevents redundant selection transaction when clicking on link
|
|
@@ -222,7 +213,6 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
|
|
|
222
213
|
return false;
|
|
223
214
|
},
|
|
224
215
|
// Ignored via go/ees005
|
|
225
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
226
216
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
227
217
|
mousedown: function mousedown(view, event) {
|
|
228
218
|
// since link clicks are disallowed by browsers inside contenteditable
|
|
@@ -11,13 +11,9 @@ var toolbarButtonsPlugin = exports.toolbarButtonsPlugin = function toolbarButton
|
|
|
11
11
|
return new _safePlugin.SafePlugin({
|
|
12
12
|
key: toolbarKey,
|
|
13
13
|
state: {
|
|
14
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
15
|
-
|
|
16
14
|
init: function init(_, __) {
|
|
17
15
|
return initialState;
|
|
18
16
|
},
|
|
19
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
20
|
-
|
|
21
17
|
apply: function apply(tr, pluginState) {
|
|
22
18
|
var metaState = tr.getMeta(toolbarKey);
|
|
23
19
|
if (metaState) {
|
|
@@ -25,13 +25,9 @@ const getInsertLinkToolbarState = editorState => {
|
|
|
25
25
|
const fakeCursorToolbarPlugin = new SafePlugin({
|
|
26
26
|
key: fakeCursorForToolbarPluginKey,
|
|
27
27
|
state: {
|
|
28
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
29
|
-
|
|
30
28
|
init() {
|
|
31
29
|
return DecorationSet.empty;
|
|
32
30
|
},
|
|
33
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
34
|
-
|
|
35
31
|
apply(tr, pluginState, oldState, newState) {
|
|
36
32
|
const oldInsertToolbarState = getInsertLinkToolbarState(oldState);
|
|
37
33
|
const insertToolbarState = getInsertLinkToolbarState(newState);
|
|
@@ -41,15 +37,9 @@ const fakeCursorToolbarPlugin = new SafePlugin({
|
|
|
41
37
|
from,
|
|
42
38
|
to
|
|
43
39
|
} = insertToolbarState;
|
|
44
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
45
|
-
|
|
46
40
|
const oldFrom = tr.mapping.map(oldInsertToolbarState.from);
|
|
47
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
48
|
-
|
|
49
41
|
const oldTo = tr.mapping.map(oldInsertToolbarState.to);
|
|
50
42
|
if (oldFrom === from && oldTo === to) {
|
|
51
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
52
|
-
|
|
53
43
|
return pluginState.map(tr.mapping, tr.doc);
|
|
54
44
|
}
|
|
55
45
|
}
|
|
@@ -65,8 +55,6 @@ const fakeCursorToolbarPlugin = new SafePlugin({
|
|
|
65
55
|
}
|
|
66
56
|
},
|
|
67
57
|
props: {
|
|
68
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
69
|
-
|
|
70
58
|
decorations(state) {
|
|
71
59
|
return fakeCursorForToolbarPluginKey.getState(state);
|
|
72
60
|
}
|
|
@@ -30,11 +30,7 @@ const mapTransactionToState = (state, tr) => {
|
|
|
30
30
|
} else if (state.type === InsertStatus.INSERT_LINK_TOOLBAR) {
|
|
31
31
|
return {
|
|
32
32
|
...state,
|
|
33
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
34
|
-
|
|
35
33
|
from: tr.mapping.map(state.from),
|
|
36
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
37
|
-
|
|
38
34
|
to: tr.mapping.map(state.to)
|
|
39
35
|
};
|
|
40
36
|
}
|
|
@@ -138,8 +134,6 @@ const getActiveText = selection => {
|
|
|
138
134
|
export const stateKey = new PluginKey('hyperlinkPlugin');
|
|
139
135
|
export const plugin = (dispatch, intl, editorAppearance, pluginInjectionApi, onClickCallback, __livePage) => new SafePlugin({
|
|
140
136
|
state: {
|
|
141
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
142
|
-
|
|
143
137
|
init(_, state) {
|
|
144
138
|
const canInsertLink = canLinkBeCreatedInRange(state.selection.from, state.selection.to)(state);
|
|
145
139
|
return {
|
|
@@ -150,8 +144,6 @@ export const plugin = (dispatch, intl, editorAppearance, pluginInjectionApi, onC
|
|
|
150
144
|
editorAppearance
|
|
151
145
|
};
|
|
152
146
|
},
|
|
153
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
154
|
-
|
|
155
147
|
apply(tr, pluginState, oldState, newState) {
|
|
156
148
|
let state = pluginState;
|
|
157
149
|
const action = tr.getMeta(stateKey) && tr.getMeta(stateKey).type;
|
|
@@ -207,11 +199,8 @@ export const plugin = (dispatch, intl, editorAppearance, pluginInjectionApi, onC
|
|
|
207
199
|
decorations: () => {
|
|
208
200
|
return DecorationSet.empty;
|
|
209
201
|
},
|
|
210
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
211
|
-
|
|
212
202
|
handleDOMEvents: {
|
|
213
203
|
// Ignored via go/ees005
|
|
214
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
215
204
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
216
205
|
mouseup: (_, event) => {
|
|
217
206
|
// this prevents redundant selection transaction when clicking on link
|
|
@@ -223,7 +212,6 @@ export const plugin = (dispatch, intl, editorAppearance, pluginInjectionApi, onC
|
|
|
223
212
|
return false;
|
|
224
213
|
},
|
|
225
214
|
// Ignored via go/ees005
|
|
226
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
227
215
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
228
216
|
mousedown: (view, event) => {
|
|
229
217
|
// since link clicks are disallowed by browsers inside contenteditable
|
|
@@ -5,13 +5,9 @@ export const toolbarButtonsPlugin = initialState => {
|
|
|
5
5
|
return new SafePlugin({
|
|
6
6
|
key: toolbarKey,
|
|
7
7
|
state: {
|
|
8
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
9
|
-
|
|
10
8
|
init: (_, __) => {
|
|
11
9
|
return initialState;
|
|
12
10
|
},
|
|
13
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
14
|
-
|
|
15
11
|
apply: (tr, pluginState) => {
|
|
16
12
|
const metaState = tr.getMeta(toolbarKey);
|
|
17
13
|
if (metaState) {
|
|
@@ -27,11 +27,9 @@ var getInsertLinkToolbarState = function getInsertLinkToolbarState(editorState)
|
|
|
27
27
|
var fakeCursorToolbarPlugin = new SafePlugin({
|
|
28
28
|
key: fakeCursorForToolbarPluginKey,
|
|
29
29
|
state: {
|
|
30
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
31
30
|
init: function init() {
|
|
32
31
|
return DecorationSet.empty;
|
|
33
32
|
},
|
|
34
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
35
33
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
36
34
|
var oldInsertToolbarState = getInsertLinkToolbarState(oldState);
|
|
37
35
|
var insertToolbarState = getInsertLinkToolbarState(newState);
|
|
@@ -39,15 +37,9 @@ var fakeCursorToolbarPlugin = new SafePlugin({
|
|
|
39
37
|
if (oldInsertToolbarState && insertToolbarState) {
|
|
40
38
|
var from = insertToolbarState.from,
|
|
41
39
|
to = insertToolbarState.to;
|
|
42
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
43
|
-
|
|
44
40
|
var oldFrom = tr.mapping.map(oldInsertToolbarState.from);
|
|
45
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
46
|
-
|
|
47
41
|
var oldTo = tr.mapping.map(oldInsertToolbarState.to);
|
|
48
42
|
if (oldFrom === from && oldTo === to) {
|
|
49
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
50
|
-
|
|
51
43
|
return pluginState.map(tr.mapping, tr.doc);
|
|
52
44
|
}
|
|
53
45
|
}
|
|
@@ -61,7 +53,6 @@ var fakeCursorToolbarPlugin = new SafePlugin({
|
|
|
61
53
|
}
|
|
62
54
|
},
|
|
63
55
|
props: {
|
|
64
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
65
56
|
decorations: function decorations(state) {
|
|
66
57
|
return fakeCursorForToolbarPluginKey.getState(state);
|
|
67
58
|
}
|
|
@@ -30,11 +30,7 @@ var mapTransactionToState = function mapTransactionToState(state, tr) {
|
|
|
30
30
|
return;
|
|
31
31
|
} else if (state.type === InsertStatus.INSERT_LINK_TOOLBAR) {
|
|
32
32
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
33
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
34
|
-
|
|
35
33
|
from: tr.mapping.map(state.from),
|
|
36
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
37
|
-
|
|
38
34
|
to: tr.mapping.map(state.to)
|
|
39
35
|
});
|
|
40
36
|
}
|
|
@@ -134,7 +130,6 @@ export var stateKey = new PluginKey('hyperlinkPlugin');
|
|
|
134
130
|
export var plugin = function plugin(dispatch, intl, editorAppearance, pluginInjectionApi, onClickCallback, __livePage) {
|
|
135
131
|
return new SafePlugin({
|
|
136
132
|
state: {
|
|
137
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
138
133
|
init: function init(_, state) {
|
|
139
134
|
var canInsertLink = canLinkBeCreatedInRange(state.selection.from, state.selection.to)(state);
|
|
140
135
|
return {
|
|
@@ -145,7 +140,6 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, pluginInje
|
|
|
145
140
|
editorAppearance: editorAppearance
|
|
146
141
|
};
|
|
147
142
|
},
|
|
148
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
149
143
|
apply: function apply(tr, pluginState, oldState, newState) {
|
|
150
144
|
var state = pluginState;
|
|
151
145
|
var action = tr.getMeta(stateKey) && tr.getMeta(stateKey).type;
|
|
@@ -200,11 +194,8 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, pluginInje
|
|
|
200
194
|
decorations: function decorations() {
|
|
201
195
|
return DecorationSet.empty;
|
|
202
196
|
},
|
|
203
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
204
|
-
|
|
205
197
|
handleDOMEvents: {
|
|
206
198
|
// Ignored via go/ees005
|
|
207
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
208
199
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
200
|
mouseup: function mouseup(_, event) {
|
|
210
201
|
// this prevents redundant selection transaction when clicking on link
|
|
@@ -216,7 +207,6 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, pluginInje
|
|
|
216
207
|
return false;
|
|
217
208
|
},
|
|
218
209
|
// Ignored via go/ees005
|
|
219
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
220
210
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
221
211
|
mousedown: function mousedown(view, event) {
|
|
222
212
|
// since link clicks are disallowed by browsers inside contenteditable
|
|
@@ -5,13 +5,9 @@ export var toolbarButtonsPlugin = function toolbarButtonsPlugin(initialState) {
|
|
|
5
5
|
return new SafePlugin({
|
|
6
6
|
key: toolbarKey,
|
|
7
7
|
state: {
|
|
8
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
9
|
-
|
|
10
8
|
init: function init(_, __) {
|
|
11
9
|
return initialState;
|
|
12
10
|
},
|
|
13
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
14
|
-
|
|
15
11
|
apply: function apply(tr, pluginState) {
|
|
16
12
|
var metaState = tr.getMeta(toolbarKey);
|
|
17
13
|
if (metaState) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-hyperlink",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.13",
|
|
4
4
|
"description": "Hyperlink plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^51.
|
|
32
|
+
"@atlaskit/adf-schema": "^51.5.1",
|
|
33
33
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-card": "^11.5.0",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"@atlaskit/icon": "^29.0.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^14.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^14.5.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"uuid": "^3.1.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^110.
|
|
54
|
+
"@atlaskit/editor-common": "^110.38.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-dom": "^18.2.0",
|
|
57
57
|
"react-intl-next": "npm:react-intl@^5.18.1"
|