@atlaskit/editor-plugin-base 7.0.1 → 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 +19 -4
- package/dist/cjs/basePlugin.js +2 -2
- 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/basePlugin.js +1 -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/basePlugin.js +1 -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 +4 -3
- package/tsconfig.app.json +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
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
|
+
|
|
11
|
+
## 7.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`0ac75e0d28c72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0ac75e0d28c72) -
|
|
16
|
+
Migrate @atlaskit/editor-prosemirror/history to @atlaskit/prosemirror-history package
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 7.0.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -175,7 +194,6 @@
|
|
|
175
194
|
shared context or singletons.
|
|
176
195
|
|
|
177
196
|
**HOW TO ADJUST:**
|
|
178
|
-
|
|
179
197
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
180
198
|
any of these editor plugins.
|
|
181
199
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -1005,7 +1023,6 @@
|
|
|
1005
1023
|
- [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
|
|
1006
1024
|
[`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
|
|
1007
1025
|
feature flags plugin optional in all plugins including:
|
|
1008
|
-
|
|
1009
1026
|
- analytics
|
|
1010
1027
|
- base
|
|
1011
1028
|
- card
|
|
@@ -1080,13 +1097,11 @@
|
|
|
1080
1097
|
This change removes plugin exports from editor-core that were used only for the mobile bridge.
|
|
1081
1098
|
|
|
1082
1099
|
This includes:
|
|
1083
|
-
|
|
1084
1100
|
- All plugin keys
|
|
1085
1101
|
- Plugin commands
|
|
1086
1102
|
- Plugin types
|
|
1087
1103
|
|
|
1088
1104
|
The full list is:
|
|
1089
|
-
|
|
1090
1105
|
- EditorFeatureFlags (available via '@atlaskit/editor-common/types' as `FeatureFlags`)
|
|
1091
1106
|
- EmojiResource (available via '@atlaskit/emoji/resource' as `EmojiResource`)
|
|
1092
1107
|
- mediaPlugin
|
package/dist/cjs/basePlugin.js
CHANGED
|
@@ -10,7 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
12
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
13
|
-
var
|
|
13
|
+
var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
16
|
var _setKeyboardHeight = require("./editor-commands/set-keyboard-height");
|
|
@@ -145,7 +145,7 @@ var basePlugin = function basePlugin(_ref) {
|
|
|
145
145
|
}, {
|
|
146
146
|
name: 'history',
|
|
147
147
|
plugin: function plugin() {
|
|
148
|
-
return (0,
|
|
148
|
+
return (0, _prosemirrorHistory.history)();
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
151
|
// should be last :(
|
|
@@ -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,7 @@
|
|
|
1
1
|
import { doc, paragraph, text } from '@atlaskit/adf-schema';
|
|
2
2
|
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
|
|
4
|
-
import { history } from '@atlaskit/
|
|
4
|
+
import { history } from '@atlaskit/prosemirror-history';
|
|
5
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
7
|
import { setKeyboardHeight } from './editor-commands/set-keyboard-height';
|
|
@@ -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
|
package/dist/esm/basePlugin.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { doc, paragraph, text } from '@atlaskit/adf-schema';
|
|
5
5
|
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
|
|
7
|
-
import { history } from '@atlaskit/
|
|
7
|
+
import { history } from '@atlaskit/prosemirror-history';
|
|
8
8
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
10
|
import { setKeyboardHeight } from './editor-commands/set-keyboard-height';
|
|
@@ -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.
|
|
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",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
33
33
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
35
|
-
"@atlaskit/
|
|
35
|
+
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
36
|
+
"@atlaskit/tmp-editor-statsig": "^13.13.0",
|
|
36
37
|
"@babel/runtime": "^7.0.0"
|
|
37
38
|
},
|
|
38
39
|
"techstack": {
|
|
@@ -74,6 +75,6 @@
|
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
77
|
-
"@atlaskit/editor-common": "^110.
|
|
78
|
+
"@atlaskit/editor-common": "^110.13.0"
|
|
78
79
|
}
|
|
79
80
|
}
|