@atlaskit/editor-core 185.1.0 → 185.1.1
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 +6 -0
- package/dist/cjs/plugins/breakout/index.js +5 -6
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/breakout/index.js +5 -6
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/breakout/index.js +5 -6
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/breakout/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/breakout/types.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 185.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`63ef771aab9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/63ef771aab9) - [ux] Fix layout button. breakoutNode equals check should include position.
|
|
8
|
+
|
|
3
9
|
## 185.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -106,7 +106,7 @@ var BreakoutView = /*#__PURE__*/function () {
|
|
|
106
106
|
}();
|
|
107
107
|
function shouldPluginStateUpdate(newBreakoutNode, currentBreakoutNode) {
|
|
108
108
|
if (newBreakoutNode && currentBreakoutNode) {
|
|
109
|
-
return
|
|
109
|
+
return newBreakoutNode !== currentBreakoutNode;
|
|
110
110
|
}
|
|
111
111
|
return newBreakoutNode || currentBreakoutNode ? true : false;
|
|
112
112
|
}
|
|
@@ -121,10 +121,9 @@ function createPlugin(pluginInjectionApi, _ref2) {
|
|
|
121
121
|
},
|
|
122
122
|
apply: function apply(tr, pluginState) {
|
|
123
123
|
var breakoutNode = (0, _findBreakoutNode.findSupportedNodeForBreakout)(tr.selection);
|
|
124
|
-
|
|
125
|
-
if (shouldPluginStateUpdate(node, pluginState.breakoutNode)) {
|
|
124
|
+
if (shouldPluginStateUpdate(breakoutNode, pluginState.breakoutNode)) {
|
|
126
125
|
var nextPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
127
|
-
breakoutNode:
|
|
126
|
+
breakoutNode: breakoutNode
|
|
128
127
|
});
|
|
129
128
|
dispatch(_pluginKey.pluginKey, nextPluginState);
|
|
130
129
|
return nextPluginState;
|
|
@@ -147,7 +146,7 @@ function createPlugin(pluginInjectionApi, _ref2) {
|
|
|
147
146
|
});
|
|
148
147
|
}
|
|
149
148
|
var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
|
|
150
|
-
var _breakoutState$breako;
|
|
149
|
+
var _breakoutState$breako, _breakoutState$breako2;
|
|
151
150
|
var api = _ref3.api,
|
|
152
151
|
editorView = _ref3.editorView,
|
|
153
152
|
boundariesElement = _ref3.boundariesElement,
|
|
@@ -161,7 +160,7 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
|
|
|
161
160
|
mountPoint: mountPoint,
|
|
162
161
|
boundariesElement: boundariesElement,
|
|
163
162
|
scrollableElement: scrollableElement,
|
|
164
|
-
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : breakoutState.breakoutNode) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
163
|
+
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
165
164
|
});
|
|
166
165
|
};
|
|
167
166
|
var breakoutPlugin = function breakoutPlugin(options, api) {
|
|
@@ -64,7 +64,7 @@ function getBreakoutNodeElement(pluginState, selection, editorView) {
|
|
|
64
64
|
if (selection instanceof _prosemirrorState.NodeSelection && (0, _isSupportedNode.isSupportedNodeForBreakout)(selection.node)) {
|
|
65
65
|
return (0, _prosemirrorUtils.findDomRefAtPos)(selection.from, editorView.domAtPos.bind(editorView));
|
|
66
66
|
}
|
|
67
|
-
return (0, _prosemirrorUtils.findParentDomRefOfType)(pluginState.breakoutNode.type, editorView.domAtPos.bind(editorView))(selection);
|
|
67
|
+
return (0, _prosemirrorUtils.findParentDomRefOfType)(pluginState.breakoutNode.node.type, editorView.domAtPos.bind(editorView))(selection);
|
|
68
68
|
}
|
|
69
69
|
var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
70
70
|
(0, _inherits2.default)(LayoutButton, _React$Component);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "185.1.
|
|
9
|
+
var version = "185.1.1";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -94,7 +94,7 @@ class BreakoutView {
|
|
|
94
94
|
}
|
|
95
95
|
function shouldPluginStateUpdate(newBreakoutNode, currentBreakoutNode) {
|
|
96
96
|
if (newBreakoutNode && currentBreakoutNode) {
|
|
97
|
-
return
|
|
97
|
+
return newBreakoutNode !== currentBreakoutNode;
|
|
98
98
|
}
|
|
99
99
|
return newBreakoutNode || currentBreakoutNode ? true : false;
|
|
100
100
|
}
|
|
@@ -110,11 +110,10 @@ function createPlugin(pluginInjectionApi, {
|
|
|
110
110
|
},
|
|
111
111
|
apply(tr, pluginState) {
|
|
112
112
|
const breakoutNode = findSupportedNodeForBreakout(tr.selection);
|
|
113
|
-
|
|
114
|
-
if (shouldPluginStateUpdate(node, pluginState.breakoutNode)) {
|
|
113
|
+
if (shouldPluginStateUpdate(breakoutNode, pluginState.breakoutNode)) {
|
|
115
114
|
const nextPluginState = {
|
|
116
115
|
...pluginState,
|
|
117
|
-
breakoutNode
|
|
116
|
+
breakoutNode
|
|
118
117
|
};
|
|
119
118
|
dispatch(pluginKey, nextPluginState);
|
|
120
119
|
return nextPluginState;
|
|
@@ -143,7 +142,7 @@ const LayoutButtonWrapper = ({
|
|
|
143
142
|
scrollableElement,
|
|
144
143
|
mountPoint
|
|
145
144
|
}) => {
|
|
146
|
-
var _breakoutState$breako;
|
|
145
|
+
var _breakoutState$breako, _breakoutState$breako2;
|
|
147
146
|
// Re-render with `width` (but don't use state) due to https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/24272
|
|
148
147
|
const {
|
|
149
148
|
breakoutState
|
|
@@ -153,7 +152,7 @@ const LayoutButtonWrapper = ({
|
|
|
153
152
|
mountPoint: mountPoint,
|
|
154
153
|
boundariesElement: boundariesElement,
|
|
155
154
|
scrollableElement: scrollableElement,
|
|
156
|
-
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : breakoutState.breakoutNode) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
155
|
+
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
157
156
|
});
|
|
158
157
|
};
|
|
159
158
|
const breakoutPlugin = (options, api) => ({
|
|
@@ -56,7 +56,7 @@ function getBreakoutNodeElement(pluginState, selection, editorView) {
|
|
|
56
56
|
if (selection instanceof NodeSelection && isSupportedNodeForBreakout(selection.node)) {
|
|
57
57
|
return findDomRefAtPos(selection.from, editorView.domAtPos.bind(editorView));
|
|
58
58
|
}
|
|
59
|
-
return findParentDomRefOfType(pluginState.breakoutNode.type, editorView.domAtPos.bind(editorView))(selection);
|
|
59
|
+
return findParentDomRefOfType(pluginState.breakoutNode.node.type, editorView.domAtPos.bind(editorView))(selection);
|
|
60
60
|
}
|
|
61
61
|
class LayoutButton extends React.Component {
|
|
62
62
|
constructor(...args) {
|
package/dist/es2019/version.json
CHANGED
|
@@ -99,7 +99,7 @@ var BreakoutView = /*#__PURE__*/function () {
|
|
|
99
99
|
}();
|
|
100
100
|
function shouldPluginStateUpdate(newBreakoutNode, currentBreakoutNode) {
|
|
101
101
|
if (newBreakoutNode && currentBreakoutNode) {
|
|
102
|
-
return
|
|
102
|
+
return newBreakoutNode !== currentBreakoutNode;
|
|
103
103
|
}
|
|
104
104
|
return newBreakoutNode || currentBreakoutNode ? true : false;
|
|
105
105
|
}
|
|
@@ -114,10 +114,9 @@ function createPlugin(pluginInjectionApi, _ref2) {
|
|
|
114
114
|
},
|
|
115
115
|
apply: function apply(tr, pluginState) {
|
|
116
116
|
var breakoutNode = findSupportedNodeForBreakout(tr.selection);
|
|
117
|
-
|
|
118
|
-
if (shouldPluginStateUpdate(node, pluginState.breakoutNode)) {
|
|
117
|
+
if (shouldPluginStateUpdate(breakoutNode, pluginState.breakoutNode)) {
|
|
119
118
|
var nextPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
120
|
-
breakoutNode:
|
|
119
|
+
breakoutNode: breakoutNode
|
|
121
120
|
});
|
|
122
121
|
dispatch(pluginKey, nextPluginState);
|
|
123
122
|
return nextPluginState;
|
|
@@ -140,7 +139,7 @@ function createPlugin(pluginInjectionApi, _ref2) {
|
|
|
140
139
|
});
|
|
141
140
|
}
|
|
142
141
|
var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
|
|
143
|
-
var _breakoutState$breako;
|
|
142
|
+
var _breakoutState$breako, _breakoutState$breako2;
|
|
144
143
|
var api = _ref3.api,
|
|
145
144
|
editorView = _ref3.editorView,
|
|
146
145
|
boundariesElement = _ref3.boundariesElement,
|
|
@@ -154,7 +153,7 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
|
|
|
154
153
|
mountPoint: mountPoint,
|
|
155
154
|
boundariesElement: boundariesElement,
|
|
156
155
|
scrollableElement: scrollableElement,
|
|
157
|
-
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : breakoutState.breakoutNode) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
156
|
+
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
158
157
|
});
|
|
159
158
|
};
|
|
160
159
|
var breakoutPlugin = function breakoutPlugin(options, api) {
|
|
@@ -57,7 +57,7 @@ function getBreakoutNodeElement(pluginState, selection, editorView) {
|
|
|
57
57
|
if (selection instanceof NodeSelection && isSupportedNodeForBreakout(selection.node)) {
|
|
58
58
|
return findDomRefAtPos(selection.from, editorView.domAtPos.bind(editorView));
|
|
59
59
|
}
|
|
60
|
-
return findParentDomRefOfType(pluginState.breakoutNode.type, editorView.domAtPos.bind(editorView))(selection);
|
|
60
|
+
return findParentDomRefOfType(pluginState.breakoutNode.node.type, editorView.domAtPos.bind(editorView))(selection);
|
|
61
61
|
}
|
|
62
62
|
var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
63
63
|
_inherits(LayoutButton, _React$Component);
|
package/dist/esm/version.json
CHANGED