@atlaskit/editor-plugin-breakout 1.9.4 → 1.9.5

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,13 @@
1
1
  # @atlaskit/editor-plugin-breakout
2
2
 
3
+ ## 1.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#169284](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169284)
8
+ [`6e121d2945aae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6e121d2945aae) -
9
+ ED-25760 draop hints are not triggered for unchanged layout
10
+
3
11
  ## 1.9.4
4
12
 
5
13
  ### Patch Changes
@@ -16,6 +16,7 @@ var _styles = require("@atlaskit/editor-common/styles");
16
16
  var _utils = require("@atlaskit/editor-common/utils");
17
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
20
  var _pluginKey = require("./plugin-key");
20
21
  var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
21
22
  var _findBreakoutNode = require("./utils/find-breakout-node");
@@ -212,10 +213,16 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
212
213
  scrollableElement = _ref3.scrollableElement,
213
214
  mountPoint = _ref3.mountPoint;
214
215
  // Re-render with `width` (but don't use state) due to https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/24272
215
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'breakout', 'editorViewMode', 'editorDisabled']),
216
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'breakout', 'editorViewMode', 'editorDisabled', 'blockControls']),
216
217
  breakoutState = _useSharedPluginState.breakoutState,
217
218
  editorViewModeState = _useSharedPluginState.editorViewModeState,
218
- editorDisabledState = _useSharedPluginState.editorDisabledState;
219
+ editorDisabledState = _useSharedPluginState.editorDisabledState,
220
+ blockControlsState = _useSharedPluginState.blockControlsState;
221
+ if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging || blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isPMDragging) {
222
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
223
+ return null;
224
+ }
225
+ }
219
226
  var isViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
220
227
  var isEditMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit';
221
228
  if ((0, _platformFeatureFlags.fg)('platform_editor_react_editor_view_react_18')) {
@@ -7,6 +7,7 @@ import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
7
7
  import { calcBreakoutWidthPx } from '@atlaskit/editor-common/utils';
8
8
  import { akEditorGutterPaddingDynamic, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
11
  import { pluginKey } from './plugin-key';
11
12
  import LayoutButton from './ui/LayoutButton';
12
13
  import { findSupportedNodeForBreakout } from './utils/find-breakout-node';
@@ -206,8 +207,14 @@ const LayoutButtonWrapper = ({
206
207
  const {
207
208
  breakoutState,
208
209
  editorViewModeState,
209
- editorDisabledState
210
- } = useSharedPluginState(api, ['width', 'breakout', 'editorViewMode', 'editorDisabled']);
210
+ editorDisabledState,
211
+ blockControlsState
212
+ } = useSharedPluginState(api, ['width', 'breakout', 'editorViewMode', 'editorDisabled', 'blockControls']);
213
+ if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging || blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isPMDragging) {
214
+ if (editorExperiment('advanced_layouts', true)) {
215
+ return null;
216
+ }
217
+ }
211
218
  const isViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
212
219
  const isEditMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit';
213
220
  if (fg('platform_editor_react_editor_view_react_18')) {
@@ -11,6 +11,7 @@ import { BreakoutCssClassName } from '@atlaskit/editor-common/styles';
11
11
  import { calcBreakoutWidthPx } from '@atlaskit/editor-common/utils';
12
12
  import { akEditorGutterPaddingDynamic, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
15
  import { pluginKey } from './plugin-key';
15
16
  import LayoutButton from './ui/LayoutButton';
16
17
  import { findSupportedNodeForBreakout } from './utils/find-breakout-node';
@@ -205,10 +206,16 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
205
206
  scrollableElement = _ref3.scrollableElement,
206
207
  mountPoint = _ref3.mountPoint;
207
208
  // Re-render with `width` (but don't use state) due to https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/24272
208
- var _useSharedPluginState = useSharedPluginState(api, ['width', 'breakout', 'editorViewMode', 'editorDisabled']),
209
+ var _useSharedPluginState = useSharedPluginState(api, ['width', 'breakout', 'editorViewMode', 'editorDisabled', 'blockControls']),
209
210
  breakoutState = _useSharedPluginState.breakoutState,
210
211
  editorViewModeState = _useSharedPluginState.editorViewModeState,
211
- editorDisabledState = _useSharedPluginState.editorDisabledState;
212
+ editorDisabledState = _useSharedPluginState.editorDisabledState,
213
+ blockControlsState = _useSharedPluginState.blockControlsState;
214
+ if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging || blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isPMDragging) {
215
+ if (editorExperiment('advanced_layouts', true)) {
216
+ return null;
217
+ }
218
+ }
212
219
  var isViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
213
220
  var isEditMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit';
214
221
  if (fg('platform_editor_react_editor_view_react_18')) {
@@ -1,4 +1,5 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import { type BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
2
3
  import { type EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
3
4
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
4
5
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
@@ -11,7 +12,8 @@ export type BreakoutPlugin = NextEditorPlugin<'breakout', {
11
12
  dependencies: [
12
13
  WidthPlugin,
13
14
  OptionalPlugin<EditorViewModePlugin>,
14
- OptionalPlugin<EditorDisabledPlugin>
15
+ OptionalPlugin<EditorDisabledPlugin>,
16
+ OptionalPlugin<BlockControlsPlugin>
15
17
  ];
16
18
  sharedState: Partial<BreakoutPluginState>;
17
19
  }>;
@@ -1,4 +1,5 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import { type BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
2
3
  import { type EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
3
4
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
4
5
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
@@ -11,7 +12,8 @@ export type BreakoutPlugin = NextEditorPlugin<'breakout', {
11
12
  dependencies: [
12
13
  WidthPlugin,
13
14
  OptionalPlugin<EditorViewModePlugin>,
14
- OptionalPlugin<EditorDisabledPlugin>
15
+ OptionalPlugin<EditorDisabledPlugin>,
16
+ OptionalPlugin<BlockControlsPlugin>
15
17
  ];
16
18
  sharedState: Partial<BreakoutPluginState>;
17
19
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-breakout",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Breakout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,6 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
35
  "@atlaskit/editor-common": "^95.7.0",
36
+ "@atlaskit/editor-plugin-block-controls": "^2.13.0",
36
37
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
37
38
  "@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
38
39
  "@atlaskit/editor-plugin-width": "^1.3.0",
@@ -41,6 +42,7 @@
41
42
  "@atlaskit/icon": "^22.26.0",
42
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
43
44
  "@atlaskit/theme": "^14.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^2.17.0",
44
46
  "@atlaskit/tokens": "^2.3.0",
45
47
  "@babel/runtime": "^7.0.0",
46
48
  "@emotion/react": "^11.7.1"