@atlaskit/editor-plugin-code-bidi-warning 5.0.1 → 6.1.0

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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-code-bidi-warning
2
2
 
3
+ ## 6.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ce0b8f9e44b69`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ce0b8f9e44b69) -
8
+ [ux] [ED-29581] Removes bidi character scanning from code blocks and code snippets
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 6.0.0
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 5.0.1
4
21
 
5
22
  ### Patch Changes
@@ -62,7 +79,6 @@
62
79
  shared context or singletons.
63
80
 
64
81
  **HOW TO ADJUST:**
65
-
66
82
  - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
67
83
  any of these editor plugins.
68
84
  - Ensure the version you install matches the version required by the plugins.
@@ -8,6 +8,7 @@ var _messages = require("@atlaskit/editor-common/messages");
8
8
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
9
  var _view = require("@atlaskit/editor-prosemirror/view");
10
10
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
12
  var _pluginKey = require("./plugin-key");
12
13
  var _reactPluginFactory = require("./react-plugin-factory");
13
14
  var _vanillaPluginFactory = require("./vanilla-plugin-factory");
@@ -25,6 +26,13 @@ var createPlugin = exports.createPlugin = function createPlugin(api, _ref, _ref2
25
26
  key: _pluginKey.codeBidiWarningPluginKey,
26
27
  state: createPluginState(dispatch, function (state) {
27
28
  var _api$limitedMode;
29
+ if ((0, _expValEquals.expValEquals)('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
30
+ return {
31
+ decorationSet: _view.DecorationSet.empty,
32
+ codeBidiWarningLabel: '',
33
+ tooltipEnabled: false
34
+ };
35
+ }
28
36
  if (api !== null && api !== void 0 && (_api$limitedMode = api.limitedMode) !== null && _api$limitedMode !== void 0 && (_api$limitedMode = _api$limitedMode.sharedState.currentState()) !== null && _api$limitedMode !== void 0 && _api$limitedMode.enabled) {
29
37
  return {
30
38
  decorationSet: _view.DecorationSet.empty,
@@ -49,6 +57,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api, _ref, _ref2
49
57
  }),
50
58
  props: {
51
59
  decorations: function decorations(state) {
60
+ if ((0, _expValEquals.expValEquals)('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
61
+ return _view.DecorationSet.empty;
62
+ }
52
63
  var _getPluginState = getPluginState(state),
53
64
  decorationSet = _getPluginState.decorationSet;
54
65
  return decorationSet;
@@ -2,6 +2,7 @@ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { codeBidiWarningPluginKey } from './plugin-key';
6
7
  import { createBidiWarningsDecorationSetFromDoc as reactCreateBidiWarningsDecorationSetFromDoc, pluginFactoryCreator as reactPluginFactoryCreator } from './react-plugin-factory';
7
8
  import { createBidiWarningsDecorationSetFromDoc as vanillaCreateBidiWarningsDecorationSetFromDoc, pluginFactoryCreator as vanillaPluginFactoryCreator } from './vanilla-plugin-factory';
@@ -22,6 +23,13 @@ export const createPlugin = (api, {
22
23
  key: codeBidiWarningPluginKey,
23
24
  state: createPluginState(dispatch, state => {
24
25
  var _api$limitedMode, _api$limitedMode$shar;
26
+ if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
27
+ return {
28
+ decorationSet: DecorationSet.empty,
29
+ codeBidiWarningLabel: '',
30
+ tooltipEnabled: false
31
+ };
32
+ }
25
33
  if (api !== null && api !== void 0 && (_api$limitedMode = api.limitedMode) !== null && _api$limitedMode !== void 0 && (_api$limitedMode$shar = _api$limitedMode.sharedState.currentState()) !== null && _api$limitedMode$shar !== void 0 && _api$limitedMode$shar.enabled) {
26
34
  return {
27
35
  decorationSet: DecorationSet.empty,
@@ -46,6 +54,9 @@ export const createPlugin = (api, {
46
54
  }),
47
55
  props: {
48
56
  decorations: state => {
57
+ if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
58
+ return DecorationSet.empty;
59
+ }
49
60
  const {
50
61
  decorationSet
51
62
  } = getPluginState(state);
@@ -2,6 +2,7 @@ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { codeBidiWarningPluginKey } from './plugin-key';
6
7
  import { createBidiWarningsDecorationSetFromDoc as reactCreateBidiWarningsDecorationSetFromDoc, pluginFactoryCreator as reactPluginFactoryCreator } from './react-plugin-factory';
7
8
  import { createBidiWarningsDecorationSetFromDoc as vanillaCreateBidiWarningsDecorationSetFromDoc, pluginFactoryCreator as vanillaPluginFactoryCreator } from './vanilla-plugin-factory';
@@ -19,6 +20,13 @@ export var createPlugin = function createPlugin(api, _ref, _ref2) {
19
20
  key: codeBidiWarningPluginKey,
20
21
  state: createPluginState(dispatch, function (state) {
21
22
  var _api$limitedMode;
23
+ if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
24
+ return {
25
+ decorationSet: DecorationSet.empty,
26
+ codeBidiWarningLabel: '',
27
+ tooltipEnabled: false
28
+ };
29
+ }
22
30
  if (api !== null && api !== void 0 && (_api$limitedMode = api.limitedMode) !== null && _api$limitedMode !== void 0 && (_api$limitedMode = _api$limitedMode.sharedState.currentState()) !== null && _api$limitedMode !== void 0 && _api$limitedMode.enabled) {
23
31
  return {
24
32
  decorationSet: DecorationSet.empty,
@@ -43,6 +51,9 @@ export var createPlugin = function createPlugin(api, _ref, _ref2) {
43
51
  }),
44
52
  props: {
45
53
  decorations: function decorations(state) {
54
+ if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
55
+ return DecorationSet.empty;
56
+ }
46
57
  var _getPluginState = getPluginState(state),
47
58
  decorationSet = _getPluginState.decorationSet;
48
59
  return decorationSet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-bidi-warning",
3
- "version": "5.0.1",
3
+ "version": "6.1.0",
4
4
  "description": "Code bidi warning plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,14 +28,15 @@
28
28
  "atlaskit:src": "src/index.ts",
29
29
  "dependencies": {
30
30
  "@atlaskit/code": "^17.2.0",
31
- "@atlaskit/editor-plugin-limited-mode": "^2.0.0",
31
+ "@atlaskit/editor-plugin-limited-mode": "^3.0.0",
32
32
  "@atlaskit/editor-prosemirror": "7.0.0",
33
33
  "@atlaskit/platform-feature-flags": "^1.1.0",
34
+ "@atlaskit/tmp-editor-statsig": "^13.19.0",
34
35
  "@babel/runtime": "^7.0.0",
35
36
  "uuid": "^3.1.0"
36
37
  },
37
38
  "peerDependencies": {
38
- "@atlaskit/editor-common": "^109.4.0",
39
+ "@atlaskit/editor-common": "^110.18.0",
39
40
  "react": "^18.2.0",
40
41
  "react-dom": "^18.2.0"
41
42
  },