@atlaskit/editor-plugin-base 7.1.0 → 7.1.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/CHANGELOG.md +8 -4
- package/dist/cjs/pm-plugins/disable-spell-checking.js +14 -12
- package/dist/cjs/pm-plugins/inline-cursor-target.js +3 -1
- package/dist/es2019/pm-plugins/disable-spell-checking.js +5 -3
- package/dist/es2019/pm-plugins/inline-cursor-target.js +3 -1
- package/dist/esm/pm-plugins/disable-spell-checking.js +5 -3
- package/dist/esm/pm-plugins/inline-cursor-target.js +3 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-base
|
|
2
2
|
|
|
3
|
+
## 7.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`daff12e732636`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daff12e732636) -
|
|
8
|
+
use latest browser util
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -186,7 +194,6 @@
|
|
|
186
194
|
shared context or singletons.
|
|
187
195
|
|
|
188
196
|
**HOW TO ADJUST:**
|
|
189
|
-
|
|
190
197
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
191
198
|
any of these editor plugins.
|
|
192
199
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -1016,7 +1023,6 @@
|
|
|
1016
1023
|
- [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
|
|
1017
1024
|
[`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
|
|
1018
1025
|
feature flags plugin optional in all plugins including:
|
|
1019
|
-
|
|
1020
1026
|
- analytics
|
|
1021
1027
|
- base
|
|
1022
1028
|
- card
|
|
@@ -1091,13 +1097,11 @@
|
|
|
1091
1097
|
This change removes plugin exports from editor-core that were used only for the mobile bridge.
|
|
1092
1098
|
|
|
1093
1099
|
This includes:
|
|
1094
|
-
|
|
1095
1100
|
- All plugin keys
|
|
1096
1101
|
- Plugin commands
|
|
1097
1102
|
- Plugin types
|
|
1098
1103
|
|
|
1099
1104
|
The full list is:
|
|
1100
|
-
|
|
1101
1105
|
- EditorFeatureFlags (available via '@atlaskit/editor-common/types' as `FeatureFlags`)
|
|
1102
1106
|
- EmojiResource (available via '@atlaskit/emoji/resource' as `EmojiResource`)
|
|
1103
1107
|
- mediaPlugin
|
|
@@ -7,27 +7,28 @@ exports.default = void 0;
|
|
|
7
7
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
8
8
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
|
-
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
+
function getCurrentBrowserAndVersion(browserEnv) {
|
|
11
12
|
switch (true) {
|
|
12
|
-
case
|
|
13
|
+
case browserEnv.chrome === true:
|
|
13
14
|
return {
|
|
14
15
|
browser: 'chrome',
|
|
15
|
-
version:
|
|
16
|
+
version: browserEnv.chrome_version
|
|
16
17
|
};
|
|
17
|
-
case
|
|
18
|
+
case browserEnv.ie === true:
|
|
18
19
|
return {
|
|
19
20
|
browser: 'ie',
|
|
20
|
-
version:
|
|
21
|
+
version: browserEnv.ie_version
|
|
21
22
|
};
|
|
22
|
-
case
|
|
23
|
+
case browserEnv.gecko === true:
|
|
23
24
|
return {
|
|
24
25
|
browser: 'gecko',
|
|
25
|
-
version:
|
|
26
|
+
version: browserEnv.gecko_version
|
|
26
27
|
};
|
|
27
|
-
case
|
|
28
|
+
case browserEnv.safari === true:
|
|
28
29
|
return {
|
|
29
30
|
browser: 'safari',
|
|
30
|
-
version:
|
|
31
|
+
version: browserEnv.safari_version
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
return undefined;
|
|
@@ -41,7 +42,8 @@ var _default = exports.default = function _default(featureFlags) {
|
|
|
41
42
|
return {};
|
|
42
43
|
}
|
|
43
44
|
var browserConfigFeatureFlag = featureFlags.disableSpellcheckByBrowser;
|
|
44
|
-
var
|
|
45
|
+
var browserEnv = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
|
|
46
|
+
var userCurrentBrowserAndVersion = getCurrentBrowserAndVersion(browserEnv);
|
|
45
47
|
if (!userCurrentBrowserAndVersion || !browserConfigFeatureFlag) {
|
|
46
48
|
return {};
|
|
47
49
|
}
|
|
@@ -49,10 +51,10 @@ var _default = exports.default = function _default(featureFlags) {
|
|
|
49
51
|
// Ignored via go/ees005
|
|
50
52
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
51
53
|
browserConfigFeatureFlag[userCurrentBrowserAndVersion.browser];
|
|
52
|
-
if (!browserVersionDisableRange || !
|
|
54
|
+
if (!browserVersionDisableRange || !browserEnv[userCurrentBrowserAndVersion.browser]) {
|
|
53
55
|
return {};
|
|
54
56
|
}
|
|
55
|
-
var shouldDisableSpellcheck = !!browserVersionDisableRange.maximum ? userCurrentBrowserAndVersion.version >= browserVersionDisableRange.minimum && userCurrentBrowserAndVersion.version <= browserVersionDisableRange.maximum :
|
|
57
|
+
var shouldDisableSpellcheck = !!browserVersionDisableRange.maximum ? userCurrentBrowserAndVersion.version >= browserVersionDisableRange.minimum && userCurrentBrowserAndVersion.version <= browserVersionDisableRange.maximum : browserEnv[userCurrentBrowserAndVersion.browser] && userCurrentBrowserAndVersion.version >= browserVersionDisableRange.minimum;
|
|
56
58
|
if (shouldDisableSpellcheck) {
|
|
57
59
|
return {
|
|
58
60
|
spellcheck: 'false'
|
|
@@ -10,6 +10,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
10
10
|
var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
14
|
var inlineCursorTargetStateKey = exports.inlineCursorTargetStateKey = new _state.PluginKey('inlineCursorTargetPlugin');
|
|
14
15
|
var isInlineNodeView = function isInlineNodeView(node) {
|
|
15
16
|
/**
|
|
@@ -101,7 +102,8 @@ var _default = exports.default = function _default() {
|
|
|
101
102
|
// TODO: ED-26959 - We may be able to remove this when playing the following ticket:
|
|
102
103
|
// https://product-fabric.atlassian.net/browse/ED-14938
|
|
103
104
|
keydown: function keydown(view, event) {
|
|
104
|
-
|
|
105
|
+
var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
|
|
106
|
+
if (browser.safari && event instanceof KeyboardEvent && event.shiftKey && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
|
105
107
|
view.dispatch(view.state.tr.setMeta(inlineCursorTargetStateKey, {
|
|
106
108
|
cursorTarget: undefined
|
|
107
109
|
}));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { browser as
|
|
1
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
+
function getCurrentBrowserAndVersion(browserEnv) {
|
|
5
6
|
switch (true) {
|
|
6
7
|
case browserEnv.chrome === true:
|
|
7
8
|
return {
|
|
@@ -34,7 +35,8 @@ export default (featureFlags => new SafePlugin({
|
|
|
34
35
|
return {};
|
|
35
36
|
}
|
|
36
37
|
const browserConfigFeatureFlag = featureFlags.disableSpellcheckByBrowser;
|
|
37
|
-
const
|
|
38
|
+
const browserEnv = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
39
|
+
const userCurrentBrowserAndVersion = getCurrentBrowserAndVersion(browserEnv);
|
|
38
40
|
if (!userCurrentBrowserAndVersion || !browserConfigFeatureFlag) {
|
|
39
41
|
return {};
|
|
40
42
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
1
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { isTextSelection } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
export const inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
|
|
8
9
|
const isInlineNodeView = node => {
|
|
9
10
|
/**
|
|
@@ -102,6 +103,7 @@ export default (() => {
|
|
|
102
103
|
// TODO: ED-26959 - We may be able to remove this when playing the following ticket:
|
|
103
104
|
// https://product-fabric.atlassian.net/browse/ED-14938
|
|
104
105
|
keydown: (view, event) => {
|
|
106
|
+
const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
105
107
|
if (browser.safari && event instanceof KeyboardEvent && event.shiftKey && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
|
106
108
|
view.dispatch(view.state.tr.setMeta(inlineCursorTargetStateKey, {
|
|
107
109
|
cursorTarget: undefined
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { browser as
|
|
1
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
+
function getCurrentBrowserAndVersion(browserEnv) {
|
|
5
6
|
switch (true) {
|
|
6
7
|
case browserEnv.chrome === true:
|
|
7
8
|
return {
|
|
@@ -35,7 +36,8 @@ export default (function (featureFlags) {
|
|
|
35
36
|
return {};
|
|
36
37
|
}
|
|
37
38
|
var browserConfigFeatureFlag = featureFlags.disableSpellcheckByBrowser;
|
|
38
|
-
var
|
|
39
|
+
var browserEnv = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
40
|
+
var userCurrentBrowserAndVersion = getCurrentBrowserAndVersion(browserEnv);
|
|
39
41
|
if (!userCurrentBrowserAndVersion || !browserConfigFeatureFlag) {
|
|
40
42
|
return {};
|
|
41
43
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
1
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { isTextSelection } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
export var inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
|
|
8
9
|
var isInlineNodeView = function isInlineNodeView(node) {
|
|
9
10
|
/**
|
|
@@ -95,6 +96,7 @@ export default (function () {
|
|
|
95
96
|
// TODO: ED-26959 - We may be able to remove this when playing the following ticket:
|
|
96
97
|
// https://product-fabric.atlassian.net/browse/ED-14938
|
|
97
98
|
keydown: function keydown(view, event) {
|
|
99
|
+
var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
98
100
|
if (browser.safari && event instanceof KeyboardEvent && event.shiftKey && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
|
99
101
|
view.dispatch(view.state.tr.setMeta(inlineCursorTargetStateKey, {
|
|
100
102
|
cursorTarget: undefined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-base",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Base plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
35
35
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
36
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
36
|
+
"@atlaskit/tmp-editor-statsig": "^13.13.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0"
|
|
38
38
|
},
|
|
39
39
|
"techstack": {
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@atlaskit/editor-common": "^110.
|
|
78
|
+
"@atlaskit/editor-common": "^110.13.0"
|
|
79
79
|
}
|
|
80
80
|
}
|