@atlaskit/editor-plugin-expand 2.6.4 → 2.7.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 +17 -0
- package/README.md +1 -1
- package/dist/cjs/plugin.js +1 -1
- package/dist/cjs/singlePlayerExpand/commands.js +9 -17
- package/dist/es2019/plugin.js +2 -2
- package/dist/es2019/singlePlayerExpand/commands.js +9 -17
- package/dist/esm/plugin.js +2 -2
- package/dist/esm/singlePlayerExpand/commands.js +9 -17
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 2.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#141652](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141652)
|
|
8
|
+
[`1cbce9d217a8e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1cbce9d217a8e) -
|
|
9
|
+
[ux] EDF-1549 AI button added in floating toolbar of panel, table, layout and expand behind
|
|
10
|
+
experiment.
|
|
11
|
+
|
|
12
|
+
## 2.6.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#140869](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/140869)
|
|
17
|
+
[`e69985951ade3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e69985951ade3) -
|
|
18
|
+
ED-24557: Cleaned up platform_editor_single_player_expand_ed_24536
|
|
19
|
+
|
|
3
20
|
## 2.6.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -27,4 +27,4 @@ Please see [Atlaskit - Editor plugin expand](https://atlaskit.atlassian.com/pack
|
|
|
27
27
|
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
28
|
## License
|
|
29
29
|
---
|
|
30
|
-
Please see [Atlassian Frontend - License](https://
|
|
30
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#Platform-License) for more licensing information.
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -17,7 +17,7 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
|
|
|
17
17
|
api: api
|
|
18
18
|
});
|
|
19
19
|
} else {
|
|
20
|
-
if ((0, _platformFeatureFlags.
|
|
20
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.single-player-expand')) {
|
|
21
21
|
return (0, _plugin2.expandPlugin)({
|
|
22
22
|
config: options,
|
|
23
23
|
api: api
|
|
@@ -16,7 +16,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
16
16
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
17
17
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
18
18
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
19
|
var _utils4 = require("../utils");
|
|
21
20
|
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; }
|
|
22
21
|
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; }
|
|
@@ -39,30 +38,23 @@ var createExpandNode = exports.createExpandNode = function createExpandNode(stat
|
|
|
39
38
|
var insertExpandWithInputMethod = exports.insertExpandWithInputMethod = function insertExpandWithInputMethod(editorAnalyticsAPI, isNestingExpandsSupported) {
|
|
40
39
|
return function (inputMethod) {
|
|
41
40
|
return function (state, dispatch) {
|
|
42
|
-
var expandNode =
|
|
41
|
+
var expandNode = createExpandNode(state, false, isNestingExpandsSupported);
|
|
43
42
|
if (!expandNode) {
|
|
44
43
|
return false;
|
|
45
44
|
}
|
|
46
45
|
var tr;
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_expand.expandedState.set(expandNode, true);
|
|
51
|
-
} else {
|
|
52
|
-
tr = (0, _utils.createWrapSelectionTransaction)({
|
|
53
|
-
state: state,
|
|
54
|
-
type: expandNode.type
|
|
55
|
-
});
|
|
56
|
-
var wrapperNode = (0, _utils2.findParentNodeOfType)(expandNode.type)(tr.selection);
|
|
57
|
-
if (wrapperNode) {
|
|
58
|
-
_expand.expandedState.set(wrapperNode.node, true);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
46
|
+
if (state.selection.empty) {
|
|
47
|
+
tr = (0, _utils2.safeInsert)(expandNode)(state.tr).scrollIntoView();
|
|
48
|
+
_expand.expandedState.set(expandNode, true);
|
|
61
49
|
} else {
|
|
62
|
-
tr =
|
|
50
|
+
tr = (0, _utils.createWrapSelectionTransaction)({
|
|
63
51
|
state: state,
|
|
64
52
|
type: expandNode.type
|
|
65
53
|
});
|
|
54
|
+
var wrapperNode = (0, _utils2.findParentNodeOfType)(expandNode.type)(tr.selection);
|
|
55
|
+
if (wrapperNode) {
|
|
56
|
+
_expand.expandedState.set(wrapperNode.node, true);
|
|
57
|
+
}
|
|
66
58
|
}
|
|
67
59
|
var payload = {
|
|
68
60
|
action: _analytics.ACTION.INSERTED,
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { expandPlugin as legacyExpandPlugin } from './legacyExpand/plugin';
|
|
3
3
|
import { expandPlugin as singlePlayerExpandPlugin } from './singlePlayerExpand/plugin';
|
|
4
4
|
export const expandPlugin = ({
|
|
@@ -11,7 +11,7 @@ export const expandPlugin = ({
|
|
|
11
11
|
api
|
|
12
12
|
});
|
|
13
13
|
} else {
|
|
14
|
-
if (
|
|
14
|
+
if (fg('platform.editor.single-player-expand')) {
|
|
15
15
|
return singlePlayerExpandPlugin({
|
|
16
16
|
config: options,
|
|
17
17
|
api
|
|
@@ -8,7 +8,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
|
8
8
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { isNestedInExpand } from '../utils';
|
|
13
12
|
|
|
14
13
|
// Creates either an expand or a nestedExpand node based on the current selection
|
|
@@ -27,30 +26,23 @@ export const createExpandNode = (state, setExpandedState = true, isNestingExpand
|
|
|
27
26
|
return expandNode;
|
|
28
27
|
};
|
|
29
28
|
export const insertExpandWithInputMethod = (editorAnalyticsAPI, isNestingExpandsSupported) => inputMethod => (state, dispatch) => {
|
|
30
|
-
const expandNode =
|
|
29
|
+
const expandNode = createExpandNode(state, false, isNestingExpandsSupported);
|
|
31
30
|
if (!expandNode) {
|
|
32
31
|
return false;
|
|
33
32
|
}
|
|
34
33
|
let tr;
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
expandedState.set(expandNode, true);
|
|
39
|
-
} else {
|
|
40
|
-
tr = createWrapSelectionTransaction({
|
|
41
|
-
state,
|
|
42
|
-
type: expandNode.type
|
|
43
|
-
});
|
|
44
|
-
const wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
|
|
45
|
-
if (wrapperNode) {
|
|
46
|
-
expandedState.set(wrapperNode.node, true);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
34
|
+
if (state.selection.empty) {
|
|
35
|
+
tr = safeInsert(expandNode)(state.tr).scrollIntoView();
|
|
36
|
+
expandedState.set(expandNode, true);
|
|
49
37
|
} else {
|
|
50
|
-
tr =
|
|
38
|
+
tr = createWrapSelectionTransaction({
|
|
51
39
|
state,
|
|
52
40
|
type: expandNode.type
|
|
53
41
|
});
|
|
42
|
+
const wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
|
|
43
|
+
if (wrapperNode) {
|
|
44
|
+
expandedState.set(wrapperNode.node, true);
|
|
45
|
+
}
|
|
54
46
|
}
|
|
55
47
|
const payload = {
|
|
56
48
|
action: ACTION.INSERTED,
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { expandPlugin as legacyExpandPlugin } from './legacyExpand/plugin';
|
|
3
3
|
import { expandPlugin as singlePlayerExpandPlugin } from './singlePlayerExpand/plugin';
|
|
4
4
|
export var expandPlugin = function expandPlugin(_ref) {
|
|
@@ -11,7 +11,7 @@ export var expandPlugin = function expandPlugin(_ref) {
|
|
|
11
11
|
api: api
|
|
12
12
|
});
|
|
13
13
|
} else {
|
|
14
|
-
if (
|
|
14
|
+
if (fg('platform.editor.single-player-expand')) {
|
|
15
15
|
return singlePlayerExpandPlugin({
|
|
16
16
|
config: options,
|
|
17
17
|
api: api
|
|
@@ -11,7 +11,6 @@ import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
|
11
11
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
13
13
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { isNestedInExpand } from '../utils';
|
|
16
15
|
|
|
17
16
|
// Creates either an expand or a nestedExpand node based on the current selection
|
|
@@ -33,30 +32,23 @@ export var createExpandNode = function createExpandNode(state) {
|
|
|
33
32
|
export var insertExpandWithInputMethod = function insertExpandWithInputMethod(editorAnalyticsAPI, isNestingExpandsSupported) {
|
|
34
33
|
return function (inputMethod) {
|
|
35
34
|
return function (state, dispatch) {
|
|
36
|
-
var expandNode =
|
|
35
|
+
var expandNode = createExpandNode(state, false, isNestingExpandsSupported);
|
|
37
36
|
if (!expandNode) {
|
|
38
37
|
return false;
|
|
39
38
|
}
|
|
40
39
|
var tr;
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
expandedState.set(expandNode, true);
|
|
45
|
-
} else {
|
|
46
|
-
tr = createWrapSelectionTransaction({
|
|
47
|
-
state: state,
|
|
48
|
-
type: expandNode.type
|
|
49
|
-
});
|
|
50
|
-
var wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
|
|
51
|
-
if (wrapperNode) {
|
|
52
|
-
expandedState.set(wrapperNode.node, true);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
40
|
+
if (state.selection.empty) {
|
|
41
|
+
tr = safeInsert(expandNode)(state.tr).scrollIntoView();
|
|
42
|
+
expandedState.set(expandNode, true);
|
|
55
43
|
} else {
|
|
56
|
-
tr =
|
|
44
|
+
tr = createWrapSelectionTransaction({
|
|
57
45
|
state: state,
|
|
58
46
|
type: expandNode.type
|
|
59
47
|
});
|
|
48
|
+
var wrapperNode = findParentNodeOfType(expandNode.type)(tr.selection);
|
|
49
|
+
if (wrapperNode) {
|
|
50
|
+
expandedState.set(wrapperNode.node, true);
|
|
51
|
+
}
|
|
60
52
|
}
|
|
61
53
|
var payload = {
|
|
62
54
|
action: ACTION.INSERTED,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
35
35
|
"@atlaskit/button": "^20.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^89.
|
|
36
|
+
"@atlaskit/editor-common": "^89.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
44
44
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
45
|
-
"@atlaskit/icon": "^22.
|
|
45
|
+
"@atlaskit/icon": "^22.18.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
47
47
|
"@atlaskit/tooltip": "^18.7.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/editor-plugin-content-insertion": "^1.8.0",
|
|
60
60
|
"@atlaskit/editor-plugin-guideline": "^1.2.0",
|
|
61
61
|
"@atlaskit/editor-plugin-quick-insert": "^1.3.0",
|
|
62
|
-
"@atlaskit/editor-plugin-table": "^7.
|
|
62
|
+
"@atlaskit/editor-plugin-table": "^7.26.0",
|
|
63
63
|
"@atlaskit/editor-plugin-type-ahead": "^1.8.0",
|
|
64
64
|
"@atlaskit/editor-plugin-width": "^1.3.0",
|
|
65
65
|
"@testing-library/react": "^12.1.5",
|
|
@@ -109,9 +109,6 @@
|
|
|
109
109
|
"platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
|
|
110
110
|
"type": "boolean"
|
|
111
111
|
},
|
|
112
|
-
"platform_editor_single_player_expand_ed_24536": {
|
|
113
|
-
"type": "boolean"
|
|
114
|
-
},
|
|
115
112
|
"platform_editor_nest_nested_expand_in_expand_jira": {
|
|
116
113
|
"type": "boolean"
|
|
117
114
|
},
|