@atlaskit/editor-plugin-selection-marker 1.5.14 → 1.5.16
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 +14 -0
- package/dist/cjs/pm-plugins/main.js +13 -2
- package/dist/es2019/pm-plugins/main.js +13 -2
- package/dist/esm/pm-plugins/main.js +13 -2
- package/package.json +14 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-marker
|
|
2
2
|
|
|
3
|
+
## 1.5.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#174793](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/174793)
|
|
8
|
+
[`43b642d08a4ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/43b642d08a4ec) -
|
|
9
|
+
ED-24453 delay decoration removal on edge when users are interacting with spelling suggestions
|
|
10
|
+
|
|
11
|
+
## 1.5.15
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 1.5.14
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -8,10 +8,13 @@ exports.createPlugin = exports.applyNextPluginState = void 0;
|
|
|
8
8
|
exports.dispatchShouldHideDecorations = dispatchShouldHideDecorations;
|
|
9
9
|
exports.key = void 0;
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
12
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
11
13
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
16
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
18
|
var _selectionDecoration = require("../ui/selection-decoration");
|
|
16
19
|
var _widgetDecoration = require("../ui/widget-decoration");
|
|
17
20
|
var key = exports.key = new _state.PluginKey('selectionMarker');
|
|
@@ -56,6 +59,10 @@ var applyNextPluginState = exports.applyNextPluginState = function applyNextPlug
|
|
|
56
59
|
decorationType: type
|
|
57
60
|
};
|
|
58
61
|
};
|
|
62
|
+
var debouncedDecorations = (0, _debounce.default)(function (state) {
|
|
63
|
+
var _key$getState;
|
|
64
|
+
return (_key$getState = key.getState(state)) === null || _key$getState === void 0 ? void 0 : _key$getState.decorations;
|
|
65
|
+
}, 25);
|
|
59
66
|
var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
60
67
|
return new _safePlugin.SafePlugin({
|
|
61
68
|
key: key,
|
|
@@ -72,8 +79,12 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
72
79
|
},
|
|
73
80
|
props: {
|
|
74
81
|
decorations: function decorations(state) {
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
if (_browser.browser.ie && (0, _platformFeatureFlags.fg)('platform_editor_plugin_selection_marker_bugfix')) {
|
|
83
|
+
return debouncedDecorations(state);
|
|
84
|
+
} else {
|
|
85
|
+
var _key$getState2;
|
|
86
|
+
return (_key$getState2 = key.getState(state)) === null || _key$getState2 === void 0 ? void 0 : _key$getState2.decorations;
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import debounce from 'lodash/debounce';
|
|
2
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
1
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
4
|
import { isEmptyDocument } from '@atlaskit/editor-common/utils';
|
|
3
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
8
|
import { selectionDecoration } from '../ui/selection-decoration';
|
|
6
9
|
import { createWidgetDecoration } from '../ui/widget-decoration';
|
|
7
10
|
export const key = new PluginKey('selectionMarker');
|
|
@@ -48,6 +51,10 @@ export const applyNextPluginState = (tr, currentState, oldEditorState) => {
|
|
|
48
51
|
decorationType: type
|
|
49
52
|
};
|
|
50
53
|
};
|
|
54
|
+
const debouncedDecorations = debounce(state => {
|
|
55
|
+
var _key$getState;
|
|
56
|
+
return (_key$getState = key.getState(state)) === null || _key$getState === void 0 ? void 0 : _key$getState.decorations;
|
|
57
|
+
}, 25);
|
|
51
58
|
export const createPlugin = api => {
|
|
52
59
|
return new SafePlugin({
|
|
53
60
|
key,
|
|
@@ -64,8 +71,12 @@ export const createPlugin = api => {
|
|
|
64
71
|
},
|
|
65
72
|
props: {
|
|
66
73
|
decorations: state => {
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
if (browser.ie && fg('platform_editor_plugin_selection_marker_bugfix')) {
|
|
75
|
+
return debouncedDecorations(state);
|
|
76
|
+
} else {
|
|
77
|
+
var _key$getState2;
|
|
78
|
+
return (_key$getState2 = key.getState(state)) === null || _key$getState2 === void 0 ? void 0 : _key$getState2.decorations;
|
|
79
|
+
}
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
2
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
5
|
import { isEmptyDocument } from '@atlaskit/editor-common/utils';
|
|
4
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
7
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
9
|
import { selectionDecoration } from '../ui/selection-decoration';
|
|
7
10
|
import { createWidgetDecoration } from '../ui/widget-decoration';
|
|
8
11
|
export var key = new PluginKey('selectionMarker');
|
|
@@ -47,6 +50,10 @@ export var applyNextPluginState = function applyNextPluginState(tr, currentState
|
|
|
47
50
|
decorationType: type
|
|
48
51
|
};
|
|
49
52
|
};
|
|
53
|
+
var debouncedDecorations = debounce(function (state) {
|
|
54
|
+
var _key$getState;
|
|
55
|
+
return (_key$getState = key.getState(state)) === null || _key$getState === void 0 ? void 0 : _key$getState.decorations;
|
|
56
|
+
}, 25);
|
|
50
57
|
export var createPlugin = function createPlugin(api) {
|
|
51
58
|
return new SafePlugin({
|
|
52
59
|
key: key,
|
|
@@ -63,8 +70,12 @@ export var createPlugin = function createPlugin(api) {
|
|
|
63
70
|
},
|
|
64
71
|
props: {
|
|
65
72
|
decorations: function decorations(state) {
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
if (browser.ie && fg('platform_editor_plugin_selection_marker_bugfix')) {
|
|
74
|
+
return debouncedDecorations(state);
|
|
75
|
+
} else {
|
|
76
|
+
var _key$getState2;
|
|
77
|
+
return (_key$getState2 = key.getState(state)) === null || _key$getState2 === void 0 ? void 0 : _key$getState2.decorations;
|
|
78
|
+
}
|
|
68
79
|
}
|
|
69
80
|
}
|
|
70
81
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-marker",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.16",
|
|
4
4
|
"description": "Selection marker plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,16 +29,18 @@
|
|
|
29
29
|
".": "./src/index.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/editor-common": "^
|
|
32
|
+
"@atlaskit/editor-common": "^96.3.0",
|
|
33
33
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
34
34
|
"@atlaskit/editor-plugin-focus": "^1.4.0",
|
|
35
|
-
"@atlaskit/editor-plugin-type-ahead": "^1.
|
|
36
|
-
"@atlaskit/editor-prosemirror": "6.
|
|
37
|
-
"@atlaskit/
|
|
35
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
36
|
+
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
37
|
+
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
38
|
+
"@atlaskit/primitives": "^13.3.0",
|
|
38
39
|
"@atlaskit/theme": "^14.0.0",
|
|
39
|
-
"@atlaskit/tokens": "^2.
|
|
40
|
+
"@atlaskit/tokens": "^2.4.0",
|
|
40
41
|
"@babel/runtime": "^7.0.0",
|
|
41
|
-
"@emotion/react": "^11.7.1"
|
|
42
|
+
"@emotion/react": "^11.7.1",
|
|
43
|
+
"lodash": "^4.17.21"
|
|
42
44
|
},
|
|
43
45
|
"peerDependencies": {
|
|
44
46
|
"react": "^16.8.0 || ^17.0.0 || ~18.2.0",
|
|
@@ -88,5 +90,10 @@
|
|
|
88
90
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
89
91
|
]
|
|
90
92
|
}
|
|
93
|
+
},
|
|
94
|
+
"platform-feature-flags": {
|
|
95
|
+
"platform_editor_plugin_selection_marker_bugfix": {
|
|
96
|
+
"type": "boolean"
|
|
97
|
+
}
|
|
91
98
|
}
|
|
92
99
|
}
|