@atlaskit/editor-plugin-breakout 6.4.0 → 6.4.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-breakout
2
2
 
3
+ ## 6.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 6.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`a528ea956ce65`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a528ea956ce65) -
14
+ [ux] EDITOR-3956 fix sync block resize handle padding and alignment
15
+ - Updated dependencies
16
+
3
17
  ## 6.4.0
4
18
 
5
19
  ### Minor 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) {
@@ -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) => {
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-breakout",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "description": "Breakout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,17 +34,17 @@
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
- "@atlaskit/editor-plugin-interaction": "^10.0.0",
37
+ "@atlaskit/editor-plugin-interaction": "^11.0.0",
38
38
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
39
39
  "@atlaskit/editor-plugin-width": "^7.0.0",
40
40
  "@atlaskit/editor-prosemirror": "^7.2.0",
41
41
  "@atlaskit/editor-shared-styles": "^3.10.0",
42
- "@atlaskit/icon": "^29.2.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.12.0",
47
- "@atlaskit/tokens": "^8.6.0",
46
+ "@atlaskit/tmp-editor-statsig": "^16.0.0",
47
+ "@atlaskit/tokens": "^9.0.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.45.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"