@atlaskit/editor-plugin-breakout 6.3.1 → 6.4.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/editor-plugin-breakout
2
2
 
3
+ ## 6.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a528ea956ce65`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a528ea956ce65) -
8
+ [ux] EDITOR-3956 fix sync block resize handle padding and alignment
9
+ - Updated dependencies
10
+
11
+ ## 6.4.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`762b79e21f96a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/762b79e21f96a) -
16
+ Migrated and cleaned up legacy iconography usage.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 6.3.1
4
23
 
5
24
  ### Patch Changes
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.handleKeyDown = void 0;
7
7
  var _browser = require("@atlaskit/editor-common/browser");
8
+ var _utils = require("@atlaskit/editor-common/utils");
8
9
  var _state = require("@atlaskit/editor-prosemirror/state");
9
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
10
11
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
13
  var _setBreakoutWidth = require("../editor-commands/set-breakout-width");
12
14
  var KEYBOARD_RESIZE_STEP = 10;
13
15
  var getAncestorResizableNode = function getAncestorResizableNode(view, breakoutResizableNodes) {
@@ -48,7 +50,7 @@ var handleKeyDown = exports.handleKeyDown = function handleKeyDown(api) {
48
50
  expand = _view$state$schema$no.expand,
49
51
  codeBlock = _view$state$schema$no.codeBlock,
50
52
  layoutSection = _view$state$schema$no.layoutSection;
51
- var breakoutResizableNodes = new Set([expand, codeBlock, layoutSection]);
53
+ var breakoutResizableNodes = (0, _experiments.editorExperiment)('platform_synced_block', true) ? (0, _utils.getBreakoutResizableNodeTypes)(view.state.schema) : new Set([expand, codeBlock, layoutSection]);
52
54
  var result = getAncestorResizableNode(view, breakoutResizableNodes);
53
55
  if (result) {
54
56
  var node = result.node,
@@ -130,14 +130,8 @@ var createResizingPlugin = exports.createResizingPlugin = function createResizin
130
130
  var _newState$schema$node = newState.schema.nodes,
131
131
  expand = _newState$schema$node.expand,
132
132
  codeBlock = _newState$schema$node.codeBlock,
133
- layoutSection = _newState$schema$node.layoutSection,
134
- syncBlock = _newState$schema$node.syncBlock,
135
- bodiedSyncBlock = _newState$schema$node.bodiedSyncBlock;
136
- var breakoutResizableNodes = new Set([expand, codeBlock, layoutSection]);
137
- if ((0, _experiments.editorExperiment)('platform_synced_block', true)) {
138
- breakoutResizableNodes.add(syncBlock);
139
- breakoutResizableNodes.add(bodiedSyncBlock);
140
- }
133
+ layoutSection = _newState$schema$node.layoutSection;
134
+ var breakoutResizableNodes = (0, _experiments.editorExperiment)('platform_synced_block', true) ? (0, _utils.getBreakoutResizableNodeTypes)(newState.schema) : new Set([expand, codeBlock, layoutSection]);
141
135
  var isFullWidthEnabled = !((options === null || options === void 0 ? void 0 : options.allowBreakoutButton) === true);
142
136
  if ((0, _document.isReplaceDocOperation)(transactions, oldState)) {
143
137
  newState.doc.forEach(function (node, pos) {
@@ -19,8 +19,6 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
19
19
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
20
20
  var _growHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/grow-horizontal"));
21
21
  var _shrinkHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/shrink-horizontal"));
22
- var _collapse = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/collapse"));
23
- var _expand = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/expand"));
24
22
  var _colors = require("@atlaskit/theme/colors");
25
23
  var _constants = require("@atlaskit/theme/constants");
26
24
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
@@ -174,11 +172,9 @@ var LayoutButton = function LayoutButton(_ref) {
174
172
  },
175
173
  iconBefore: breakoutMode === 'full-width' ? (0, _react2.jsx)(_shrinkHorizontal.default, {
176
174
  label: title,
177
- LEGACY_fallbackIcon: _collapse.default,
178
175
  spacing: "spacious"
179
176
  }) : (0, _react2.jsx)(_growHorizontal.default, {
180
177
  label: title,
181
- LEGACY_fallbackIcon: _expand.default,
182
178
  spacing: "spacious"
183
179
  })
184
180
  })));
@@ -1,7 +1,9 @@
1
1
  import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
2
+ import { getBreakoutResizableNodeTypes } from '@atlaskit/editor-common/utils';
2
3
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
4
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
4
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
7
  import { setBreakoutWidth } from '../editor-commands/set-breakout-width';
6
8
  const KEYBOARD_RESIZE_STEP = 10;
7
9
  const getAncestorResizableNode = (view, breakoutResizableNodes) => {
@@ -42,7 +44,7 @@ export const handleKeyDown = api => (view, event) => {
42
44
  codeBlock,
43
45
  layoutSection
44
46
  } = view.state.schema.nodes;
45
- const breakoutResizableNodes = new Set([expand, codeBlock, layoutSection]);
47
+ const breakoutResizableNodes = editorExperiment('platform_synced_block', true) ? getBreakoutResizableNodeTypes(view.state.schema) : new Set([expand, codeBlock, layoutSection]);
46
48
  const result = getAncestorResizableNode(view, breakoutResizableNodes);
47
49
  if (result) {
48
50
  const {
@@ -1,5 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
2
+ import { getBreakoutResizableNodeTypes, stepAddsOneOf } from '@atlaskit/editor-common/utils';
3
3
  import { getChangedNodes, isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
4
4
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
5
5
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidth } from '@atlaskit/editor-shared-styles';
@@ -126,15 +126,9 @@ export const createResizingPlugin = (api, getIntl, nodeViewPortalProviderAPI, op
126
126
  const {
127
127
  expand,
128
128
  codeBlock,
129
- layoutSection,
130
- syncBlock,
131
- bodiedSyncBlock
129
+ layoutSection
132
130
  } = newState.schema.nodes;
133
- const breakoutResizableNodes = new Set([expand, codeBlock, layoutSection]);
134
- if (editorExperiment('platform_synced_block', true)) {
135
- breakoutResizableNodes.add(syncBlock);
136
- breakoutResizableNodes.add(bodiedSyncBlock);
137
- }
131
+ const breakoutResizableNodes = editorExperiment('platform_synced_block', true) ? getBreakoutResizableNodeTypes(newState.schema) : new Set([expand, codeBlock, layoutSection]);
138
132
  const isFullWidthEnabled = !((options === null || options === void 0 ? void 0 : options.allowBreakoutButton) === true);
139
133
  if (isReplaceDocOperation(transactions, oldState)) {
140
134
  newState.doc.forEach((node, pos) => {
@@ -17,8 +17,6 @@ import { findDomRefAtPos, findParentDomRefOfType } from '@atlaskit/editor-prosem
17
17
  import { akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
18
18
  import GrowHorizontalIcon from '@atlaskit/icon/core/grow-horizontal';
19
19
  import ShrinkHorizontalIcon from '@atlaskit/icon/core/shrink-horizontal';
20
- import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
21
- import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
22
20
  import { B300, N20A, N300 } from '@atlaskit/theme/colors';
23
21
  import { layers } from '@atlaskit/theme/constants';
24
22
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -170,11 +168,9 @@ const LayoutButton = ({
170
168
  onClick: () => handleClick(nextBreakoutMode),
171
169
  iconBefore: breakoutMode === 'full-width' ? jsx(ShrinkHorizontalIcon, {
172
170
  label: title,
173
- LEGACY_fallbackIcon: CollapseIcon,
174
171
  spacing: "spacious"
175
172
  }) : jsx(GrowHorizontalIcon, {
176
173
  label: title,
177
- LEGACY_fallbackIcon: ExpandIcon,
178
174
  spacing: "spacious"
179
175
  })
180
176
  })));
@@ -1,7 +1,9 @@
1
1
  import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
2
+ import { getBreakoutResizableNodeTypes } from '@atlaskit/editor-common/utils';
2
3
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
4
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
4
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
7
  import { setBreakoutWidth } from '../editor-commands/set-breakout-width';
6
8
  var KEYBOARD_RESIZE_STEP = 10;
7
9
  var getAncestorResizableNode = function getAncestorResizableNode(view, breakoutResizableNodes) {
@@ -42,7 +44,7 @@ export var handleKeyDown = function handleKeyDown(api) {
42
44
  expand = _view$state$schema$no.expand,
43
45
  codeBlock = _view$state$schema$no.codeBlock,
44
46
  layoutSection = _view$state$schema$no.layoutSection;
45
- var breakoutResizableNodes = new Set([expand, codeBlock, layoutSection]);
47
+ var breakoutResizableNodes = editorExperiment('platform_synced_block', true) ? getBreakoutResizableNodeTypes(view.state.schema) : new Set([expand, codeBlock, layoutSection]);
46
48
  var result = getAncestorResizableNode(view, breakoutResizableNodes);
47
49
  if (result) {
48
50
  var node = result.node,
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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; }
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
- import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
5
+ import { getBreakoutResizableNodeTypes, stepAddsOneOf } from '@atlaskit/editor-common/utils';
6
6
  import { getChangedNodes, isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
7
7
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
8
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidth } from '@atlaskit/editor-shared-styles';
@@ -123,14 +123,8 @@ export var createResizingPlugin = function createResizingPlugin(api, getIntl, no
123
123
  var _newState$schema$node = newState.schema.nodes,
124
124
  expand = _newState$schema$node.expand,
125
125
  codeBlock = _newState$schema$node.codeBlock,
126
- layoutSection = _newState$schema$node.layoutSection,
127
- syncBlock = _newState$schema$node.syncBlock,
128
- bodiedSyncBlock = _newState$schema$node.bodiedSyncBlock;
129
- var breakoutResizableNodes = new Set([expand, codeBlock, layoutSection]);
130
- if (editorExperiment('platform_synced_block', true)) {
131
- breakoutResizableNodes.add(syncBlock);
132
- breakoutResizableNodes.add(bodiedSyncBlock);
133
- }
126
+ layoutSection = _newState$schema$node.layoutSection;
127
+ var breakoutResizableNodes = editorExperiment('platform_synced_block', true) ? getBreakoutResizableNodeTypes(newState.schema) : new Set([expand, codeBlock, layoutSection]);
134
128
  var isFullWidthEnabled = !((options === null || options === void 0 ? void 0 : options.allowBreakoutButton) === true);
135
129
  if (isReplaceDocOperation(transactions, oldState)) {
136
130
  newState.doc.forEach(function (node, pos) {
@@ -18,8 +18,6 @@ import { findDomRefAtPos, findParentDomRefOfType } from '@atlaskit/editor-prosem
18
18
  import { akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
19
19
  import GrowHorizontalIcon from '@atlaskit/icon/core/grow-horizontal';
20
20
  import ShrinkHorizontalIcon from '@atlaskit/icon/core/shrink-horizontal';
21
- import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
22
- import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
23
21
  import { B300, N20A, N300 } from '@atlaskit/theme/colors';
24
22
  import { layers } from '@atlaskit/theme/constants';
25
23
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -166,11 +164,9 @@ var LayoutButton = function LayoutButton(_ref) {
166
164
  },
167
165
  iconBefore: breakoutMode === 'full-width' ? jsx(ShrinkHorizontalIcon, {
168
166
  label: title,
169
- LEGACY_fallbackIcon: CollapseIcon,
170
167
  spacing: "spacious"
171
168
  }) : jsx(GrowHorizontalIcon, {
172
169
  label: title,
173
- LEGACY_fallbackIcon: ExpandIcon,
174
170
  spacing: "spacious"
175
171
  })
176
172
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-breakout",
3
- "version": "6.3.1",
3
+ "version": "6.4.1",
4
4
  "description": "Breakout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,22 +29,22 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^51.5.1",
33
- "@atlaskit/editor-plugin-block-controls": "^7.13.0",
32
+ "@atlaskit/adf-schema": "^51.5.0",
33
+ "@atlaskit/editor-plugin-block-controls": "^7.15.0",
34
34
  "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
35
35
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
36
36
  "@atlaskit/editor-plugin-guideline": "^6.0.0",
37
37
  "@atlaskit/editor-plugin-interaction": "^10.0.0",
38
38
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
39
39
  "@atlaskit/editor-plugin-width": "^7.0.0",
40
- "@atlaskit/editor-prosemirror": "7.0.0",
40
+ "@atlaskit/editor-prosemirror": "^7.2.0",
41
41
  "@atlaskit/editor-shared-styles": "^3.10.0",
42
- "@atlaskit/icon": "^29.0.0",
42
+ "@atlaskit/icon": "^29.3.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
45
45
  "@atlaskit/theme": "^21.0.0",
46
- "@atlaskit/tmp-editor-statsig": "^15.9.0",
47
- "@atlaskit/tokens": "^8.4.0",
46
+ "@atlaskit/tmp-editor-statsig": "^16.0.0",
47
+ "@atlaskit/tokens": "^8.6.0",
48
48
  "@atlaskit/tooltip": "^20.11.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@emotion/react": "^11.7.1",
@@ -53,7 +53,7 @@
53
53
  "uuid": "^3.1.0"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^110.41.0",
56
+ "@atlaskit/editor-common": "^110.46.0",
57
57
  "react": "^18.2.0",
58
58
  "react-dom": "^18.2.0",
59
59
  "react-intl-next": "npm:react-intl@^5.18.1"