@atlaskit/editor-plugin-layout 10.3.0 → 10.3.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 +9 -0
- package/dist/cjs/layoutPlugin.js +16 -13
- package/dist/es2019/layoutPlugin.js +5 -1
- package/dist/esm/layoutPlugin.js +16 -13
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-layout
|
|
2
2
|
|
|
3
|
+
## 10.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4c22fe79f104e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4c22fe79f104e) -
|
|
8
|
+
Guard against undefined plugin state when reading shared state in floating-toolbar handler
|
|
9
|
+
(layout) and useEffect deps array (block-controls drag handle); fixes intermittent crash during
|
|
10
|
+
editor reconfigure / partial-preset transitions.
|
|
11
|
+
|
|
3
12
|
## 10.3.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/cjs/layoutPlugin.js
CHANGED
|
@@ -121,20 +121,23 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
121
121
|
},
|
|
122
122
|
pluginsOptions: {
|
|
123
123
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
var layoutState = _pluginKey.pluginKey.getState(state);
|
|
125
|
+
if (!layoutState) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
var pos = layoutState.pos,
|
|
129
|
+
allowBreakout = layoutState.allowBreakout,
|
|
130
|
+
addSidebarLayouts = layoutState.addSidebarLayouts,
|
|
131
|
+
allowSingleColumnLayout = layoutState.allowSingleColumnLayout,
|
|
132
|
+
isResizing = layoutState.isResizing;
|
|
130
133
|
var shouldHideToolbar = isResizing && (0, _experiments.editorExperiment)('single_column_layouts', true);
|
|
131
134
|
if (pos !== null && !shouldHideToolbar) {
|
|
132
135
|
return (0, _toolbar.buildToolbar)(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, allowAdvancedSingleColumnLayout, api);
|
|
133
136
|
}
|
|
134
137
|
return undefined;
|
|
135
138
|
},
|
|
136
|
-
quickInsert: function quickInsert(
|
|
137
|
-
var formatMessage =
|
|
139
|
+
quickInsert: function quickInsert(_ref3) {
|
|
140
|
+
var formatMessage = _ref3.formatMessage;
|
|
138
141
|
var withInsertLayoutAnalytics = function withInsertLayoutAnalytics(tr, columnCount) {
|
|
139
142
|
var _api$analytics2;
|
|
140
143
|
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.actions) === null || _api$analytics2 === void 0 || _api$analytics2.attachAnalyticsEvent({
|
|
@@ -283,11 +286,11 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
283
286
|
}
|
|
284
287
|
}
|
|
285
288
|
},
|
|
286
|
-
contentComponent: function contentComponent(
|
|
287
|
-
var editorView =
|
|
288
|
-
popupsMountPoint =
|
|
289
|
-
popupsBoundariesElement =
|
|
290
|
-
popupsScrollableElement =
|
|
289
|
+
contentComponent: function contentComponent(_ref4) {
|
|
290
|
+
var editorView = _ref4.editorView,
|
|
291
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
292
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
293
|
+
popupsScrollableElement = _ref4.popupsScrollableElement;
|
|
291
294
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _experiments.editorExperiment)('advanced_layouts', true) ? /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, null) : null, (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_layout_column_menu', 'isEnabled', true) && editorView ? /*#__PURE__*/_react.default.createElement(_LayoutColumnMenu.LayoutColumnMenu, {
|
|
292
295
|
api: api,
|
|
293
296
|
editorView: editorView,
|
|
@@ -110,13 +110,17 @@ export const layoutPlugin = ({
|
|
|
110
110
|
},
|
|
111
111
|
pluginsOptions: {
|
|
112
112
|
floatingToolbar(state, intl) {
|
|
113
|
+
const layoutState = pluginKey.getState(state);
|
|
114
|
+
if (!layoutState) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
113
117
|
const {
|
|
114
118
|
pos,
|
|
115
119
|
allowBreakout,
|
|
116
120
|
addSidebarLayouts,
|
|
117
121
|
allowSingleColumnLayout,
|
|
118
122
|
isResizing
|
|
119
|
-
} =
|
|
123
|
+
} = layoutState;
|
|
120
124
|
const shouldHideToolbar = isResizing && editorExperiment('single_column_layouts', true);
|
|
121
125
|
if (pos !== null && !shouldHideToolbar) {
|
|
122
126
|
return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, allowAdvancedSingleColumnLayout, api);
|
package/dist/esm/layoutPlugin.js
CHANGED
|
@@ -114,20 +114,23 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
114
114
|
},
|
|
115
115
|
pluginsOptions: {
|
|
116
116
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
var layoutState = pluginKey.getState(state);
|
|
118
|
+
if (!layoutState) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
var pos = layoutState.pos,
|
|
122
|
+
allowBreakout = layoutState.allowBreakout,
|
|
123
|
+
addSidebarLayouts = layoutState.addSidebarLayouts,
|
|
124
|
+
allowSingleColumnLayout = layoutState.allowSingleColumnLayout,
|
|
125
|
+
isResizing = layoutState.isResizing;
|
|
123
126
|
var shouldHideToolbar = isResizing && editorExperiment('single_column_layouts', true);
|
|
124
127
|
if (pos !== null && !shouldHideToolbar) {
|
|
125
128
|
return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, allowAdvancedSingleColumnLayout, api);
|
|
126
129
|
}
|
|
127
130
|
return undefined;
|
|
128
131
|
},
|
|
129
|
-
quickInsert: function quickInsert(
|
|
130
|
-
var formatMessage =
|
|
132
|
+
quickInsert: function quickInsert(_ref3) {
|
|
133
|
+
var formatMessage = _ref3.formatMessage;
|
|
131
134
|
var withInsertLayoutAnalytics = function withInsertLayoutAnalytics(tr, columnCount) {
|
|
132
135
|
var _api$analytics2;
|
|
133
136
|
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.actions) === null || _api$analytics2 === void 0 || _api$analytics2.attachAnalyticsEvent({
|
|
@@ -276,11 +279,11 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
276
279
|
}
|
|
277
280
|
}
|
|
278
281
|
},
|
|
279
|
-
contentComponent: function contentComponent(
|
|
280
|
-
var editorView =
|
|
281
|
-
popupsMountPoint =
|
|
282
|
-
popupsBoundariesElement =
|
|
283
|
-
popupsScrollableElement =
|
|
282
|
+
contentComponent: function contentComponent(_ref4) {
|
|
283
|
+
var editorView = _ref4.editorView,
|
|
284
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
285
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
286
|
+
popupsScrollableElement = _ref4.popupsScrollableElement;
|
|
284
287
|
return /*#__PURE__*/React.createElement(React.Fragment, null, editorExperiment('advanced_layouts', true) ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null, expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true) && editorView ? /*#__PURE__*/React.createElement(LayoutColumnMenu, {
|
|
285
288
|
api: api,
|
|
286
289
|
editorView: editorView,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.1",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/icon": "^34.5.0",
|
|
49
49
|
"@atlaskit/icon-lab": "^6.9.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^80.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^80.1.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|