@atlaskit/editor-plugin-limited-mode 5.0.20 → 5.0.22
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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-limited-mode
|
|
2
2
|
|
|
3
|
+
## 5.0.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d1a0ee6dbcefd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d1a0ee6dbcefd) -
|
|
8
|
+
Clean up feature gate platform_editor_native_anchor_patch_2
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.0.21
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 5.0.20
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.limitedModePlugin = void 0;
|
|
7
7
|
var _nodeAnchor = require("@atlaskit/editor-common/node-anchor");
|
|
8
8
|
var _usePluginStateEffect = require("@atlaskit/editor-common/use-plugin-state-effect");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
10
|
var _main = require("./pm-plugins/main");
|
|
12
11
|
var limitedModePlugin = exports.limitedModePlugin = function limitedModePlugin(_ref) {
|
|
@@ -39,17 +38,15 @@ var limitedModePlugin = exports.limitedModePlugin = function limitedModePlugin(_
|
|
|
39
38
|
(0, _usePluginStateEffect.usePluginStateEffect)(api, ['limitedMode'], function (_ref3) {
|
|
40
39
|
var limitedModeState = _ref3.limitedModeState;
|
|
41
40
|
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// And nodeIdProvider to limited mode to prevent adding data-node-anchor on new nodes
|
|
41
|
+
var _limitedModeState$ena;
|
|
42
|
+
var isEnabled = (_limitedModeState$ena = limitedModeState === null || limitedModeState === void 0 ? void 0 : limitedModeState.enabled) !== null && _limitedModeState$ena !== void 0 ? _limitedModeState$ena : false;
|
|
43
|
+
var nodeIdProvider = (0, _nodeAnchor.getNodeIdProvider)(editorView);
|
|
44
|
+
// When limited mode is enabled first time,
|
|
45
|
+
// We need to remove all existing data-node-anchor attributes
|
|
46
|
+
// And nodeIdProvider to limited mode to prevent adding data-node-anchor on new nodes
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
48
|
+
if (isEnabled && nodeIdProvider && !nodeIdProvider.isLimitedMode()) {
|
|
49
|
+
nodeIdProvider.setLimitedMode();
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getNodeIdProvider } from '@atlaskit/editor-common/node-anchor';
|
|
2
2
|
import { usePluginStateEffect } from '@atlaskit/editor-common/use-plugin-state-effect';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
import { createPlugin, limitedModePluginKey } from './pm-plugins/main';
|
|
6
5
|
export const limitedModePlugin = ({
|
|
@@ -36,17 +35,15 @@ export const limitedModePlugin = ({
|
|
|
36
35
|
limitedModeState
|
|
37
36
|
}) => {
|
|
38
37
|
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// And nodeIdProvider to limited mode to prevent adding data-node-anchor on new nodes
|
|
38
|
+
var _limitedModeState$ena;
|
|
39
|
+
const isEnabled = (_limitedModeState$ena = limitedModeState === null || limitedModeState === void 0 ? void 0 : limitedModeState.enabled) !== null && _limitedModeState$ena !== void 0 ? _limitedModeState$ena : false;
|
|
40
|
+
const nodeIdProvider = getNodeIdProvider(editorView);
|
|
41
|
+
// When limited mode is enabled first time,
|
|
42
|
+
// We need to remove all existing data-node-anchor attributes
|
|
43
|
+
// And nodeIdProvider to limited mode to prevent adding data-node-anchor on new nodes
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
45
|
+
if (isEnabled && nodeIdProvider && !nodeIdProvider.isLimitedMode()) {
|
|
46
|
+
nodeIdProvider.setLimitedMode();
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getNodeIdProvider } from '@atlaskit/editor-common/node-anchor';
|
|
2
2
|
import { usePluginStateEffect } from '@atlaskit/editor-common/use-plugin-state-effect';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
import { createPlugin, limitedModePluginKey } from './pm-plugins/main';
|
|
6
5
|
export var limitedModePlugin = function limitedModePlugin(_ref) {
|
|
@@ -33,17 +32,15 @@ export var limitedModePlugin = function limitedModePlugin(_ref) {
|
|
|
33
32
|
usePluginStateEffect(api, ['limitedMode'], function (_ref3) {
|
|
34
33
|
var limitedModeState = _ref3.limitedModeState;
|
|
35
34
|
if (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// And nodeIdProvider to limited mode to prevent adding data-node-anchor on new nodes
|
|
35
|
+
var _limitedModeState$ena;
|
|
36
|
+
var isEnabled = (_limitedModeState$ena = limitedModeState === null || limitedModeState === void 0 ? void 0 : limitedModeState.enabled) !== null && _limitedModeState$ena !== void 0 ? _limitedModeState$ena : false;
|
|
37
|
+
var nodeIdProvider = getNodeIdProvider(editorView);
|
|
38
|
+
// When limited mode is enabled first time,
|
|
39
|
+
// We need to remove all existing data-node-anchor attributes
|
|
40
|
+
// And nodeIdProvider to limited mode to prevent adding data-node-anchor on new nodes
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
42
|
+
if (isEnabled && nodeIdProvider && !nodeIdProvider.isLimitedMode()) {
|
|
43
|
+
nodeIdProvider.setLimitedMode();
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-limited-mode",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.22",
|
|
4
4
|
"description": "LimitedMode plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
33
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
33
|
+
"@atlaskit/tmp-editor-statsig": "^55.0.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"bind-event-listener": "^3.0.0",
|
|
36
36
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@atlaskit/editor-common": "^112.
|
|
39
|
+
"@atlaskit/editor-common": "^112.18.0",
|
|
40
40
|
"react": "^18.2.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -78,9 +78,5 @@
|
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
-
"platform-feature-flags": {
|
|
82
|
-
"platform_editor_native_anchor_patch_2": {
|
|
83
|
-
"type": "boolean"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
81
|
+
"platform-feature-flags": {}
|
|
86
82
|
}
|