@atlaskit/editor-plugin-breakout 1.9.15 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-breakout
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
8
+ [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
9
+ Update `React` from v16 to v18
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.9.15
4
16
 
5
17
  ### Patch Changes
@@ -205,7 +205,7 @@ function createPlugin(pluginInjectionApi, _ref2) {
205
205
  });
206
206
  }
207
207
  var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
208
- var _breakoutState$breako3, _breakoutState$breako4;
208
+ var _breakoutState$breako, _breakoutState$breako2;
209
209
  var api = _ref3.api,
210
210
  editorView = _ref3.editorView,
211
211
  boundariesElement = _ref3.boundariesElement,
@@ -224,23 +224,12 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
224
224
  }
225
225
  var isViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
226
226
  var isEditMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit';
227
- if ((0, _platformFeatureFlags.fg)('platform_editor_react_editor_view_react_18')) {
228
- var _breakoutState$breako, _breakoutState$breako2;
229
- return !isViewMode && editorDisabledState !== undefined && !(editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
230
- editorView: editorView,
231
- mountPoint: mountPoint,
232
- boundariesElement: boundariesElement,
233
- scrollableElement: scrollableElement,
234
- node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null,
235
- isLivePage: isEditMode
236
- }) : null;
237
- }
238
- return !isViewMode ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
227
+ return !isViewMode && editorDisabledState !== undefined && !(editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
239
228
  editorView: editorView,
240
229
  mountPoint: mountPoint,
241
230
  boundariesElement: boundariesElement,
242
231
  scrollableElement: scrollableElement,
243
- node: (_breakoutState$breako3 = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako4 = breakoutState.breakoutNode) === null || _breakoutState$breako4 === void 0 ? void 0 : _breakoutState$breako4.node) !== null && _breakoutState$breako3 !== void 0 ? _breakoutState$breako3 : null,
232
+ node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null,
244
233
  isLivePage: isEditMode
245
234
  }) : null;
246
235
  };
