@atlaskit/editor-plugin-expand 2.6.1 → 2.6.3
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 +19 -0
- package/dist/cjs/legacyExpand/pm-plugins/main.js +58 -3
- package/dist/cjs/legacyExpand/ui/ExpandIconButton.js +2 -2
- package/dist/cjs/singlePlayerExpand/pm-plugins/main.js +61 -4
- package/dist/cjs/singlePlayerExpand/ui/ExpandButton.js +1 -1
- package/dist/es2019/legacyExpand/pm-plugins/main.js +64 -4
- package/dist/es2019/singlePlayerExpand/pm-plugins/main.js +64 -3
- package/dist/esm/legacyExpand/pm-plugins/main.js +58 -4
- package/dist/esm/legacyExpand/ui/ExpandIconButton.js +1 -1
- package/dist/esm/singlePlayerExpand/pm-plugins/main.js +58 -3
- package/dist/types/legacyExpand/pm-plugins/main.d.ts +6 -0
- package/dist/types/singlePlayerExpand/pm-plugins/main.d.ts +6 -0
- package/dist/types-ts4.5/legacyExpand/pm-plugins/main.d.ts +6 -0
- package/dist/types-ts4.5/singlePlayerExpand/pm-plugins/main.d.ts +6 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 2.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#139631](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139631)
|
|
8
|
+
[`0c5d47f791446`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c5d47f791446) -
|
|
9
|
+
ED-24839 - Added logic to handleDrop for the expand plugin so nested expands are converted to
|
|
10
|
+
expand nodes when dragged outside of an expand. Prosemirror was automatically wrapping them in an
|
|
11
|
+
empty parent expand.
|
|
12
|
+
|
|
13
|
+
## 2.6.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#139052](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139052)
|
|
18
|
+
[`6e5c1f6bbf028`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6e5c1f6bbf028) -
|
|
19
|
+
removed 'platform' from cardPlugin configs
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 2.6.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.containsClass = containsClass;
|
|
8
8
|
exports.createPlugin = void 0;
|
|
9
|
+
exports.handleDraggingOfNestedExpand = handleDraggingOfNestedExpand;
|
|
9
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
11
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
11
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
13
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
15
|
var _commands = require("../commands");
|
|
14
16
|
var _nodeviews = _interopRequireDefault(require("../nodeviews"));
|
|
15
17
|
var _utils2 = require("../utils");
|
|
@@ -25,7 +27,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
25
27
|
var allowInteractiveExpand = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
26
28
|
var __livePage = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
27
29
|
var state = (0, _pluginFactory.createPluginState)(dispatch, {});
|
|
28
|
-
var isMobile =
|
|
30
|
+
var isMobile = false;
|
|
29
31
|
return new _safePlugin.SafePlugin({
|
|
30
32
|
state: state,
|
|
31
33
|
key: _pluginFactory.pluginKey,
|
|
@@ -59,7 +61,13 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
59
61
|
return target.classList.contains(_styles.expandClassNames.prefix);
|
|
60
62
|
}, {
|
|
61
63
|
useLongPressSelection: useLongPressSelection
|
|
62
|
-
})
|
|
64
|
+
}),
|
|
65
|
+
handleDrop: function handleDrop(view, event, slice, moved) {
|
|
66
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_nest_nested_expand_drag_fix')) {
|
|
67
|
+
return handleDraggingOfNestedExpand(view, event, slice);
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
63
71
|
},
|
|
64
72
|
// @see ED-8027 to follow up on this work-around
|
|
65
73
|
filterTransaction: function filterTransaction(tr) {
|
|
@@ -85,4 +93,51 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
95
|
});
|
|
88
|
-
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
100
|
+
*/
|
|
101
|
+
function handleDraggingOfNestedExpand(view, event, slice) {
|
|
102
|
+
var _slice$content$firstC;
|
|
103
|
+
var state = view.state,
|
|
104
|
+
dispatch = view.dispatch;
|
|
105
|
+
var tr = state.tr;
|
|
106
|
+
var selection = state.selection;
|
|
107
|
+
var from = selection.from,
|
|
108
|
+
to = selection.to;
|
|
109
|
+
var supportedDropLocations = [state.schema.nodes.doc, state.schema.nodes.layoutSection, state.schema.nodes.layoutColumn];
|
|
110
|
+
|
|
111
|
+
// Check if the contents of the dragged slice contain a nested expand node.
|
|
112
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) !== state.schema.nodes.nestedExpand) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
var dropPos = view.posAtCoords({
|
|
116
|
+
left: event.clientX,
|
|
117
|
+
top: event.clientY
|
|
118
|
+
});
|
|
119
|
+
if (!dropPos) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
var resolvedPos = state.doc.resolve(dropPos.pos);
|
|
123
|
+
|
|
124
|
+
// If not dropping into the root of the document, check if the parent node type of the drop location is supported.
|
|
125
|
+
if (resolvedPos.depth > 1) {
|
|
126
|
+
var parentNodeType = resolvedPos.node(resolvedPos.depth - 1).type;
|
|
127
|
+
// If you're not dropping into a doc or layoutSection, don't transform the nested expand, return false and allow default behaviour.
|
|
128
|
+
if (!supportedDropLocations.includes(parentNodeType)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
var updatedSlice = (0, _utils2.transformSliceNestedExpandToExpand)(slice, state.schema);
|
|
133
|
+
if (updatedSlice.eq(slice)) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// The drop position will be affected when the original slice is deleted from the document.
|
|
138
|
+
var updatedDropPos = dropPos.pos > from ? dropPos.pos - updatedSlice.content.size : dropPos.pos;
|
|
139
|
+
tr.delete(from, to);
|
|
140
|
+
tr.insert(updatedDropPos, updatedSlice.content);
|
|
141
|
+
dispatch(tr);
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
@@ -24,10 +24,10 @@ var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron
|
|
|
24
24
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
25
25
|
var _excluded = ["buttonStyles"];
|
|
26
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
28
|
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; }
|
|
29
29
|
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; }
|
|
30
|
-
function _createSuper(
|
|
30
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
31
31
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
32
32
|
* @jsxRuntime classic
|
|
33
33
|
* @jsx jsx
|
|
@@ -5,12 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.containsClass = containsClass;
|
|
8
|
-
exports.
|
|
8
|
+
exports.createPlugin = void 0;
|
|
9
|
+
exports.handleDraggingOfNestedExpand = handleDraggingOfNestedExpand;
|
|
10
|
+
exports.pluginKey = void 0;
|
|
9
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
12
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
11
13
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
16
|
var _nodeViews = _interopRequireDefault(require("../node-views"));
|
|
17
|
+
var _utils = require("../utils");
|
|
14
18
|
var pluginKey = exports.pluginKey = new _state.PluginKey('expandPlugin');
|
|
15
19
|
function containsClass(element, className) {
|
|
16
20
|
var _element$classList;
|
|
@@ -22,7 +26,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
22
26
|
var api = arguments.length > 4 ? arguments[4] : undefined;
|
|
23
27
|
var allowInteractiveExpand = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
24
28
|
var __livePage = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
25
|
-
var isMobile =
|
|
29
|
+
var isMobile = false;
|
|
26
30
|
return new _safePlugin.SafePlugin({
|
|
27
31
|
key: pluginKey,
|
|
28
32
|
props: {
|
|
@@ -55,7 +59,13 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
55
59
|
return target.classList.contains(_styles.expandClassNames.prefix);
|
|
56
60
|
}, {
|
|
57
61
|
useLongPressSelection: useLongPressSelection
|
|
58
|
-
})
|
|
62
|
+
}),
|
|
63
|
+
handleDrop: function handleDrop(view, event, slice, moved) {
|
|
64
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_nest_nested_expand_drag_fix')) {
|
|
65
|
+
return handleDraggingOfNestedExpand(view, event, slice);
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
59
69
|
},
|
|
60
70
|
// @see ED-8027 to follow up on this work-around
|
|
61
71
|
filterTransaction: function filterTransaction(tr) {
|
|
@@ -65,4 +75,51 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, getInt
|
|
|
65
75
|
return true;
|
|
66
76
|
}
|
|
67
77
|
});
|
|
68
|
-
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
82
|
+
*/
|
|
83
|
+
function handleDraggingOfNestedExpand(view, event, slice) {
|
|
84
|
+
var _slice$content$firstC;
|
|
85
|
+
var state = view.state,
|
|
86
|
+
dispatch = view.dispatch;
|
|
87
|
+
var tr = state.tr;
|
|
88
|
+
var selection = state.selection;
|
|
89
|
+
var from = selection.from,
|
|
90
|
+
to = selection.to;
|
|
91
|
+
var supportedDropLocations = [state.schema.nodes.doc, state.schema.nodes.layoutSection, state.schema.nodes.layoutColumn];
|
|
92
|
+
|
|
93
|
+
// Check if the contents of the dragged slice contain a nested expand node.
|
|
94
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) !== state.schema.nodes.nestedExpand) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
var dropPos = view.posAtCoords({
|
|
98
|
+
left: event.clientX,
|
|
99
|
+
top: event.clientY
|
|
100
|
+
});
|
|
101
|
+
if (!dropPos) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
var resolvedPos = state.doc.resolve(dropPos.pos);
|
|
105
|
+
|
|
106
|
+
// If not dropping into the root of the document, check if the parent node type of the drop location is supported.
|
|
107
|
+
if (resolvedPos.depth > 1) {
|
|
108
|
+
var parentNodeType = resolvedPos.node(resolvedPos.depth - 1).type;
|
|
109
|
+
// If you're not dropping into a doc or layoutSection, don't transform the nested expand, return false and allow default behaviour.
|
|
110
|
+
if (!supportedDropLocations.includes(parentNodeType)) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
var updatedSlice = (0, _utils.transformSliceNestedExpandToExpand)(slice, state.schema);
|
|
115
|
+
if (updatedSlice.eq(slice)) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// The drop position will be affected when the original slice is deleted from the document.
|
|
120
|
+
var updatedDropPos = dropPos.pos > from ? dropPos.pos - updatedSlice.content.size : dropPos.pos;
|
|
121
|
+
tr.delete(from, to);
|
|
122
|
+
tr.insert(updatedDropPos, updatedSlice.content);
|
|
123
|
+
dispatch(tr);
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
@@ -24,7 +24,7 @@ var _excluded = ["buttonStyles"];
|
|
|
24
24
|
*/
|
|
25
25
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
28
|
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; }
|
|
29
29
|
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; }
|
|
30
30
|
function withTooltip(Component) {
|
|
@@ -2,9 +2,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { setExpandRef } from '../commands';
|
|
6
7
|
import ExpandNodeView from '../nodeviews';
|
|
7
|
-
import { findExpand } from '../utils';
|
|
8
|
+
import { findExpand, transformSliceNestedExpandToExpand } from '../utils';
|
|
8
9
|
import { createPluginState, getPluginState, pluginKey } from './plugin-factory';
|
|
9
10
|
export function containsClass(element, className) {
|
|
10
11
|
var _element$classList;
|
|
@@ -12,7 +13,7 @@ export function containsClass(element, className) {
|
|
|
12
13
|
}
|
|
13
14
|
export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLongPressSelection = false, api, allowInteractiveExpand = true, __livePage = false) => {
|
|
14
15
|
const state = createPluginState(dispatch, {});
|
|
15
|
-
const isMobile =
|
|
16
|
+
const isMobile = false;
|
|
16
17
|
return new SafePlugin({
|
|
17
18
|
state: state,
|
|
18
19
|
key: pluginKey,
|
|
@@ -44,7 +45,13 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
|
|
|
44
45
|
},
|
|
45
46
|
handleClickOn: createSelectionClickHandler(['expand', 'nestedExpand'], target => target.classList.contains(expandClassNames.prefix), {
|
|
46
47
|
useLongPressSelection
|
|
47
|
-
})
|
|
48
|
+
}),
|
|
49
|
+
handleDrop(view, event, slice, moved) {
|
|
50
|
+
if (fg('platform_editor_nest_nested_expand_drag_fix')) {
|
|
51
|
+
return handleDraggingOfNestedExpand(view, event, slice);
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
48
55
|
},
|
|
49
56
|
// @see ED-8027 to follow up on this work-around
|
|
50
57
|
filterTransaction(tr) {
|
|
@@ -72,4 +79,57 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
|
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
81
|
});
|
|
75
|
-
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
86
|
+
*/
|
|
87
|
+
export function handleDraggingOfNestedExpand(view, event, slice) {
|
|
88
|
+
var _slice$content$firstC;
|
|
89
|
+
const {
|
|
90
|
+
state,
|
|
91
|
+
dispatch
|
|
92
|
+
} = view;
|
|
93
|
+
const tr = state.tr;
|
|
94
|
+
const {
|
|
95
|
+
selection
|
|
96
|
+
} = state;
|
|
97
|
+
const {
|
|
98
|
+
from,
|
|
99
|
+
to
|
|
100
|
+
} = selection;
|
|
101
|
+
const supportedDropLocations = [state.schema.nodes.doc, state.schema.nodes.layoutSection, state.schema.nodes.layoutColumn];
|
|
102
|
+
|
|
103
|
+
// Check if the contents of the dragged slice contain a nested expand node.
|
|
104
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) !== state.schema.nodes.nestedExpand) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
const dropPos = view.posAtCoords({
|
|
108
|
+
left: event.clientX,
|
|
109
|
+
top: event.clientY
|
|
110
|
+
});
|
|
111
|
+
if (!dropPos) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
const resolvedPos = state.doc.resolve(dropPos.pos);
|
|
115
|
+
|
|
116
|
+
// If not dropping into the root of the document, check if the parent node type of the drop location is supported.
|
|
117
|
+
if (resolvedPos.depth > 1) {
|
|
118
|
+
const parentNodeType = resolvedPos.node(resolvedPos.depth - 1).type;
|
|
119
|
+
// If you're not dropping into a doc or layoutSection, don't transform the nested expand, return false and allow default behaviour.
|
|
120
|
+
if (!supportedDropLocations.includes(parentNodeType)) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
125
|
+
if (updatedSlice.eq(slice)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// The drop position will be affected when the original slice is deleted from the document.
|
|
130
|
+
const updatedDropPos = dropPos.pos > from ? dropPos.pos - updatedSlice.content.size : dropPos.pos;
|
|
131
|
+
tr.delete(from, to);
|
|
132
|
+
tr.insert(updatedDropPos, updatedSlice.content);
|
|
133
|
+
dispatch(tr);
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
@@ -2,14 +2,16 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import ExpandNodeView from '../node-views';
|
|
7
|
+
import { transformSliceNestedExpandToExpand } from '../utils';
|
|
6
8
|
export const pluginKey = new PluginKey('expandPlugin');
|
|
7
9
|
export function containsClass(element, className) {
|
|
8
10
|
var _element$classList;
|
|
9
11
|
return Boolean(element === null || element === void 0 ? void 0 : (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(className));
|
|
10
12
|
}
|
|
11
13
|
export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLongPressSelection = false, api, allowInteractiveExpand = true, __livePage = false) => {
|
|
12
|
-
const isMobile =
|
|
14
|
+
const isMobile = false;
|
|
13
15
|
return new SafePlugin({
|
|
14
16
|
key: pluginKey,
|
|
15
17
|
props: {
|
|
@@ -40,7 +42,13 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
|
|
|
40
42
|
},
|
|
41
43
|
handleClickOn: createSelectionClickHandler(['expand', 'nestedExpand'], target => target.classList.contains(expandClassNames.prefix), {
|
|
42
44
|
useLongPressSelection
|
|
43
|
-
})
|
|
45
|
+
}),
|
|
46
|
+
handleDrop(view, event, slice, moved) {
|
|
47
|
+
if (fg('platform_editor_nest_nested_expand_drag_fix')) {
|
|
48
|
+
return handleDraggingOfNestedExpand(view, event, slice);
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
44
52
|
},
|
|
45
53
|
// @see ED-8027 to follow up on this work-around
|
|
46
54
|
filterTransaction(tr) {
|
|
@@ -50,4 +58,57 @@ export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLon
|
|
|
50
58
|
return true;
|
|
51
59
|
}
|
|
52
60
|
});
|
|
53
|
-
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
65
|
+
*/
|
|
66
|
+
export function handleDraggingOfNestedExpand(view, event, slice) {
|
|
67
|
+
var _slice$content$firstC;
|
|
68
|
+
const {
|
|
69
|
+
state,
|
|
70
|
+
dispatch
|
|
71
|
+
} = view;
|
|
72
|
+
const tr = state.tr;
|
|
73
|
+
const {
|
|
74
|
+
selection
|
|
75
|
+
} = state;
|
|
76
|
+
const {
|
|
77
|
+
from,
|
|
78
|
+
to
|
|
79
|
+
} = selection;
|
|
80
|
+
const supportedDropLocations = [state.schema.nodes.doc, state.schema.nodes.layoutSection, state.schema.nodes.layoutColumn];
|
|
81
|
+
|
|
82
|
+
// Check if the contents of the dragged slice contain a nested expand node.
|
|
83
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) !== state.schema.nodes.nestedExpand) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const dropPos = view.posAtCoords({
|
|
87
|
+
left: event.clientX,
|
|
88
|
+
top: event.clientY
|
|
89
|
+
});
|
|
90
|
+
if (!dropPos) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const resolvedPos = state.doc.resolve(dropPos.pos);
|
|
94
|
+
|
|
95
|
+
// If not dropping into the root of the document, check if the parent node type of the drop location is supported.
|
|
96
|
+
if (resolvedPos.depth > 1) {
|
|
97
|
+
const parentNodeType = resolvedPos.node(resolvedPos.depth - 1).type;
|
|
98
|
+
// If you're not dropping into a doc or layoutSection, don't transform the nested expand, return false and allow default behaviour.
|
|
99
|
+
if (!supportedDropLocations.includes(parentNodeType)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
104
|
+
if (updatedSlice.eq(slice)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// The drop position will be affected when the original slice is deleted from the document.
|
|
109
|
+
const updatedDropPos = dropPos.pos > from ? dropPos.pos - updatedSlice.content.size : dropPos.pos;
|
|
110
|
+
tr.delete(from, to);
|
|
111
|
+
tr.insert(updatedDropPos, updatedSlice.content);
|
|
112
|
+
dispatch(tr);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
@@ -2,9 +2,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { setExpandRef } from '../commands';
|
|
6
7
|
import ExpandNodeView from '../nodeviews';
|
|
7
|
-
import { findExpand } from '../utils';
|
|
8
|
+
import { findExpand, transformSliceNestedExpandToExpand } from '../utils';
|
|
8
9
|
import { createPluginState, getPluginState, pluginKey } from './plugin-factory';
|
|
9
10
|
export function containsClass(element, className) {
|
|
10
11
|
var _element$classList;
|
|
@@ -17,7 +18,7 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
17
18
|
var allowInteractiveExpand = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
18
19
|
var __livePage = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
19
20
|
var state = createPluginState(dispatch, {});
|
|
20
|
-
var isMobile =
|
|
21
|
+
var isMobile = false;
|
|
21
22
|
return new SafePlugin({
|
|
22
23
|
state: state,
|
|
23
24
|
key: pluginKey,
|
|
@@ -51,7 +52,13 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
51
52
|
return target.classList.contains(expandClassNames.prefix);
|
|
52
53
|
}, {
|
|
53
54
|
useLongPressSelection: useLongPressSelection
|
|
54
|
-
})
|
|
55
|
+
}),
|
|
56
|
+
handleDrop: function handleDrop(view, event, slice, moved) {
|
|
57
|
+
if (fg('platform_editor_nest_nested_expand_drag_fix')) {
|
|
58
|
+
return handleDraggingOfNestedExpand(view, event, slice);
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
55
62
|
},
|
|
56
63
|
// @see ED-8027 to follow up on this work-around
|
|
57
64
|
filterTransaction: function filterTransaction(tr) {
|
|
@@ -77,4 +84,51 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
77
84
|
};
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
|
-
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
91
|
+
*/
|
|
92
|
+
export function handleDraggingOfNestedExpand(view, event, slice) {
|
|
93
|
+
var _slice$content$firstC;
|
|
94
|
+
var state = view.state,
|
|
95
|
+
dispatch = view.dispatch;
|
|
96
|
+
var tr = state.tr;
|
|
97
|
+
var selection = state.selection;
|
|
98
|
+
var from = selection.from,
|
|
99
|
+
to = selection.to;
|
|
100
|
+
var supportedDropLocations = [state.schema.nodes.doc, state.schema.nodes.layoutSection, state.schema.nodes.layoutColumn];
|
|
101
|
+
|
|
102
|
+
// Check if the contents of the dragged slice contain a nested expand node.
|
|
103
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) !== state.schema.nodes.nestedExpand) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
var dropPos = view.posAtCoords({
|
|
107
|
+
left: event.clientX,
|
|
108
|
+
top: event.clientY
|
|
109
|
+
});
|
|
110
|
+
if (!dropPos) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
var resolvedPos = state.doc.resolve(dropPos.pos);
|
|
114
|
+
|
|
115
|
+
// If not dropping into the root of the document, check if the parent node type of the drop location is supported.
|
|
116
|
+
if (resolvedPos.depth > 1) {
|
|
117
|
+
var parentNodeType = resolvedPos.node(resolvedPos.depth - 1).type;
|
|
118
|
+
// If you're not dropping into a doc or layoutSection, don't transform the nested expand, return false and allow default behaviour.
|
|
119
|
+
if (!supportedDropLocations.includes(parentNodeType)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
var updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
124
|
+
if (updatedSlice.eq(slice)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// The drop position will be affected when the original slice is deleted from the document.
|
|
129
|
+
var updatedDropPos = dropPos.pos > from ? dropPos.pos - updatedSlice.content.size : dropPos.pos;
|
|
130
|
+
tr.delete(from, to);
|
|
131
|
+
tr.insert(updatedDropPos, updatedSlice.content);
|
|
132
|
+
dispatch(tr);
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
@@ -9,7 +9,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
9
9
|
var _excluded = ["buttonStyles"];
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
12
|
-
function _createSuper(
|
|
12
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
/**
|
|
15
15
|
* @jsxRuntime classic
|
|
@@ -2,7 +2,9 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import ExpandNodeView from '../node-views';
|
|
7
|
+
import { transformSliceNestedExpandToExpand } from '../utils';
|
|
6
8
|
export var pluginKey = new PluginKey('expandPlugin');
|
|
7
9
|
export function containsClass(element, className) {
|
|
8
10
|
var _element$classList;
|
|
@@ -14,7 +16,7 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
14
16
|
var api = arguments.length > 4 ? arguments[4] : undefined;
|
|
15
17
|
var allowInteractiveExpand = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
16
18
|
var __livePage = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
17
|
-
var isMobile =
|
|
19
|
+
var isMobile = false;
|
|
18
20
|
return new SafePlugin({
|
|
19
21
|
key: pluginKey,
|
|
20
22
|
props: {
|
|
@@ -47,7 +49,13 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
47
49
|
return target.classList.contains(expandClassNames.prefix);
|
|
48
50
|
}, {
|
|
49
51
|
useLongPressSelection: useLongPressSelection
|
|
50
|
-
})
|
|
52
|
+
}),
|
|
53
|
+
handleDrop: function handleDrop(view, event, slice, moved) {
|
|
54
|
+
if (fg('platform_editor_nest_nested_expand_drag_fix')) {
|
|
55
|
+
return handleDraggingOfNestedExpand(view, event, slice);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
51
59
|
},
|
|
52
60
|
// @see ED-8027 to follow up on this work-around
|
|
53
61
|
filterTransaction: function filterTransaction(tr) {
|
|
@@ -57,4 +65,51 @@ export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
|
57
65
|
return true;
|
|
58
66
|
}
|
|
59
67
|
});
|
|
60
|
-
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
72
|
+
*/
|
|
73
|
+
export function handleDraggingOfNestedExpand(view, event, slice) {
|
|
74
|
+
var _slice$content$firstC;
|
|
75
|
+
var state = view.state,
|
|
76
|
+
dispatch = view.dispatch;
|
|
77
|
+
var tr = state.tr;
|
|
78
|
+
var selection = state.selection;
|
|
79
|
+
var from = selection.from,
|
|
80
|
+
to = selection.to;
|
|
81
|
+
var supportedDropLocations = [state.schema.nodes.doc, state.schema.nodes.layoutSection, state.schema.nodes.layoutColumn];
|
|
82
|
+
|
|
83
|
+
// Check if the contents of the dragged slice contain a nested expand node.
|
|
84
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) !== state.schema.nodes.nestedExpand) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
var dropPos = view.posAtCoords({
|
|
88
|
+
left: event.clientX,
|
|
89
|
+
top: event.clientY
|
|
90
|
+
});
|
|
91
|
+
if (!dropPos) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
var resolvedPos = state.doc.resolve(dropPos.pos);
|
|
95
|
+
|
|
96
|
+
// If not dropping into the root of the document, check if the parent node type of the drop location is supported.
|
|
97
|
+
if (resolvedPos.depth > 1) {
|
|
98
|
+
var parentNodeType = resolvedPos.node(resolvedPos.depth - 1).type;
|
|
99
|
+
// If you're not dropping into a doc or layoutSection, don't transform the nested expand, return false and allow default behaviour.
|
|
100
|
+
if (!supportedDropLocations.includes(parentNodeType)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
var updatedSlice = transformSliceNestedExpandToExpand(slice, state.schema);
|
|
105
|
+
if (updatedSlice.eq(slice)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// The drop position will be affected when the original slice is deleted from the document.
|
|
110
|
+
var updatedDropPos = dropPos.pos > from ? dropPos.pos - updatedSlice.content.size : dropPos.pos;
|
|
111
|
+
tr.delete(from, to);
|
|
112
|
+
tr.insert(updatedDropPos, updatedSlice.content);
|
|
113
|
+
dispatch(tr);
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
@@ -2,6 +2,12 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
7
|
import type { ExpandPlugin } from '../../types';
|
|
6
8
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
7
9
|
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<import("../../types").ExpandPluginState>;
|
|
10
|
+
/**
|
|
11
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleDraggingOfNestedExpand(view: EditorView, event: DragEvent, slice: Slice): boolean;
|
|
@@ -2,8 +2,14 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
5
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
8
|
import type { ExpandPlugin } from '../../types';
|
|
7
9
|
export declare const pluginKey: PluginKey<any>;
|
|
8
10
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
9
11
|
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<any>;
|
|
12
|
+
/**
|
|
13
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleDraggingOfNestedExpand(view: EditorView, event: DragEvent, slice: Slice): boolean;
|
|
@@ -2,6 +2,12 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
7
|
import type { ExpandPlugin } from '../../types';
|
|
6
8
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
7
9
|
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<import("../../types").ExpandPluginState>;
|
|
10
|
+
/**
|
|
11
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleDraggingOfNestedExpand(view: EditorView, event: DragEvent, slice: Slice): boolean;
|
|
@@ -2,8 +2,14 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import { type Slice } from '@atlaskit/editor-prosemirror/model';
|
|
5
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
8
|
import type { ExpandPlugin } from '../../types';
|
|
7
9
|
export declare const pluginKey: PluginKey<any>;
|
|
8
10
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
9
11
|
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<any>;
|
|
12
|
+
/**
|
|
13
|
+
* As the nestedExpand node is not supported outside of the expand node, it must be converted to an expand node when dragged outside of the expand node.
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleDraggingOfNestedExpand(view: EditorView, event: DragEvent, slice: Slice): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
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": "^
|
|
36
|
+
"@atlaskit/editor-common": "^89.0.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",
|
|
@@ -117,6 +117,9 @@
|
|
|
117
117
|
},
|
|
118
118
|
"platform_editor_nested_expand_in_expand_adf_change": {
|
|
119
119
|
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"platform_editor_nest_nested_expand_drag_fix": {
|
|
122
|
+
"type": "boolean"
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
125
|
}
|