@atlaskit/editor-plugin-breakout 2.4.2 → 2.4.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 +12 -0
- package/dist/cjs/breakoutPlugin.js +39 -12
- package/dist/cjs/editor-commands/set-breakout-width.js +16 -1
- package/dist/cjs/pm-plugins/utils/single-player-expand.js +27 -4
- package/dist/cjs/ui/LayoutButton.js +7 -3
- package/dist/es2019/breakoutPlugin.js +23 -4
- package/dist/es2019/editor-commands/set-breakout-width.js +16 -1
- package/dist/es2019/pm-plugins/utils/single-player-expand.js +27 -3
- package/dist/es2019/ui/LayoutButton.js +7 -3
- package/dist/esm/breakoutPlugin.js +37 -12
- package/dist/esm/editor-commands/set-breakout-width.js +16 -1
- package/dist/esm/pm-plugins/utils/single-player-expand.js +26 -3
- package/dist/esm/ui/LayoutButton.js +7 -3
- package/dist/types/pm-plugins/utils/single-player-expand.d.ts +9 -0
- package/dist/types/ui/LayoutButton.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/single-player-expand.d.ts +9 -0
- package/dist/types-ts4.5/ui/LayoutButton.d.ts +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-breakout
|
|
2
2
|
|
|
3
|
+
## 2.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#163965](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/163965)
|
|
8
|
+
[`c08b8e623a378`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c08b8e623a378) -
|
|
9
|
+
[ED-28046] Reduce the number of times the layout button re-renders
|
|
10
|
+
- [#164762](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164762)
|
|
11
|
+
[`e716071496267`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e716071496267) -
|
|
12
|
+
[ux] Fix for expands and codeblocks so they keep their settings after resize.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 2.4.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.breakoutPlugin = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _react =
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
14
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
15
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
16
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
15
17
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
18
|
+
var _usePluginStateEffect = require("@atlaskit/editor-common/use-plugin-state-effect");
|
|
16
19
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
17
20
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -20,7 +23,9 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
|
20
23
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
21
24
|
var _resizingPlugin = require("./pm-plugins/resizing-plugin");
|
|
22
25
|
var _findBreakoutNode = require("./pm-plugins/utils/find-breakout-node");
|
|
26
|
+
var _getBreakoutMode = require("./pm-plugins/utils/get-breakout-mode");
|
|
23
27
|
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
29
|
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; }
|
|
25
30
|
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; }
|
|
26
31
|
var BreakoutView = /*#__PURE__*/(0, _createClass2.default)(function BreakoutView(
|
|
@@ -126,13 +131,12 @@ var useOldHook = function useOldHook(api) {
|
|
|
126
131
|
};
|
|
127
132
|
};
|
|
128
133
|
var useNewHook = function useNewHook(api) {
|
|
129
|
-
var breakoutNode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'breakout.breakoutNode');
|
|
130
134
|
var isDragging = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockControls.isDragging');
|
|
131
135
|
var isPMDragging = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockControls.isPMDragging');
|
|
132
136
|
var mode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
|
|
133
137
|
var editorDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorDisabled.editorDisabled');
|
|
134
138
|
return {
|
|
135
|
-
breakoutNode:
|
|
139
|
+
breakoutNode: undefined,
|
|
136
140
|
isDragging: isDragging,
|
|
137
141
|
isPMDragging: isPMDragging,
|
|
138
142
|
mode: mode,
|
|
@@ -153,6 +157,27 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
153
157
|
isPMDragging = _useSharedState.isPMDragging,
|
|
154
158
|
mode = _useSharedState.mode,
|
|
155
159
|
editorDisabled = _useSharedState.editorDisabled;
|
|
160
|
+
var _useState = (0, _react.useState)(false),
|
|
161
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
162
|
+
breakoutNodePresent = _useState2[0],
|
|
163
|
+
setBreakoutNodePresent = _useState2[1];
|
|
164
|
+
var _useState3 = (0, _react.useState)((0, _getBreakoutMode.getBreakoutMode)(editorView.state)),
|
|
165
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
166
|
+
breakoutMode = _useState4[0],
|
|
167
|
+
setBreakoutMode = _useState4[1];
|
|
168
|
+
(0, _usePluginStateEffect.usePluginStateEffect)(api, ['breakout'], function (_ref3) {
|
|
169
|
+
var breakoutState = _ref3.breakoutState;
|
|
170
|
+
if (breakoutState !== null && breakoutState !== void 0 && breakoutState.breakoutNode && !breakoutNodePresent) {
|
|
171
|
+
setBreakoutNodePresent(true);
|
|
172
|
+
}
|
|
173
|
+
if (!(breakoutState !== null && breakoutState !== void 0 && breakoutState.breakoutNode) && breakoutNodePresent) {
|
|
174
|
+
setBreakoutNodePresent(false);
|
|
175
|
+
}
|
|
176
|
+
var nextBreakoutMode = (0, _getBreakoutMode.getBreakoutMode)(editorView.state);
|
|
177
|
+
if (nextBreakoutMode !== breakoutMode) {
|
|
178
|
+
setBreakoutMode(nextBreakoutMode);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
156
181
|
var interactionState = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'interaction.interactionState');
|
|
157
182
|
if (interactionState === 'hasNotHadInteraction' && (0, _platformFeatureFlags.fg)('platform_editor_hide_expand_selection_states')) {
|
|
158
183
|
return null;
|
|
@@ -170,12 +195,14 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
170
195
|
boundariesElement: boundariesElement,
|
|
171
196
|
scrollableElement: scrollableElement,
|
|
172
197
|
node: (_breakoutNode$node = breakoutNode === null || breakoutNode === void 0 ? void 0 : breakoutNode.node) !== null && _breakoutNode$node !== void 0 ? _breakoutNode$node : null,
|
|
173
|
-
isLivePage: isEditMode
|
|
198
|
+
isLivePage: isEditMode,
|
|
199
|
+
isBreakoutNodePresent: breakoutNodePresent,
|
|
200
|
+
breakoutMode: breakoutMode
|
|
174
201
|
}) : null;
|
|
175
202
|
};
|
|
176
|
-
var breakoutPlugin = exports.breakoutPlugin = function breakoutPlugin(
|
|
177
|
-
var options =
|
|
178
|
-
api =
|
|
203
|
+
var breakoutPlugin = exports.breakoutPlugin = function breakoutPlugin(_ref4) {
|
|
204
|
+
var options = _ref4.config,
|
|
205
|
+
api = _ref4.api;
|
|
179
206
|
return {
|
|
180
207
|
name: 'breakout',
|
|
181
208
|
pmPlugins: function pmPlugins() {
|
|
@@ -214,11 +241,11 @@ var breakoutPlugin = exports.breakoutPlugin = function breakoutPlugin(_ref3) {
|
|
|
214
241
|
}
|
|
215
242
|
return pluginState;
|
|
216
243
|
},
|
|
217
|
-
contentComponent: function contentComponent(
|
|
218
|
-
var editorView =
|
|
219
|
-
popupsMountPoint =
|
|
220
|
-
popupsBoundariesElement =
|
|
221
|
-
popupsScrollableElement =
|
|
244
|
+
contentComponent: function contentComponent(_ref5) {
|
|
245
|
+
var editorView = _ref5.editorView,
|
|
246
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
247
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
248
|
+
popupsScrollableElement = _ref5.popupsScrollableElement;
|
|
222
249
|
// This is a bit crappy, but should be resolved once we move to a static schema.
|
|
223
250
|
if (options && !options.allowBreakoutButton) {
|
|
224
251
|
return null;
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.setBreakoutWidth = setBreakoutWidth;
|
|
7
|
-
|
|
7
|
+
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
8
|
+
var _singlePlayerExpand = require("../pm-plugins/utils/single-player-expand");
|
|
8
9
|
function setBreakoutWidth(width, mode, pos, isLivePage) {
|
|
9
10
|
return function (state, dispatch) {
|
|
10
11
|
var node = state.doc.nodeAt(pos);
|
|
@@ -15,6 +16,20 @@ function setBreakoutWidth(width, mode, pos, isLivePage) {
|
|
|
15
16
|
width: width,
|
|
16
17
|
mode: mode
|
|
17
18
|
})]);
|
|
19
|
+
if (node.type === state.schema.nodes.expand) {
|
|
20
|
+
(0, _singlePlayerExpand.updateExpandedStateNew)({
|
|
21
|
+
tr: tr,
|
|
22
|
+
node: node,
|
|
23
|
+
pos: pos,
|
|
24
|
+
isLivePage: isLivePage
|
|
25
|
+
});
|
|
26
|
+
} else if (node.type === state.schema.nodes.codeBlock) {
|
|
27
|
+
var newNode = tr.doc.nodeAt(pos);
|
|
28
|
+
var oldNode = node;
|
|
29
|
+
if (newNode) {
|
|
30
|
+
(0, _codeBlock.transferCodeBlockWrappedValue)(oldNode, newNode);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
18
33
|
if (dispatch) {
|
|
19
34
|
dispatch(tr);
|
|
20
35
|
}
|
|
@@ -3,15 +3,38 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.updateExpandedState = void 0;
|
|
6
|
+
exports.updateExpandedStateNew = exports.updateExpandedState = void 0;
|
|
7
7
|
var _expand = require("@atlaskit/editor-common/expand");
|
|
8
8
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
-
var
|
|
9
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
|
+
var updateExpandedStateNew = exports.updateExpandedStateNew = function updateExpandedStateNew(_ref) {
|
|
11
|
+
var tr = _ref.tr,
|
|
12
|
+
node = _ref.node,
|
|
13
|
+
pos = _ref.pos,
|
|
14
|
+
isLivePage = _ref.isLivePage;
|
|
10
15
|
if (isLivePage || (0, _platformFeatureFlags.fg)('platform-editor-single-player-expand')) {
|
|
11
|
-
var wasExpandExpanded = _expand.expandedState.get(node
|
|
12
|
-
var newExpand = tr.doc.nodeAt(
|
|
16
|
+
var wasExpandExpanded = _expand.expandedState.get(node);
|
|
17
|
+
var newExpand = tr.doc.nodeAt(pos);
|
|
13
18
|
if (wasExpandExpanded !== undefined && newExpand) {
|
|
14
19
|
_expand.expandedState.set(newExpand, wasExpandExpanded);
|
|
15
20
|
}
|
|
16
21
|
}
|
|
22
|
+
};
|
|
23
|
+
var updateExpandedState = exports.updateExpandedState = function updateExpandedState(tr, node, isLivePage) {
|
|
24
|
+
if ((0, _experiments.editorExperiment)('platform_editor_breakout_resizing', true)) {
|
|
25
|
+
updateExpandedStateNew({
|
|
26
|
+
tr: tr,
|
|
27
|
+
node: node.node,
|
|
28
|
+
pos: node.pos,
|
|
29
|
+
isLivePage: isLivePage
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
if (isLivePage || (0, _platformFeatureFlags.fg)('platform-editor-single-player-expand')) {
|
|
33
|
+
var wasExpandExpanded = _expand.expandedState.get(node.node);
|
|
34
|
+
var newExpand = tr.doc.nodeAt(node.pos);
|
|
35
|
+
if (wasExpandExpanded !== undefined && newExpand) {
|
|
36
|
+
_expand.expandedState.set(newExpand, wasExpandExpanded);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
17
40
|
};
|
|
@@ -20,6 +20,7 @@ var _collapse = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/coll
|
|
|
20
20
|
var _expand = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/expand"));
|
|
21
21
|
var _colors = require("@atlaskit/theme/colors");
|
|
22
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
23
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
24
|
var _removeBreakout = require("../editor-commands/remove-breakout");
|
|
24
25
|
var _setBreakoutMode = require("../editor-commands/set-breakout-mode");
|
|
25
26
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -66,7 +67,9 @@ var LayoutButton = function LayoutButton(_ref) {
|
|
|
66
67
|
scrollableElement = _ref.scrollableElement,
|
|
67
68
|
editorView = _ref.editorView,
|
|
68
69
|
node = _ref.node,
|
|
69
|
-
isLivePage = _ref.isLivePage
|
|
70
|
+
isLivePage = _ref.isLivePage,
|
|
71
|
+
isBreakoutNodePresent = _ref.isBreakoutNodePresent,
|
|
72
|
+
breakoutModeProp = _ref.breakoutMode;
|
|
70
73
|
var handleClick = (0, _react.useCallback)(function (breakoutMode) {
|
|
71
74
|
var state = editorView.state,
|
|
72
75
|
dispatch = editorView.dispatch;
|
|
@@ -77,10 +80,11 @@ var LayoutButton = function LayoutButton(_ref) {
|
|
|
77
80
|
}
|
|
78
81
|
}, [editorView, isLivePage]);
|
|
79
82
|
var state = editorView.state;
|
|
80
|
-
|
|
83
|
+
var exitCondition = (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', true) ? !isBreakoutNodePresent : !node;
|
|
84
|
+
if (exitCondition || !(0, _isBreakoutMarkAllowed.isBreakoutMarkAllowed)(state)) {
|
|
81
85
|
return null;
|
|
82
86
|
}
|
|
83
|
-
var breakoutMode = (0, _getBreakoutMode.getBreakoutMode)(editorView.state);
|
|
87
|
+
var breakoutMode = (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', true) ? breakoutModeProp : (0, _getBreakoutMode.getBreakoutMode)(editorView.state);
|
|
84
88
|
var titleMessage = (0, _utils.getTitle)(breakoutMode);
|
|
85
89
|
var title = formatMessage(titleMessage);
|
|
86
90
|
var nextBreakoutMode = (0, _utils.getNextBreakoutMode)(breakoutMode);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { breakout } from '@atlaskit/adf-schema';
|
|
3
3
|
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
|
+
import { usePluginStateEffect } from '@atlaskit/editor-common/use-plugin-state-effect';
|
|
6
7
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
8
|
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -10,6 +11,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
10
11
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
11
12
|
import { createResizingPlugin } from './pm-plugins/resizing-plugin';
|
|
12
13
|
import { findSupportedNodeForBreakout } from './pm-plugins/utils/find-breakout-node';
|
|
14
|
+
import { getBreakoutMode } from './pm-plugins/utils/get-breakout-mode';
|
|
13
15
|
import LayoutButton from './ui/LayoutButton';
|
|
14
16
|
class BreakoutView {
|
|
15
17
|
constructor(
|
|
@@ -118,13 +120,12 @@ const useOldHook = api => {
|
|
|
118
120
|
};
|
|
119
121
|
};
|
|
120
122
|
const useNewHook = api => {
|
|
121
|
-
const breakoutNode = useSharedPluginStateSelector(api, 'breakout.breakoutNode');
|
|
122
123
|
const isDragging = useSharedPluginStateSelector(api, 'blockControls.isDragging');
|
|
123
124
|
const isPMDragging = useSharedPluginStateSelector(api, 'blockControls.isPMDragging');
|
|
124
125
|
const mode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
125
126
|
const editorDisabled = useSharedPluginStateSelector(api, 'editorDisabled.editorDisabled');
|
|
126
127
|
return {
|
|
127
|
-
breakoutNode,
|
|
128
|
+
breakoutNode: undefined,
|
|
128
129
|
isDragging,
|
|
129
130
|
isPMDragging,
|
|
130
131
|
mode,
|
|
@@ -147,6 +148,22 @@ const LayoutButtonWrapper = ({
|
|
|
147
148
|
mode,
|
|
148
149
|
editorDisabled
|
|
149
150
|
} = useSharedState(api);
|
|
151
|
+
const [breakoutNodePresent, setBreakoutNodePresent] = useState(false);
|
|
152
|
+
const [breakoutMode, setBreakoutMode] = useState(getBreakoutMode(editorView.state));
|
|
153
|
+
usePluginStateEffect(api, ['breakout'], ({
|
|
154
|
+
breakoutState
|
|
155
|
+
}) => {
|
|
156
|
+
if (breakoutState !== null && breakoutState !== void 0 && breakoutState.breakoutNode && !breakoutNodePresent) {
|
|
157
|
+
setBreakoutNodePresent(true);
|
|
158
|
+
}
|
|
159
|
+
if (!(breakoutState !== null && breakoutState !== void 0 && breakoutState.breakoutNode) && breakoutNodePresent) {
|
|
160
|
+
setBreakoutNodePresent(false);
|
|
161
|
+
}
|
|
162
|
+
const nextBreakoutMode = getBreakoutMode(editorView.state);
|
|
163
|
+
if (nextBreakoutMode !== breakoutMode) {
|
|
164
|
+
setBreakoutMode(nextBreakoutMode);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
150
167
|
const interactionState = useSharedPluginStateSelector(api, 'interaction.interactionState');
|
|
151
168
|
if (interactionState === 'hasNotHadInteraction' && fg('platform_editor_hide_expand_selection_states')) {
|
|
152
169
|
return null;
|
|
@@ -164,7 +181,9 @@ const LayoutButtonWrapper = ({
|
|
|
164
181
|
boundariesElement: boundariesElement,
|
|
165
182
|
scrollableElement: scrollableElement,
|
|
166
183
|
node: (_breakoutNode$node = breakoutNode === null || breakoutNode === void 0 ? void 0 : breakoutNode.node) !== null && _breakoutNode$node !== void 0 ? _breakoutNode$node : null,
|
|
167
|
-
isLivePage: isEditMode
|
|
184
|
+
isLivePage: isEditMode,
|
|
185
|
+
isBreakoutNodePresent: breakoutNodePresent,
|
|
186
|
+
breakoutMode: breakoutMode
|
|
168
187
|
}) : null;
|
|
169
188
|
};
|
|
170
189
|
export const breakoutPlugin = ({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
|
|
2
|
+
import { updateExpandedStateNew } from '../pm-plugins/utils/single-player-expand';
|
|
2
3
|
export function setBreakoutWidth(width, mode, pos, isLivePage) {
|
|
3
4
|
return (state, dispatch) => {
|
|
4
5
|
const node = state.doc.nodeAt(pos);
|
|
@@ -9,6 +10,20 @@ export function setBreakoutWidth(width, mode, pos, isLivePage) {
|
|
|
9
10
|
width,
|
|
10
11
|
mode
|
|
11
12
|
})]);
|
|
13
|
+
if (node.type === state.schema.nodes.expand) {
|
|
14
|
+
updateExpandedStateNew({
|
|
15
|
+
tr,
|
|
16
|
+
node,
|
|
17
|
+
pos,
|
|
18
|
+
isLivePage
|
|
19
|
+
});
|
|
20
|
+
} else if (node.type === state.schema.nodes.codeBlock) {
|
|
21
|
+
const newNode = tr.doc.nodeAt(pos);
|
|
22
|
+
const oldNode = node;
|
|
23
|
+
if (newNode) {
|
|
24
|
+
transferCodeBlockWrappedValue(oldNode, newNode);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
12
27
|
if (dispatch) {
|
|
13
28
|
dispatch(tr);
|
|
14
29
|
}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
|
+
export const updateExpandedStateNew = ({
|
|
5
|
+
tr,
|
|
6
|
+
node,
|
|
7
|
+
pos,
|
|
8
|
+
isLivePage
|
|
9
|
+
}) => {
|
|
4
10
|
if (isLivePage || fg('platform-editor-single-player-expand')) {
|
|
5
|
-
const wasExpandExpanded = expandedState.get(node
|
|
6
|
-
const newExpand = tr.doc.nodeAt(
|
|
11
|
+
const wasExpandExpanded = expandedState.get(node);
|
|
12
|
+
const newExpand = tr.doc.nodeAt(pos);
|
|
7
13
|
if (wasExpandExpanded !== undefined && newExpand) {
|
|
8
14
|
expandedState.set(newExpand, wasExpandExpanded);
|
|
9
15
|
}
|
|
10
16
|
}
|
|
17
|
+
};
|
|
18
|
+
export const updateExpandedState = (tr, node, isLivePage) => {
|
|
19
|
+
if (editorExperiment('platform_editor_breakout_resizing', true)) {
|
|
20
|
+
updateExpandedStateNew({
|
|
21
|
+
tr,
|
|
22
|
+
node: node.node,
|
|
23
|
+
pos: node.pos,
|
|
24
|
+
isLivePage
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
if (isLivePage || fg('platform-editor-single-player-expand')) {
|
|
28
|
+
const wasExpandExpanded = expandedState.get(node.node);
|
|
29
|
+
const newExpand = tr.doc.nodeAt(node.pos);
|
|
30
|
+
if (wasExpandExpanded !== undefined && newExpand) {
|
|
31
|
+
expandedState.set(newExpand, wasExpandExpanded);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
11
35
|
};
|
|
@@ -19,6 +19,7 @@ import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
|
|
|
19
19
|
import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
20
20
|
import { B300, N20A, N300 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { layers } from '@atlaskit/theme/constants';
|
|
22
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
23
|
import { removeBreakout } from '../editor-commands/remove-breakout';
|
|
23
24
|
import { setBreakoutMode } from '../editor-commands/set-breakout-mode';
|
|
24
25
|
import { getPluginState } from '../pm-plugins/plugin-key';
|
|
@@ -60,7 +61,9 @@ const LayoutButton = ({
|
|
|
60
61
|
scrollableElement,
|
|
61
62
|
editorView,
|
|
62
63
|
node,
|
|
63
|
-
isLivePage
|
|
64
|
+
isLivePage,
|
|
65
|
+
isBreakoutNodePresent,
|
|
66
|
+
breakoutMode: breakoutModeProp
|
|
64
67
|
}) => {
|
|
65
68
|
const handleClick = useCallback(breakoutMode => {
|
|
66
69
|
const {
|
|
@@ -76,10 +79,11 @@ const LayoutButton = ({
|
|
|
76
79
|
const {
|
|
77
80
|
state
|
|
78
81
|
} = editorView;
|
|
79
|
-
|
|
82
|
+
const exitCondition = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? !isBreakoutNodePresent : !node;
|
|
83
|
+
if (exitCondition || !isBreakoutMarkAllowed(state)) {
|
|
80
84
|
return null;
|
|
81
85
|
}
|
|
82
|
-
const breakoutMode = getBreakoutMode(editorView.state);
|
|
86
|
+
const breakoutMode = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? breakoutModeProp : getBreakoutMode(editorView.state);
|
|
83
87
|
const titleMessage = getTitle(breakoutMode);
|
|
84
88
|
const title = formatMessage(titleMessage);
|
|
85
89
|
const nextBreakoutMode = getNextBreakoutMode(breakoutMode);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
5
|
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; }
|
|
5
6
|
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; }
|
|
6
|
-
import React from 'react';
|
|
7
|
+
import React, { useState } from 'react';
|
|
7
8
|
import { breakout } from '@atlaskit/adf-schema';
|
|
8
9
|
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
9
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
10
11
|
import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
|
|
12
|
+
import { usePluginStateEffect } from '@atlaskit/editor-common/use-plugin-state-effect';
|
|
11
13
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
12
14
|
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
13
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -15,6 +17,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
15
17
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
16
18
|
import { createResizingPlugin } from './pm-plugins/resizing-plugin';
|
|
17
19
|
import { findSupportedNodeForBreakout } from './pm-plugins/utils/find-breakout-node';
|
|
20
|
+
import { getBreakoutMode } from './pm-plugins/utils/get-breakout-mode';
|
|
18
21
|
import LayoutButton from './ui/LayoutButton';
|
|
19
22
|
var BreakoutView = /*#__PURE__*/_createClass(function BreakoutView(
|
|
20
23
|
/**
|
|
@@ -119,13 +122,12 @@ var useOldHook = function useOldHook(api) {
|
|
|
119
122
|
};
|
|
120
123
|
};
|
|
121
124
|
var useNewHook = function useNewHook(api) {
|
|
122
|
-
var breakoutNode = useSharedPluginStateSelector(api, 'breakout.breakoutNode');
|
|
123
125
|
var isDragging = useSharedPluginStateSelector(api, 'blockControls.isDragging');
|
|
124
126
|
var isPMDragging = useSharedPluginStateSelector(api, 'blockControls.isPMDragging');
|
|
125
127
|
var mode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
126
128
|
var editorDisabled = useSharedPluginStateSelector(api, 'editorDisabled.editorDisabled');
|
|
127
129
|
return {
|
|
128
|
-
breakoutNode:
|
|
130
|
+
breakoutNode: undefined,
|
|
129
131
|
isDragging: isDragging,
|
|
130
132
|
isPMDragging: isPMDragging,
|
|
131
133
|
mode: mode,
|
|
@@ -146,6 +148,27 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
146
148
|
isPMDragging = _useSharedState.isPMDragging,
|
|
147
149
|
mode = _useSharedState.mode,
|
|
148
150
|
editorDisabled = _useSharedState.editorDisabled;
|
|
151
|
+
var _useState = useState(false),
|
|
152
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
153
|
+
breakoutNodePresent = _useState2[0],
|
|
154
|
+
setBreakoutNodePresent = _useState2[1];
|
|
155
|
+
var _useState3 = useState(getBreakoutMode(editorView.state)),
|
|
156
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
157
|
+
breakoutMode = _useState4[0],
|
|
158
|
+
setBreakoutMode = _useState4[1];
|
|
159
|
+
usePluginStateEffect(api, ['breakout'], function (_ref3) {
|
|
160
|
+
var breakoutState = _ref3.breakoutState;
|
|
161
|
+
if (breakoutState !== null && breakoutState !== void 0 && breakoutState.breakoutNode && !breakoutNodePresent) {
|
|
162
|
+
setBreakoutNodePresent(true);
|
|
163
|
+
}
|
|
164
|
+
if (!(breakoutState !== null && breakoutState !== void 0 && breakoutState.breakoutNode) && breakoutNodePresent) {
|
|
165
|
+
setBreakoutNodePresent(false);
|
|
166
|
+
}
|
|
167
|
+
var nextBreakoutMode = getBreakoutMode(editorView.state);
|
|
168
|
+
if (nextBreakoutMode !== breakoutMode) {
|
|
169
|
+
setBreakoutMode(nextBreakoutMode);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
149
172
|
var interactionState = useSharedPluginStateSelector(api, 'interaction.interactionState');
|
|
150
173
|
if (interactionState === 'hasNotHadInteraction' && fg('platform_editor_hide_expand_selection_states')) {
|
|
151
174
|
return null;
|
|
@@ -163,12 +186,14 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
163
186
|
boundariesElement: boundariesElement,
|
|
164
187
|
scrollableElement: scrollableElement,
|
|
165
188
|
node: (_breakoutNode$node = breakoutNode === null || breakoutNode === void 0 ? void 0 : breakoutNode.node) !== null && _breakoutNode$node !== void 0 ? _breakoutNode$node : null,
|
|
166
|
-
isLivePage: isEditMode
|
|
189
|
+
isLivePage: isEditMode,
|
|
190
|
+
isBreakoutNodePresent: breakoutNodePresent,
|
|
191
|
+
breakoutMode: breakoutMode
|
|
167
192
|
}) : null;
|
|
168
193
|
};
|
|
169
|
-
export var breakoutPlugin = function breakoutPlugin(
|
|
170
|
-
var options =
|
|
171
|
-
api =
|
|
194
|
+
export var breakoutPlugin = function breakoutPlugin(_ref4) {
|
|
195
|
+
var options = _ref4.config,
|
|
196
|
+
api = _ref4.api;
|
|
172
197
|
return {
|
|
173
198
|
name: 'breakout',
|
|
174
199
|
pmPlugins: function pmPlugins() {
|
|
@@ -207,11 +232,11 @@ export var breakoutPlugin = function breakoutPlugin(_ref3) {
|
|
|
207
232
|
}
|
|
208
233
|
return pluginState;
|
|
209
234
|
},
|
|
210
|
-
contentComponent: function contentComponent(
|
|
211
|
-
var editorView =
|
|
212
|
-
popupsMountPoint =
|
|
213
|
-
popupsBoundariesElement =
|
|
214
|
-
popupsScrollableElement =
|
|
235
|
+
contentComponent: function contentComponent(_ref5) {
|
|
236
|
+
var editorView = _ref5.editorView,
|
|
237
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
238
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
239
|
+
popupsScrollableElement = _ref5.popupsScrollableElement;
|
|
215
240
|
// This is a bit crappy, but should be resolved once we move to a static schema.
|
|
216
241
|
if (options && !options.allowBreakoutButton) {
|
|
217
242
|
return null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
|
|
2
|
+
import { updateExpandedStateNew } from '../pm-plugins/utils/single-player-expand';
|
|
2
3
|
export function setBreakoutWidth(width, mode, pos, isLivePage) {
|
|
3
4
|
return function (state, dispatch) {
|
|
4
5
|
var node = state.doc.nodeAt(pos);
|
|
@@ -9,6 +10,20 @@ export function setBreakoutWidth(width, mode, pos, isLivePage) {
|
|
|
9
10
|
width: width,
|
|
10
11
|
mode: mode
|
|
11
12
|
})]);
|
|
13
|
+
if (node.type === state.schema.nodes.expand) {
|
|
14
|
+
updateExpandedStateNew({
|
|
15
|
+
tr: tr,
|
|
16
|
+
node: node,
|
|
17
|
+
pos: pos,
|
|
18
|
+
isLivePage: isLivePage
|
|
19
|
+
});
|
|
20
|
+
} else if (node.type === state.schema.nodes.codeBlock) {
|
|
21
|
+
var newNode = tr.doc.nodeAt(pos);
|
|
22
|
+
var oldNode = node;
|
|
23
|
+
if (newNode) {
|
|
24
|
+
transferCodeBlockWrappedValue(oldNode, newNode);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
12
27
|
if (dispatch) {
|
|
13
28
|
dispatch(tr);
|
|
14
29
|
}
|
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
|
+
export var updateExpandedStateNew = function updateExpandedStateNew(_ref) {
|
|
5
|
+
var tr = _ref.tr,
|
|
6
|
+
node = _ref.node,
|
|
7
|
+
pos = _ref.pos,
|
|
8
|
+
isLivePage = _ref.isLivePage;
|
|
4
9
|
if (isLivePage || fg('platform-editor-single-player-expand')) {
|
|
5
|
-
var wasExpandExpanded = expandedState.get(node
|
|
6
|
-
var newExpand = tr.doc.nodeAt(
|
|
10
|
+
var wasExpandExpanded = expandedState.get(node);
|
|
11
|
+
var newExpand = tr.doc.nodeAt(pos);
|
|
7
12
|
if (wasExpandExpanded !== undefined && newExpand) {
|
|
8
13
|
expandedState.set(newExpand, wasExpandExpanded);
|
|
9
14
|
}
|
|
10
15
|
}
|
|
16
|
+
};
|
|
17
|
+
export var updateExpandedState = function updateExpandedState(tr, node, isLivePage) {
|
|
18
|
+
if (editorExperiment('platform_editor_breakout_resizing', true)) {
|
|
19
|
+
updateExpandedStateNew({
|
|
20
|
+
tr: tr,
|
|
21
|
+
node: node.node,
|
|
22
|
+
pos: node.pos,
|
|
23
|
+
isLivePage: isLivePage
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
if (isLivePage || fg('platform-editor-single-player-expand')) {
|
|
27
|
+
var wasExpandExpanded = expandedState.get(node.node);
|
|
28
|
+
var newExpand = tr.doc.nodeAt(node.pos);
|
|
29
|
+
if (wasExpandExpanded !== undefined && newExpand) {
|
|
30
|
+
expandedState.set(newExpand, wasExpandExpanded);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
};
|
|
@@ -19,6 +19,7 @@ import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
|
|
|
19
19
|
import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
20
20
|
import { B300, N20A, N300 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { layers } from '@atlaskit/theme/constants';
|
|
22
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
23
|
import { removeBreakout } from '../editor-commands/remove-breakout';
|
|
23
24
|
import { setBreakoutMode } from '../editor-commands/set-breakout-mode';
|
|
24
25
|
import { getPluginState } from '../pm-plugins/plugin-key';
|
|
@@ -58,7 +59,9 @@ var LayoutButton = function LayoutButton(_ref) {
|
|
|
58
59
|
scrollableElement = _ref.scrollableElement,
|
|
59
60
|
editorView = _ref.editorView,
|
|
60
61
|
node = _ref.node,
|
|
61
|
-
isLivePage = _ref.isLivePage
|
|
62
|
+
isLivePage = _ref.isLivePage,
|
|
63
|
+
isBreakoutNodePresent = _ref.isBreakoutNodePresent,
|
|
64
|
+
breakoutModeProp = _ref.breakoutMode;
|
|
62
65
|
var handleClick = useCallback(function (breakoutMode) {
|
|
63
66
|
var state = editorView.state,
|
|
64
67
|
dispatch = editorView.dispatch;
|
|
@@ -69,10 +72,11 @@ var LayoutButton = function LayoutButton(_ref) {
|
|
|
69
72
|
}
|
|
70
73
|
}, [editorView, isLivePage]);
|
|
71
74
|
var state = editorView.state;
|
|
72
|
-
|
|
75
|
+
var exitCondition = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? !isBreakoutNodePresent : !node;
|
|
76
|
+
if (exitCondition || !isBreakoutMarkAllowed(state)) {
|
|
73
77
|
return null;
|
|
74
78
|
}
|
|
75
|
-
var breakoutMode = getBreakoutMode(editorView.state);
|
|
79
|
+
var breakoutMode = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? breakoutModeProp : getBreakoutMode(editorView.state);
|
|
76
80
|
var titleMessage = getTitle(breakoutMode);
|
|
77
81
|
var title = formatMessage(titleMessage);
|
|
78
82
|
var nextBreakoutMode = getNextBreakoutMode(breakoutMode);
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
1
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
interface UpdateExpandedStateNew {
|
|
5
|
+
tr: Transaction;
|
|
6
|
+
node: PMNode;
|
|
7
|
+
pos: number;
|
|
8
|
+
isLivePage?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const updateExpandedStateNew: ({ tr, node, pos, isLivePage }: UpdateExpandedStateNew) => void;
|
|
3
11
|
export declare const updateExpandedState: (tr: Transaction, node: ContentNodeWithPos, isLivePage?: boolean) => void;
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { BreakoutMode } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
export interface Props {
|
|
@@ -10,6 +11,8 @@ export interface Props {
|
|
|
10
11
|
scrollableElement?: HTMLElement;
|
|
11
12
|
handleClick?: Function;
|
|
12
13
|
isLivePage?: boolean;
|
|
14
|
+
isBreakoutNodePresent: boolean;
|
|
15
|
+
breakoutMode: BreakoutMode | undefined;
|
|
13
16
|
}
|
|
14
17
|
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
15
18
|
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
1
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
interface UpdateExpandedStateNew {
|
|
5
|
+
tr: Transaction;
|
|
6
|
+
node: PMNode;
|
|
7
|
+
pos: number;
|
|
8
|
+
isLivePage?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const updateExpandedStateNew: ({ tr, node, pos, isLivePage }: UpdateExpandedStateNew) => void;
|
|
3
11
|
export declare const updateExpandedState: (tr: Transaction, node: ContentNodeWithPos, isLivePage?: boolean) => void;
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { BreakoutMode } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
6
|
export interface Props {
|
|
@@ -10,6 +11,8 @@ export interface Props {
|
|
|
10
11
|
scrollableElement?: HTMLElement;
|
|
11
12
|
handleClick?: Function;
|
|
12
13
|
isLivePage?: boolean;
|
|
14
|
+
isBreakoutNodePresent: boolean;
|
|
15
|
+
breakoutMode: BreakoutMode | undefined;
|
|
13
16
|
}
|
|
14
17
|
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
15
18
|
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
50
50
|
"@atlaskit/theme": "^18.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^5.8.0",
|
|
52
52
|
"@atlaskit/tokens": "^5.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1"
|