@@ -283,7 +272,7 @@ var breakoutPlugin = exports.breakoutPlugin = function breakoutPlugin(_ref4) {
283
272
  popupsBoundariesElement = _ref5.popupsBoundariesElement,
284
273
  popupsScrollableElement = _ref5.popupsScrollableElement;
285
274
  // This is a bit crappy, but should be resolved once we move to a static schema.
286
- if (options && !options.allowBreakoutButton || !editorView.editable && !(0, _platformFeatureFlags.fg)('platform_editor_react_editor_view_react_18')) {
275
+ if (options && !options.allowBreakoutButton) {
287
276
  return null;
288
277
  }
289
278
  return /*#__PURE__*/_react.default.createElement(LayoutButtonWrapper, {
@@ -202,7 +202,7 @@ const LayoutButtonWrapper = ({
202
202
  scrollableElement,
203
203
  mountPoint
204
204
  }) => {
205
- var _breakoutState$breako3, _breakoutState$breako4;
205
+ var _breakoutState$breako, _breakoutState$breako2;
206
206
  // Re-render with `width` (but don't use state) due to https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/24272
207
207
  const {
208
208
  breakoutState,
@@ -217,23 +217,12 @@ const LayoutButtonWrapper = ({
217
217
  }
218
218
  const isViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
219
219
  const isEditMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit';
220
- if (fg('platform_editor_react_editor_view_react_18')) {
221
- var _breakoutState$breako, _breakoutState$breako2;
222
- return !isViewMode && editorDisabledState !== undefined && !(editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) ? /*#__PURE__*/React.createElement(LayoutButton, {
223
- editorView: editorView,
224
- mountPoint: mountPoint,
225
- boundariesElement: boundariesElement,
226
- scrollableElement: scrollableElement,
227
- 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,
228
- isLivePage: isEditMode
229
- }) : null;
230
- }
231
- return !isViewMode ? /*#__PURE__*/React.createElement(LayoutButton, {
220
+ return !isViewMode && editorDisabledState !== undefined && !(editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) ? /*#__PURE__*/React.createElement(LayoutButton, {
232
221
  editorView: editorView,
233
222
  mountPoint: mountPoint,
234
223
  boundariesElement: boundariesElement,
235
224
  scrollableElement: scrollableElement,
236
- node: (_breakoutState$breako3 = breakoutState === null || breakoutState === void 0 ? void 0 : (_breakoutState$breako4 = breakoutState.breakoutNode) === null || _breakoutState$breako4 === void 0 ? void 0 : _breakoutState$breako4.node) !== null && _breakoutState$breako3 !== void 0 ? _breakoutState$breako3 : null,
225
+ 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,
237
226
  isLivePage: isEditMode
238
227
  }) : null;
239
228
  };
@@ -275,7 +264,7 @@ export const breakoutPlugin = ({
275
264
  popupsScrollableElement
276
265
  }) {
277
266
  // This is a bit crappy, but should be resolved once we move to a static schema.
278
- if (options && !options.allowBreakoutButton || !editorView.editable && !fg('platform_editor_react_editor_view_react_18')) {
267
+ if (options && !options.allowBreakoutButton) {
279
268
  return null;
280
269
  }
281
270
  return /*#__PURE__*/React.createElement(LayoutButtonWrapper, {
@@ -198,7 +198,7 @@ function createPlugin(pluginInjectionApi, _ref2) {
198
198
  });
199
199
  }
200
200
  var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
201
- var _breakoutState$breako3, _breakoutState$breako4;
201
+ var _breakoutState$breako, _breakoutState$breako2;
202
202
  var api = _ref3.api,
203
203
  editorView = _ref3.editorView,
204
204
  boundariesElement = _ref3.boundariesElement,
@@ -217,23 +217,12 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
217
217
  }
218
218
  var isViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
219
219
  var isEditMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit';
220
- if (fg('platform_editor_react_editor_view_react_18')) {
221
- var _breakoutState$breako, _breakoutState$breako2;
222
- return !isViewMode && editorDisabledState !== undefined && !(editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) ? /*#__PURE__*/React.createElement(LayoutButton, {
223
- editorView: editorView,
224
- mountPoint: mountPoint,
225
- boundariesElement: boundariesElement,
226
- scrollableElement: scrollableElement,
227
- node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null,
228
- isLivePage: isEditMode
229
- }) : null;
230
- }
231
- return !isViewMode ? /*#__PURE__*/React.createElement(LayoutButton, {
220
+ return !isViewMode && editorDisabledState !== undefined && !(editorDisabledState !== null && editorDisabledState !== void 0 && editorDisabledState.editorDisabled) ? /*#__PURE__*/React.createElement(LayoutButton, {
232
221
  editorView: editorView,
233
222
  mountPoint: mountPoint,
234
223
  boundariesElement: boundariesElement,
235
224
  scrollableElement: scrollableElement,
236
- node: (_breakoutState$breako3 = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako4 = breakoutState.breakoutNode) === null || _breakoutState$breako4 === void 0 ? void 0 : _breakoutState$breako4.node) !== null && _breakoutState$breako3 !== void 0 ? _breakoutState$breako3 : null,
225
+ node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 || (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null,
237
226
  isLivePage: isEditMode
238
227
  }) : null;
239
228
  };
@@ -276,7 +265,7 @@ export var breakoutPlugin = function breakoutPlugin(_ref4) {
276
265
  popupsBoundariesElement = _ref5.popupsBoundariesElement,
277
266
  popupsScrollableElement = _ref5.popupsScrollableElement;
278
267
  // This is a bit crappy, but should be resolved once we move to a static schema.
279
- if (options && !options.allowBreakoutButton || !editorView.editable && !fg('platform_editor_react_editor_view_react_18')) {
268
+ if (options && !options.allowBreakoutButton) {
280
269
  return null;
281
270
  }
282
271
  return /*#__PURE__*/React.createElement(LayoutButtonWrapper, {
@@ -10,13 +10,14 @@ export interface BreakoutPluginState {
10
10
  export interface BreakoutPluginOptions {
11
11
  allowBreakoutButton?: boolean;
12
12
  }
13
+ export type BreakoutPluginDependencies = [
14
+ WidthPlugin,
15
+ OptionalPlugin<EditorViewModePlugin>,
16
+ OptionalPlugin<EditorDisabledPlugin>,
17
+ OptionalPlugin<BlockControlsPlugin>
18
+ ];
13
19
  export type BreakoutPlugin = NextEditorPlugin<'breakout', {
14
20
  pluginConfiguration: BreakoutPluginOptions | undefined;
15
- dependencies: [
16
- WidthPlugin,
17
- OptionalPlugin<EditorViewModePlugin>,
18
- OptionalPlugin<EditorDisabledPlugin>,
19
- OptionalPlugin<BlockControlsPlugin>
20
- ];
21
+ dependencies: BreakoutPluginDependencies;
21
22
  sharedState: Partial<BreakoutPluginState>;
22
23
  }>;
@@ -10,13 +10,14 @@ export interface BreakoutPluginState {
10
10
  export interface BreakoutPluginOptions {
11
11
  allowBreakoutButton?: boolean;
12
12
  }
13
+ export type BreakoutPluginDependencies = [
14
+ WidthPlugin,
15
+ OptionalPlugin<EditorViewModePlugin>,
16
+ OptionalPlugin<EditorDisabledPlugin>,
17
+ OptionalPlugin<BlockControlsPlugin>
18
+ ];
13
19
  export type BreakoutPlugin = NextEditorPlugin<'breakout', {
14
20
  pluginConfiguration: BreakoutPluginOptions | undefined;
15
- dependencies: [
16
- WidthPlugin,
17
- OptionalPlugin<EditorViewModePlugin>,
18
- OptionalPlugin<EditorDisabledPlugin>,
19
- OptionalPlugin<BlockControlsPlugin>
20
- ];
21
+ dependencies: BreakoutPluginDependencies;
21
22
  sharedState: Partial<BreakoutPluginState>;
22
23
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-breakout",
3
- "version": "1.9.15",
3
+ "version": "1.10.0",
4
4
  "description": "Breakout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,18 +32,18 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^99.0.0",
36
- "@atlaskit/editor-plugin-block-controls": "^2.18.0",
37
- "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
35
+ "@atlaskit/editor-common": "^99.6.0",
36
+ "@atlaskit/editor-plugin-block-controls": "^2.21.0",
37
+ "@atlaskit/editor-plugin-editor-disabled": "^1.4.0",
38
38
  "@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
39
39
  "@atlaskit/editor-plugin-width": "^2.0.0",
40
40
  "@atlaskit/editor-prosemirror": "6.2.1",
41
41
  "@atlaskit/editor-shared-styles": "^3.2.0",
42
- "@atlaskit/icon": "^23.3.0",
42
+ "@atlaskit/icon": "^23.5.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
- "@atlaskit/theme": "^14.0.0",
45
- "@atlaskit/tmp-editor-statsig": "^2.33.0",
46
- "@atlaskit/tokens": "^3.0.0",
44
+ "@atlaskit/theme": "^14.1.0",
45
+ "@atlaskit/tmp-editor-statsig": "^2.41.0",
46
+ "@atlaskit/tokens": "^3.3.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@emotion/react": "^11.7.1"
49
49
  },
@@ -55,12 +55,12 @@
55
55
  "devDependencies": {
56
56
  "@af/integration-testing": "*",
57
57
  "@af/visual-regression": "*",
58
- "@atlaskit/editor-plugin-code-block": "^3.5.0",
58
+ "@atlaskit/editor-plugin-code-block": "^3.6.0",
59
59
  "@atlaskit/editor-plugin-composition": "^1.2.0",
60
- "@atlaskit/editor-plugin-decorations": "^1.3.0",
60
+ "@atlaskit/editor-plugin-decorations": "^1.4.0",
61
61
  "@atlaskit/ssr": "*",
62
62
  "@atlaskit/visual-regression": "*",
63
- "@testing-library/react": "^12.1.5",
63
+ "@testing-library/react": "^13.4.0",
64
64
  "typescript": "~5.4.2",
65
65
  "wait-for-expect": "^1.2.0"
66
66
  },
@@ -107,9 +107,6 @@
107
107
  "platform_editor_core_increase_full_page_guttering": {
108
108
  "type": "boolean"
109
109
  },
110
- "platform_editor_react_editor_view_react_18": {
111
- "type": "boolean"
112
- },
113
110
  "platform_editor_breakout_use_css": {
114
111
  "type": "boolean"
115
112
  }