@atlaskit/editor-core 153.0.0 → 153.0.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 -0
- package/dist/cjs/plugins/base/index.js +10 -2
- package/dist/cjs/plugins/base/pm-plugins/fix-chrome-spell-checking.js +35 -0
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +9 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/base/index.js +6 -1
- package/dist/es2019/plugins/base/pm-plugins/fix-chrome-spell-checking.js +21 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +9 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/base/index.js +8 -1
- package/dist/esm/plugins/base/pm-plugins/fix-chrome-spell-checking.js +23 -0
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +9 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/base/pm-plugins/fix-chrome-spell-checking.d.ts +3 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/types/feature-flags.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 153.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`44f1ead3628`](https://bitbucket.org/atlassian/atlassian-frontend/commits/44f1ead3628) - [HOT-97409] Add feature flag to disable spellchecking for Chrome >= 96
|
|
8
|
+
|
|
9
|
+
Update `@atlaskit/icon` dependency to `^21.9.2`
|
|
10
|
+
|
|
3
11
|
## 153.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
|
@@ -13,7 +13,7 @@ var _prosemirrorCommands = require("prosemirror-commands");
|
|
|
13
13
|
|
|
14
14
|
var _prosemirrorHistory = require("prosemirror-history");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
17
|
|
|
18
18
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
19
19
|
|
|
@@ -23,6 +23,8 @@ var _focusHandler = _interopRequireDefault(require("./pm-plugins/focus-handler")
|
|
|
23
23
|
|
|
24
24
|
var _fixChrome88Selection = _interopRequireDefault(require("./pm-plugins/fix-chrome-88-selection"));
|
|
25
25
|
|
|
26
|
+
var _fixChromeSpellChecking = _interopRequireDefault(require("./pm-plugins/fix-chrome-spell-checking"));
|
|
27
|
+
|
|
26
28
|
var _contextIdentifier = _interopRequireDefault(require("./pm-plugins/context-identifier"));
|
|
27
29
|
|
|
28
30
|
var _newlinePreserveMarks = _interopRequireDefault(require("./pm-plugins/newline-preserve-marks"));
|
|
@@ -46,7 +48,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
46
48
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
47
49
|
|
|
48
50
|
// Chrome >= 88
|
|
49
|
-
var isChromeWithSelectionBug =
|
|
51
|
+
var isChromeWithSelectionBug = _utils.browser.chrome && _utils.browser.chrome_version >= 88;
|
|
50
52
|
exports.isChromeWithSelectionBug = isChromeWithSelectionBug;
|
|
51
53
|
|
|
52
54
|
var basePlugin = function basePlugin(options) {
|
|
@@ -143,6 +145,12 @@ var basePlugin = function basePlugin(options) {
|
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
|
|
148
|
+
plugins.push({
|
|
149
|
+
name: 'fixChromeSpellCheckingPlugin',
|
|
150
|
+
plugin: function plugin() {
|
|
151
|
+
return (0, _fixChromeSpellChecking.default)();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
146
154
|
return plugins;
|
|
147
155
|
},
|
|
148
156
|
nodes: function nodes() {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
9
|
+
|
|
10
|
+
var _featureFlagsContext = require("../../feature-flags-context");
|
|
11
|
+
|
|
12
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
+
|
|
14
|
+
var _default = function _default() {
|
|
15
|
+
return new _prosemirrorState.Plugin({
|
|
16
|
+
key: new _prosemirrorState.PluginKey('fixChrome96SpellChecking'),
|
|
17
|
+
props: {
|
|
18
|
+
attributes: function attributes(editorState) {
|
|
19
|
+
var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(editorState);
|
|
20
|
+
|
|
21
|
+
if (_utils.browser.chrome && featureFlags.maxUnsafeChromeSpellcheckingVersion && _utils.browser.chrome_version >= 96 && // This check is valid for any browser
|
|
22
|
+
// that uses the chrome engine as base like Edge
|
|
23
|
+
_utils.browser.chrome_version <= featureFlags.maxUnsafeChromeSpellcheckingVersion) {
|
|
24
|
+
return {
|
|
25
|
+
spellcheck: 'false'
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.default = _default;
|
|
@@ -19,12 +19,18 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
19
19
|
|
|
20
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
21
|
|
|
22
|
+
var safeNumberFeatureFlag = function safeNumberFeatureFlag(value) {
|
|
23
|
+
var parsedValue = parseInt(value, 10);
|
|
24
|
+
return !isNaN(parsedValue) && Number.isInteger(parsedValue) && Number.isSafeInteger(parsedValue) ? parsedValue : undefined;
|
|
25
|
+
};
|
|
22
26
|
/**
|
|
23
27
|
* Transforms EditorProps to an FeatureFlags object,
|
|
24
28
|
* which is used by both current and archv3 editors.
|
|
25
29
|
*/
|
|
30
|
+
|
|
31
|
+
|
|
26
32
|
function createFeatureFlagsFromProps(props) {
|
|
27
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31;
|
|
33
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32;
|
|
28
34
|
|
|
29
35
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
30
36
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
@@ -57,6 +63,7 @@ function createFeatureFlagsFromProps(props) {
|
|
|
57
63
|
ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
|
|
58
64
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !_editorCommon.browser.safari : false),
|
|
59
65
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.twoLineEditorToolbar) : false),
|
|
60
|
-
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true)
|
|
66
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true),
|
|
67
|
+
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.maxUnsafeChromeSpellcheckingVersion)
|
|
61
68
|
});
|
|
62
69
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "153.0.
|
|
9
|
+
var version = "153.0.1";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { baseKeymap } from 'prosemirror-commands';
|
|
2
2
|
import { history } from 'prosemirror-history';
|
|
3
|
-
import { browser } from '@atlaskit/editor-common';
|
|
3
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { doc, paragraph, text } from '@atlaskit/adf-schema';
|
|
5
5
|
import filterStepsPlugin from './pm-plugins/filter-steps';
|
|
6
6
|
import focusHandlerPlugin from './pm-plugins/focus-handler';
|
|
7
7
|
import fixChrome88SelectionPlugin from './pm-plugins/fix-chrome-88-selection';
|
|
8
|
+
import fixChromeSpellCheckingPlugin from './pm-plugins/fix-chrome-spell-checking';
|
|
8
9
|
import contextIdentifierPlugin from './pm-plugins/context-identifier';
|
|
9
10
|
import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
|
|
10
11
|
import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
@@ -90,6 +91,10 @@ const basePlugin = options => ({
|
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
plugins.push({
|
|
95
|
+
name: 'fixChromeSpellCheckingPlugin',
|
|
96
|
+
plugin: () => fixChromeSpellCheckingPlugin()
|
|
97
|
+
});
|
|
93
98
|
return plugins;
|
|
94
99
|
},
|
|
95
100
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PluginKey, Plugin } from 'prosemirror-state';
|
|
2
|
+
import { getFeatureFlags } from '../../feature-flags-context';
|
|
3
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
|
+
export default (() => new Plugin({
|
|
5
|
+
key: new PluginKey('fixChrome96SpellChecking'),
|
|
6
|
+
props: {
|
|
7
|
+
attributes: editorState => {
|
|
8
|
+
const featureFlags = getFeatureFlags(editorState);
|
|
9
|
+
|
|
10
|
+
if (browser.chrome && featureFlags.maxUnsafeChromeSpellcheckingVersion && browser.chrome_version >= 96 && // This check is valid for any browser
|
|
11
|
+
// that uses the chrome engine as base like Edge
|
|
12
|
+
browser.chrome_version <= featureFlags.maxUnsafeChromeSpellcheckingVersion) {
|
|
13
|
+
return {
|
|
14
|
+
spellcheck: 'false'
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
2
2
|
import { browser } from '@atlaskit/editor-common';
|
|
3
|
+
|
|
4
|
+
const safeNumberFeatureFlag = value => {
|
|
5
|
+
const parsedValue = parseInt(value, 10);
|
|
6
|
+
return !isNaN(parsedValue) && Number.isInteger(parsedValue) && Number.isSafeInteger(parsedValue) ? parsedValue : undefined;
|
|
7
|
+
};
|
|
3
8
|
/**
|
|
4
9
|
* Transforms EditorProps to an FeatureFlags object,
|
|
5
10
|
* which is used by both current and archv3 editors.
|
|
6
11
|
*/
|
|
7
12
|
|
|
13
|
+
|
|
8
14
|
export function createFeatureFlagsFromProps(props) {
|
|
9
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31;
|
|
15
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32;
|
|
10
16
|
|
|
11
17
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
12
18
|
return { ...normalizedFeatureFlags,
|
|
@@ -39,6 +45,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
39
45
|
ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
|
|
40
46
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
41
47
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.twoLineEditorToolbar) : false),
|
|
42
|
-
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true)
|
|
48
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true),
|
|
49
|
+
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.maxUnsafeChromeSpellcheckingVersion)
|
|
43
50
|
};
|
|
44
51
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,11 +6,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { baseKeymap } from 'prosemirror-commands';
|
|
8
8
|
import { history } from 'prosemirror-history';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common';
|
|
9
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { doc, paragraph, text } from '@atlaskit/adf-schema';
|
|
11
11
|
import filterStepsPlugin from './pm-plugins/filter-steps';
|
|
12
12
|
import focusHandlerPlugin from './pm-plugins/focus-handler';
|
|
13
13
|
import fixChrome88SelectionPlugin from './pm-plugins/fix-chrome-88-selection';
|
|
14
|
+
import fixChromeSpellCheckingPlugin from './pm-plugins/fix-chrome-spell-checking';
|
|
14
15
|
import contextIdentifierPlugin from './pm-plugins/context-identifier';
|
|
15
16
|
import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
|
|
16
17
|
import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
@@ -117,6 +118,12 @@ var basePlugin = function basePlugin(options) {
|
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
|
|
121
|
+
plugins.push({
|
|
122
|
+
name: 'fixChromeSpellCheckingPlugin',
|
|
123
|
+
plugin: function plugin() {
|
|
124
|
+
return fixChromeSpellCheckingPlugin();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
120
127
|
return plugins;
|
|
121
128
|
},
|
|
122
129
|
nodes: function nodes() {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PluginKey, Plugin } from 'prosemirror-state';
|
|
2
|
+
import { getFeatureFlags } from '../../feature-flags-context';
|
|
3
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
|
+
export default (function () {
|
|
5
|
+
return new Plugin({
|
|
6
|
+
key: new PluginKey('fixChrome96SpellChecking'),
|
|
7
|
+
props: {
|
|
8
|
+
attributes: function attributes(editorState) {
|
|
9
|
+
var featureFlags = getFeatureFlags(editorState);
|
|
10
|
+
|
|
11
|
+
if (browser.chrome && featureFlags.maxUnsafeChromeSpellcheckingVersion && browser.chrome_version >= 96 && // This check is valid for any browser
|
|
12
|
+
// that uses the chrome engine as base like Edge
|
|
13
|
+
browser.chrome_version <= featureFlags.maxUnsafeChromeSpellcheckingVersion) {
|
|
14
|
+
return {
|
|
15
|
+
spellcheck: 'false'
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -7,13 +7,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
9
9
|
import { browser } from '@atlaskit/editor-common';
|
|
10
|
+
|
|
11
|
+
var safeNumberFeatureFlag = function safeNumberFeatureFlag(value) {
|
|
12
|
+
var parsedValue = parseInt(value, 10);
|
|
13
|
+
return !isNaN(parsedValue) && Number.isInteger(parsedValue) && Number.isSafeInteger(parsedValue) ? parsedValue : undefined;
|
|
14
|
+
};
|
|
10
15
|
/**
|
|
11
16
|
* Transforms EditorProps to an FeatureFlags object,
|
|
12
17
|
* which is used by both current and archv3 editors.
|
|
13
18
|
*/
|
|
14
19
|
|
|
20
|
+
|
|
15
21
|
export function createFeatureFlagsFromProps(props) {
|
|
16
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31;
|
|
22
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32;
|
|
17
23
|
|
|
18
24
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
19
25
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
@@ -46,6 +52,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
46
52
|
ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
|
|
47
53
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
48
54
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.twoLineEditorToolbar) : false),
|
|
49
|
-
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true)
|
|
55
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true),
|
|
56
|
+
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.maxUnsafeChromeSpellcheckingVersion)
|
|
50
57
|
});
|
|
51
58
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -4,4 +4,4 @@ import type { FeatureFlags } from '../../types/feature-flags';
|
|
|
4
4
|
*
|
|
5
5
|
* Useful for analytics and analysis purposes.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getEnabledFeatureFlagKeys(featureFlags: FeatureFlags): ("singleLayout" | "newInsertionBehaviour" | "interactiveExpand" | "placeholderBracketHint" | "placeholderHints" | "moreTextColors" | "findReplace" | "findReplaceMatchCase" | "extensionLocalIdGeneration" | "keyboardAccessibleDatepicker" | "addColumnWithCustomStep" | "undoRedoButtons" | "catchAllTracking" | "nextEmojiNodeView" | "stickyHeadersOptimization" | "initialRenderOptimization" | "mouseMoveOptimization" | "tableRenderOptimization" | "tableOverflowShadowsOptimization" | "codeBlockSyntaxHighlighting" | "codeBidiWarnings" | "queueAnalytics" | "extendFloatingToolbar" | "displayInlineBlockForInlineNodes" | "useUnpredictableInputRule" | "showAvatarGroupAsPlugin" | "errorBoundaryDocStructure" | "synchronyErrorDocStructure" | "enableViewUpdateSubscription" | "collabAvatarScroll" | "ufo" | "twoLineEditorToolbar")[];
|
|
7
|
+
export declare function getEnabledFeatureFlagKeys(featureFlags: FeatureFlags): ("singleLayout" | "newInsertionBehaviour" | "interactiveExpand" | "placeholderBracketHint" | "placeholderHints" | "moreTextColors" | "findReplace" | "findReplaceMatchCase" | "extensionLocalIdGeneration" | "keyboardAccessibleDatepicker" | "addColumnWithCustomStep" | "undoRedoButtons" | "catchAllTracking" | "nextEmojiNodeView" | "stickyHeadersOptimization" | "initialRenderOptimization" | "mouseMoveOptimization" | "tableRenderOptimization" | "tableOverflowShadowsOptimization" | "codeBlockSyntaxHighlighting" | "codeBidiWarnings" | "queueAnalytics" | "extendFloatingToolbar" | "displayInlineBlockForInlineNodes" | "useUnpredictableInputRule" | "showAvatarGroupAsPlugin" | "errorBoundaryDocStructure" | "synchronyErrorDocStructure" | "enableViewUpdateSubscription" | "collabAvatarScroll" | "ufo" | "twoLineEditorToolbar" | "maxUnsafeChromeSpellcheckingVersion")[];
|
|
@@ -272,5 +272,11 @@ export declare type FeatureFlags = {
|
|
|
272
272
|
* @default false
|
|
273
273
|
*/
|
|
274
274
|
twoLineEditorToolbar?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Disable Spellchecking for chrome version below the max unsafe number
|
|
277
|
+
* @see https://ops.internal.atlassian.com/jira/browse/HOT-97409
|
|
278
|
+
* @default null
|
|
279
|
+
*/
|
|
280
|
+
maxUnsafeChromeSpellcheckingVersion?: number;
|
|
275
281
|
};
|
|
276
282
|
export declare type FeatureFlagKey = keyof FeatureFlags;
|