@atlaskit/editor-plugin-code-bidi-warning 6.0.0 → 6.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 +20 -1
- package/dist/cjs/pm-plugins/main.js +13 -0
- package/dist/cjs/pm-plugins/react-plugin-factory.js +2 -1
- package/dist/es2019/pm-plugins/main.js +13 -0
- package/dist/es2019/pm-plugins/react-plugin-factory.js +3 -0
- package/dist/esm/pm-plugins/main.js +13 -0
- package/dist/esm/pm-plugins/react-plugin-factory.js +3 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-bidi-warning
|
|
2
2
|
|
|
3
|
+
## 6.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 6.1.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`ce0b8f9e44b69`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ce0b8f9e44b69) -
|
|
17
|
+
[ux] [ED-29581] Removes bidi character scanning from code blocks and code snippets
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 6.0.0
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -68,7 +88,6 @@
|
|
|
68
88
|
shared context or singletons.
|
|
69
89
|
|
|
70
90
|
**HOW TO ADJUST:**
|
|
71
|
-
|
|
72
91
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
73
92
|
any of these editor plugins.
|
|
74
93
|
- 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,
|
|
@@ -48,7 +56,12 @@ var createPlugin = exports.createPlugin = function createPlugin(api, _ref, _ref2
|
|
|
48
56
|
};
|
|
49
57
|
}),
|
|
50
58
|
props: {
|
|
59
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
60
|
+
|
|
51
61
|
decorations: function decorations(state) {
|
|
62
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
|
|
63
|
+
return _view.DecorationSet.empty;
|
|
64
|
+
}
|
|
52
65
|
var _getPluginState = getPluginState(state),
|
|
53
66
|
decorationSet = _getPluginState.decorationSet;
|
|
54
67
|
return decorationSet;
|
|
@@ -16,7 +16,7 @@ var _view = require("@atlaskit/editor-prosemirror/view");
|
|
|
16
16
|
var _pluginKey = require("./plugin-key");
|
|
17
17
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
20
20
|
var pluginFactoryCreator = exports.pluginFactoryCreator = function pluginFactoryCreator(nodeViewPortalProviderAPI) {
|
|
21
21
|
return (0, _utils.pluginFactory)(_pluginKey.codeBidiWarningPluginKey, _reducer.default, {
|
|
22
22
|
onDocChanged: function onDocChanged(tr, pluginState) {
|
|
@@ -82,6 +82,7 @@ function createBidiWarningsDecorationSetFromDoc(_ref) {
|
|
|
82
82
|
var newBidiWarningsDecorationSet = _view.DecorationSet.create(doc, bidiCharactersAndTheirPositions.map(function (_ref4) {
|
|
83
83
|
var position = _ref4.position,
|
|
84
84
|
bidiCharacter = _ref4.bidiCharacter;
|
|
85
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
85
86
|
var renderKey = (0, _v.default)();
|
|
86
87
|
return _view.Decoration.widget(position, function (el) {
|
|
87
88
|
return renderDOM({
|
|
@@ -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,
|
|
@@ -45,7 +53,12 @@ export const createPlugin = (api, {
|
|
|
45
53
|
};
|
|
46
54
|
}),
|
|
47
55
|
props: {
|
|
56
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
57
|
+
|
|
48
58
|
decorations: state => {
|
|
59
|
+
if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
|
|
60
|
+
return DecorationSet.empty;
|
|
61
|
+
}
|
|
49
62
|
const {
|
|
50
63
|
decorationSet
|
|
51
64
|
} = getPluginState(state);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
4
|
import uuid from 'uuid/v4';
|
|
3
5
|
import CodeBidiWarning from '@atlaskit/code/bidi-warning';
|
|
4
6
|
import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
|
|
@@ -72,6 +74,7 @@ export function createBidiWarningsDecorationSetFromDoc({
|
|
|
72
74
|
position,
|
|
73
75
|
bidiCharacter
|
|
74
76
|
}) => {
|
|
77
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
75
78
|
const renderKey = uuid();
|
|
76
79
|
return Decoration.widget(position, el => renderDOM({
|
|
77
80
|
bidiCharacter,
|
|
@@ -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,
|
|
@@ -42,7 +50,12 @@ export var createPlugin = function createPlugin(api, _ref, _ref2) {
|
|
|
42
50
|
};
|
|
43
51
|
}),
|
|
44
52
|
props: {
|
|
53
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
54
|
+
|
|
45
55
|
decorations: function decorations(state) {
|
|
56
|
+
if (expValEquals('platform_editor_remove_bidi_char_warning', 'isEnabled', true)) {
|
|
57
|
+
return DecorationSet.empty;
|
|
58
|
+
}
|
|
46
59
|
var _getPluginState = getPluginState(state),
|
|
47
60
|
decorationSet = _getPluginState.decorationSet;
|
|
48
61
|
return decorationSet;
|
|
@@ -2,6 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import React from 'react';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
7
|
import uuid from 'uuid/v4';
|
|
6
8
|
import CodeBidiWarning from '@atlaskit/code/bidi-warning';
|
|
7
9
|
import codeBidiWarningDecorator from '@atlaskit/code/bidi-warning-decorator';
|
|
@@ -74,6 +76,7 @@ export function createBidiWarningsDecorationSetFromDoc(_ref) {
|
|
|
74
76
|
var newBidiWarningsDecorationSet = DecorationSet.create(doc, bidiCharactersAndTheirPositions.map(function (_ref4) {
|
|
75
77
|
var position = _ref4.position,
|
|
76
78
|
bidiCharacter = _ref4.bidiCharacter;
|
|
79
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
77
80
|
var renderKey = uuid();
|
|
78
81
|
return Decoration.widget(position, function (el) {
|
|
79
82
|
return renderDOM({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-bidi-warning",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Code bidi warning plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/code": "^17.
|
|
31
|
-
"@atlaskit/editor-plugin-limited-mode": "^3.
|
|
30
|
+
"@atlaskit/code": "^17.3.0",
|
|
31
|
+
"@atlaskit/editor-plugin-limited-mode": "^3.1.0",
|
|
32
32
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^13.42.0",
|
|
34
35
|
"@babel/runtime": "^7.0.0",
|
|
35
36
|
"uuid": "^3.1.0"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@atlaskit/editor-common": "^110.
|
|
39
|
+
"@atlaskit/editor-common": "^110.34.0",
|
|
39
40
|
"react": "^18.2.0",
|
|
40
41
|
"react-dom": "^18.2.0"
|
|
41
42
|
},
|