@atlaskit/editor-plugin-expand 11.2.3 → 11.2.5
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 +14 -0
- package/dist/cjs/editor-commands/toggleExpandRange.js +12 -20
- package/dist/cjs/singlePlayerExpand/pm-plugins/main.js +0 -7
- package/dist/es2019/editor-commands/toggleExpandRange.js +12 -20
- package/dist/es2019/singlePlayerExpand/pm-plugins/main.js +0 -7
- package/dist/esm/editor-commands/toggleExpandRange.js +12 -20
- package/dist/esm/singlePlayerExpand/pm-plugins/main.js +0 -7
- package/package.json +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 11.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5e34be0ba10b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5e34be0ba10b6) -
|
|
8
|
+
Cleanup show diff experiments
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 11.2.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 11.2.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.toggleExpandRange = exports.TOGGLE_EXPAND_RANGE_META_KEY = void 0;
|
|
7
7
|
var _expand = require("@atlaskit/editor-common/expand");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
8
|
var TOGGLE_EXPAND_RANGE_META_KEY = exports.TOGGLE_EXPAND_RANGE_META_KEY = 'toggleExpandRange';
|
|
11
9
|
var toggleExpandRange = exports.toggleExpandRange = function toggleExpandRange(from, to) {
|
|
12
10
|
var open = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -24,24 +22,18 @@ var toggleExpandRange = exports.toggleExpandRange = function toggleExpandRange(f
|
|
|
24
22
|
positions.push(pos);
|
|
25
23
|
}
|
|
26
24
|
});
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Set meta so the expand PM plugin can add node decorations.
|
|
34
|
-
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
35
|
-
// opens or closes the expand, even when the experiment below is disabled.
|
|
36
|
-
tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
|
|
37
|
-
positions: positions,
|
|
38
|
-
open: open
|
|
39
|
-
});
|
|
40
|
-
return tr;
|
|
41
|
-
}
|
|
42
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_aifc_expand_collapses_oncreate_fix', 'isEnabled', true)) {
|
|
43
|
-
return tr;
|
|
25
|
+
if (positions.length === 0) {
|
|
26
|
+
// No expand nodes found in the range — nothing to dispatch.
|
|
27
|
+
return null;
|
|
44
28
|
}
|
|
45
|
-
|
|
29
|
+
|
|
30
|
+
// Set meta so the expand PM plugin can add node decorations.
|
|
31
|
+
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
32
|
+
// opens or closes the expand.
|
|
33
|
+
tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
|
|
34
|
+
positions: positions,
|
|
35
|
+
open: open
|
|
36
|
+
});
|
|
37
|
+
return tr;
|
|
46
38
|
};
|
|
47
39
|
};
|
|
@@ -14,7 +14,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
14
14
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _view2 = require("@atlaskit/editor-prosemirror/view");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _toggleExpandRange = require("../../editor-commands/toggleExpandRange");
|
|
19
18
|
var _nodeViews = _interopRequireDefault(require("../node-views"));
|
|
20
19
|
// Ignored via go/ees005
|
|
@@ -40,9 +39,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
40
39
|
return _view2.DecorationSet.empty;
|
|
41
40
|
},
|
|
42
41
|
apply: function apply(tr, decorationSet) {
|
|
43
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_show_diff_scroll_navigation')) {
|
|
44
|
-
return _view2.DecorationSet.empty;
|
|
45
|
-
}
|
|
46
42
|
var meta = tr.getMeta(_toggleExpandRange.TOGGLE_EXPAND_RANGE_META_KEY);
|
|
47
43
|
if (meta && meta.positions.length > 0) {
|
|
48
44
|
// Add node decorations for each expand node that was toggled.
|
|
@@ -68,9 +64,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
68
64
|
},
|
|
69
65
|
props: {
|
|
70
66
|
decorations: function decorations(state) {
|
|
71
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_show_diff_scroll_navigation')) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
67
|
return pluginKey.getState(state);
|
|
75
68
|
},
|
|
76
69
|
nodeViews: {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
2
|
export const TOGGLE_EXPAND_RANGE_META_KEY = 'toggleExpandRange';
|
|
5
3
|
export const toggleExpandRange = (from, to, open = true) => ({
|
|
6
4
|
tr
|
|
@@ -18,23 +16,17 @@ export const toggleExpandRange = (from, to, open = true) => ({
|
|
|
18
16
|
positions.push(pos);
|
|
19
17
|
}
|
|
20
18
|
});
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Set meta so the expand PM plugin can add node decorations.
|
|
28
|
-
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
29
|
-
// opens or closes the expand, even when the experiment below is disabled.
|
|
30
|
-
tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
|
|
31
|
-
positions,
|
|
32
|
-
open
|
|
33
|
-
});
|
|
34
|
-
return tr;
|
|
35
|
-
}
|
|
36
|
-
if (expValEquals('platform_editor_aifc_expand_collapses_oncreate_fix', 'isEnabled', true)) {
|
|
37
|
-
return tr;
|
|
19
|
+
if (positions.length === 0) {
|
|
20
|
+
// No expand nodes found in the range — nothing to dispatch.
|
|
21
|
+
return null;
|
|
38
22
|
}
|
|
39
|
-
|
|
23
|
+
|
|
24
|
+
// Set meta so the expand PM plugin can add node decorations.
|
|
25
|
+
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
26
|
+
// opens or closes the expand.
|
|
27
|
+
tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
|
|
28
|
+
positions,
|
|
29
|
+
open
|
|
30
|
+
});
|
|
31
|
+
return tr;
|
|
40
32
|
};
|
|
@@ -4,7 +4,6 @@ import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
|
4
4
|
import { transformSliceExpandToNestedExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { TOGGLE_EXPAND_RANGE_META_KEY } from '../../editor-commands/toggleExpandRange';
|
|
9
8
|
// Ignored via go/ees005
|
|
10
9
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -23,9 +22,6 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
|
|
|
23
22
|
return DecorationSet.empty;
|
|
24
23
|
},
|
|
25
24
|
apply(tr, decorationSet) {
|
|
26
|
-
if (!fg('platform_editor_show_diff_scroll_navigation')) {
|
|
27
|
-
return DecorationSet.empty;
|
|
28
|
-
}
|
|
29
25
|
const meta = tr.getMeta(TOGGLE_EXPAND_RANGE_META_KEY);
|
|
30
26
|
if (meta && meta.positions.length > 0) {
|
|
31
27
|
// Add node decorations for each expand node that was toggled.
|
|
@@ -51,9 +47,6 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
|
|
|
51
47
|
},
|
|
52
48
|
props: {
|
|
53
49
|
decorations(state) {
|
|
54
|
-
if (!fg('platform_editor_show_diff_scroll_navigation')) {
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
50
|
return pluginKey.getState(state);
|
|
58
51
|
},
|
|
59
52
|
nodeViews: {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
2
|
export var TOGGLE_EXPAND_RANGE_META_KEY = 'toggleExpandRange';
|
|
5
3
|
export var toggleExpandRange = function toggleExpandRange(from, to) {
|
|
6
4
|
var open = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -18,24 +16,18 @@ export var toggleExpandRange = function toggleExpandRange(from, to) {
|
|
|
18
16
|
positions.push(pos);
|
|
19
17
|
}
|
|
20
18
|
});
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Set meta so the expand PM plugin can add node decorations.
|
|
28
|
-
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
29
|
-
// opens or closes the expand, even when the experiment below is disabled.
|
|
30
|
-
tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
|
|
31
|
-
positions: positions,
|
|
32
|
-
open: open
|
|
33
|
-
});
|
|
34
|
-
return tr;
|
|
35
|
-
}
|
|
36
|
-
if (expValEquals('platform_editor_aifc_expand_collapses_oncreate_fix', 'isEnabled', true)) {
|
|
37
|
-
return tr;
|
|
19
|
+
if (positions.length === 0) {
|
|
20
|
+
// No expand nodes found in the range — nothing to dispatch.
|
|
21
|
+
return null;
|
|
38
22
|
}
|
|
39
|
-
|
|
23
|
+
|
|
24
|
+
// Set meta so the expand PM plugin can add node decorations.
|
|
25
|
+
// This ensures ExpandNodeView.update() receives the decoration and visually
|
|
26
|
+
// opens or closes the expand.
|
|
27
|
+
tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
|
|
28
|
+
positions: positions,
|
|
29
|
+
open: open
|
|
30
|
+
});
|
|
31
|
+
return tr;
|
|
40
32
|
};
|
|
41
33
|
};
|
|
@@ -4,7 +4,6 @@ import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
|
4
4
|
import { transformSliceExpandToNestedExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { TOGGLE_EXPAND_RANGE_META_KEY } from '../../editor-commands/toggleExpandRange';
|
|
9
8
|
// Ignored via go/ees005
|
|
10
9
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -29,9 +28,6 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
29
28
|
return DecorationSet.empty;
|
|
30
29
|
},
|
|
31
30
|
apply: function apply(tr, decorationSet) {
|
|
32
|
-
if (!fg('platform_editor_show_diff_scroll_navigation')) {
|
|
33
|
-
return DecorationSet.empty;
|
|
34
|
-
}
|
|
35
31
|
var meta = tr.getMeta(TOGGLE_EXPAND_RANGE_META_KEY);
|
|
36
32
|
if (meta && meta.positions.length > 0) {
|
|
37
33
|
// Add node decorations for each expand node that was toggled.
|
|
@@ -57,9 +53,6 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
57
53
|
},
|
|
58
54
|
props: {
|
|
59
55
|
decorations: function decorations(state) {
|
|
60
|
-
if (!fg('platform_editor_show_diff_scroll_navigation')) {
|
|
61
|
-
return undefined;
|
|
62
|
-
}
|
|
63
56
|
return pluginKey.getState(state);
|
|
64
57
|
},
|
|
65
58
|
nodeViews: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.5",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,41 +29,43 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^52.
|
|
32
|
+
"@atlaskit/adf-schema": "^52.14.0",
|
|
33
33
|
"@atlaskit/button": "^23.11.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^10.1.0",
|
|
35
|
-
"@atlaskit/editor-plugin-block-controls": "^11.
|
|
35
|
+
"@atlaskit/editor-plugin-block-controls": "^11.5.0",
|
|
36
36
|
"@atlaskit/editor-plugin-block-menu": "^9.2.0",
|
|
37
37
|
"@atlaskit/editor-plugin-decorations": "^10.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^10.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^12.1.0",
|
|
40
|
-
"@atlaskit/editor-plugin-local-id": "^8.
|
|
40
|
+
"@atlaskit/editor-plugin-local-id": "^8.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-selection": "^10.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-selection-marker": "^10.2.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^3.11.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.10.0",
|
|
46
|
-
"@atlaskit/editor-toolbar": "^1.
|
|
47
|
-
"@atlaskit/icon": "^35.
|
|
48
|
-
"@atlaskit/icon-lab": "^6.
|
|
46
|
+
"@atlaskit/editor-toolbar": "^1.7.0",
|
|
47
|
+
"@atlaskit/icon": "^35.3.0",
|
|
48
|
+
"@atlaskit/icon-lab": "^6.12.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^84.0.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.0.0",
|
|
53
|
-
"@atlaskit/tooltip": "^22.
|
|
53
|
+
"@atlaskit/tooltip": "^22.3.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
56
|
"uuid": "^3.1.0",
|
|
57
57
|
"w3c-keyname": "^2.1.8"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^114.
|
|
60
|
+
"@atlaskit/editor-common": "^114.47.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@testing-library/react": "^16.3.0",
|
|
67
|
+
"react": "^18.2.0",
|
|
68
|
+
"react-dom": "^18.2.0",
|
|
67
69
|
"react-intl": "^6.6.2",
|
|
68
70
|
"react-test-renderer": "^18.2.0"
|
|
69
71
|
},
|
|
@@ -109,9 +111,6 @@
|
|
|
109
111
|
},
|
|
110
112
|
"platform_editor_block_menu_v2_patch_3": {
|
|
111
113
|
"type": "boolean"
|
|
112
|
-
},
|
|
113
|
-
"platform_editor_show_diff_scroll_navigation": {
|
|
114
|
-
"type": "boolean"
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
}
|