@atlaskit/editor-plugin-block-controls 11.5.2 → 11.5.4

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-block-controls
2
2
 
3
+ ## 11.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.5.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`cd85cdec5ae7e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd85cdec5ae7e) -
14
+ EDITOR-7170 add transform for panel -> panel_c1
15
+ - Updated dependencies
16
+
3
17
  ## 11.5.2
4
18
 
5
19
  ### Patch Changes
@@ -19,6 +19,7 @@ var _transform = require("@atlaskit/editor-prosemirror/transform");
19
19
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
20
20
  var _utils3 = require("@atlaskit/editor-tables/utils");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
23
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
23
24
  var _main = require("../pm-plugins/main");
24
25
  var _analytics2 = require("../pm-plugins/utils/analytics");
@@ -77,7 +78,8 @@ var nodesSupportDragLayoutColumnInto = ['tableCell', 'tableHeader', 'panel', 'ex
77
78
  var isDragLayoutColumnIntoSupportedNodes = function isDragLayoutColumnIntoSupportedNodes($from, $to) {
78
79
  var _$from$nodeAfter;
79
80
  var isTopLevel = $to.depth === 0;
80
- var isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes($to.parent.type.name);
81
+ var toParentTypeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _utils.getBaseNodeTypeName)($to.parent.type) : $to.parent.type.name;
82
+ var isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes(toParentTypeName);
81
83
  var supportedCondition = isDragIntoNodes || isTopLevel;
82
84
  return ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type.name) === 'layoutColumn' && $from.parent.type.name === 'layoutSection' && supportedCondition;
83
85
  };
@@ -245,7 +245,8 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
245
245
  return false; //not valid pos, so nested not valid either
246
246
  }
247
247
  var parentTypesWithEndDropTarget = (0, _experiments.editorExperiment)('platform_synced_block', true) ? PARENT_WITH_END_DROP_TARGET_NEXT : PARENT_WITH_END_DROP_TARGET;
248
- if (parent.lastChild === node && !(0, _utils.isEmptyParagraph)(node) && parentTypesWithEndDropTarget.includes(parent.type.name)) {
248
+ var parentTypeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _utils.getBaseNodeTypeName)(parent.type) : parent.type.name;
249
+ if (parent.lastChild === node && !(0, _utils.isEmptyParagraph)(node) && parentTypesWithEndDropTarget.includes(parentTypeName)) {
249
250
  endPos = pos + node.nodeSize;
250
251
  }
251
252
  var previousNode = popNodeStack(depth); // created scoped variable
@@ -12,6 +12,7 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
12
12
  var _nesting = require("@atlaskit/editor-common/nesting");
13
13
  var _model = require("@atlaskit/editor-prosemirror/model");
14
14
  var _utils = require("@atlaskit/editor-prosemirror/utils");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
17
  var isInsideTable = exports.isInsideTable = function isInsideTable(nodeType) {
17
18
  var _nodeType$schema$node = nodeType.schema.nodes,
@@ -112,6 +113,7 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
112
113
  nestedExpand = _schema$nodes.nestedExpand,
113
114
  doc = _schema$nodes.doc,
114
115
  panel = _schema$nodes.panel,
116
+ panel_c1 = _schema$nodes.panel_c1,
115
117
  layoutColumn = _schema$nodes.layoutColumn,
116
118
  layoutSection = _schema$nodes.layoutSection;
117
119
  var destParentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type;
@@ -133,7 +135,7 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
133
135
  }
134
136
  return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
135
137
  }
136
- if (destParentNodeType === panel) {
138
+ if (destParentNodeType === panel || (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && destParentNodeType === panel_c1) {
137
139
  return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
138
140
  }
139
141
  if (destParentNodeType === expand) {
@@ -134,7 +134,7 @@ var dragHandleButtonStyles = (0, _react2.css)({
134
134
  backgroundColor: 'transparent'
135
135
  },
136
136
  '&:hover:disabled': {
137
- backgroundColor: "var(--ds-background-disabled, #17171708)"
137
+ backgroundColor: "var(--ds-background-disabled, #0515240F)"
138
138
  }
139
139
  });
140
140
 
@@ -190,7 +190,7 @@ var dragHandleButtonStylesOld = (0, _react2.css)({
190
190
  backgroundColor: 'transparent'
191
191
  },
192
192
  '&:hover:disabled': {
193
- backgroundColor: "var(--ds-background-disabled, #17171708)"
193
+ backgroundColor: "var(--ds-background-disabled, #0515240F)"
194
194
  }
195
195
  });
196
196
  var focusedStylesOld = (0, _react2.css)({
@@ -4,13 +4,14 @@ import { blockControlsMessages } from '@atlaskit/editor-common/messages';
4
4
  import { expandSelectionBounds, GapCursorSelection } from '@atlaskit/editor-common/selection';
5
5
  import { transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
6
6
  import { DIRECTION } from '@atlaskit/editor-common/types';
7
- import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
7
+ import { getBaseNodeTypeName, isEmptyParagraph } from '@atlaskit/editor-common/utils';
8
8
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
9
9
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
10
10
  import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
11
11
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
12
12
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
15
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
16
  import { key } from '../pm-plugins/main';
16
17
  import { attachMoveNodeAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
@@ -69,7 +70,8 @@ const nodesSupportDragLayoutColumnInto = ['tableCell', 'tableHeader', 'panel', '
69
70
  const isDragLayoutColumnIntoSupportedNodes = ($from, $to) => {
70
71
  var _$from$nodeAfter;
71
72
  const isTopLevel = $to.depth === 0;
72
- const isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes($to.parent.type.name);
73
+ const toParentTypeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName($to.parent.type) : $to.parent.type.name;
74
+ const isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes(toParentTypeName);
73
75
  const supportedCondition = isDragIntoNodes || isTopLevel;
74
76
  return ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type.name) === 'layoutColumn' && $from.parent.type.name === 'layoutSection' && supportedCondition;
75
77
  };
@@ -2,7 +2,7 @@ import { createElement } from 'react';
2
2
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
3
3
  import uuid from 'uuid';
4
4
  import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
5
- import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
5
+ import { getBaseNodeTypeName, isEmptyParagraph } from '@atlaskit/editor-common/utils';
6
6
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
7
7
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
8
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -234,7 +234,8 @@ export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPort
234
234
  return false; //not valid pos, so nested not valid either
235
235
  }
236
236
  const parentTypesWithEndDropTarget = editorExperiment('platform_synced_block', true) ? PARENT_WITH_END_DROP_TARGET_NEXT : PARENT_WITH_END_DROP_TARGET;
237
- if (parent.lastChild === node && !isEmptyParagraph(node) && parentTypesWithEndDropTarget.includes(parent.type.name)) {
237
+ const parentTypeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(parent.type) : parent.type.name;
238
+ if (parent.lastChild === node && !isEmptyParagraph(node) && parentTypesWithEndDropTarget.includes(parentTypeName)) {
238
239
  endPos = pos + node.nodeSize;
239
240
  }
240
241
  const previousNode = popNodeStack(depth); // created scoped variable
@@ -2,6 +2,7 @@ import memoizeOne from 'memoize-one';
2
2
  import { getParentOfTypeCount, isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
3
3
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
4
4
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  export const isInsideTable = nodeType => {
7
8
  const {
@@ -100,6 +101,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
100
101
  nestedExpand,
101
102
  doc,
102
103
  panel,
104
+ panel_c1,
103
105
  layoutColumn,
104
106
  layoutSection
105
107
  } = schema.nodes;
@@ -122,7 +124,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
122
124
  }
123
125
  return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
124
126
  }
125
- if (destParentNodeType === panel) {
127
+ if (destParentNodeType === panel || expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && destParentNodeType === panel_c1) {
126
128
  return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
127
129
  }
128
130
  if (destParentNodeType === expand) {
@@ -125,7 +125,7 @@ const dragHandleButtonStyles = css({
125
125
  backgroundColor: 'transparent'
126
126
  },
127
127
  '&:hover:disabled': {
128
- backgroundColor: "var(--ds-background-disabled, #17171708)"
128
+ backgroundColor: "var(--ds-background-disabled, #0515240F)"
129
129
  }
130
130
  });
131
131
 
@@ -184,7 +184,7 @@ const dragHandleButtonStylesOld = css({
184
184
  backgroundColor: 'transparent'
185
185
  },
186
186
  '&:hover:disabled': {
187
- backgroundColor: "var(--ds-background-disabled, #17171708)"
187
+ backgroundColor: "var(--ds-background-disabled, #0515240F)"
188
188
  }
189
189
  });
190
190
  const focusedStylesOld = css({
@@ -7,13 +7,14 @@ import { blockControlsMessages } from '@atlaskit/editor-common/messages';
7
7
  import { expandSelectionBounds, GapCursorSelection } from '@atlaskit/editor-common/selection';
8
8
  import { transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
9
9
  import { DIRECTION } from '@atlaskit/editor-common/types';
10
- import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
10
+ import { getBaseNodeTypeName, isEmptyParagraph } from '@atlaskit/editor-common/utils';
11
11
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
12
12
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
14
14
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
15
15
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
18
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
19
  import { key } from '../pm-plugins/main';
19
20
  import { attachMoveNodeAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
@@ -71,7 +72,8 @@ var nodesSupportDragLayoutColumnInto = ['tableCell', 'tableHeader', 'panel', 'ex
71
72
  var isDragLayoutColumnIntoSupportedNodes = function isDragLayoutColumnIntoSupportedNodes($from, $to) {
72
73
  var _$from$nodeAfter;
73
74
  var isTopLevel = $to.depth === 0;
74
- var isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes($to.parent.type.name);
75
+ var toParentTypeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName($to.parent.type) : $to.parent.type.name;
76
+ var isDragIntoNodes = nodesSupportDragLayoutColumnInto.includes(toParentTypeName);
75
77
  var supportedCondition = isDragIntoNodes || isTopLevel;
76
78
  return ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type.name) === 'layoutColumn' && $from.parent.type.name === 'layoutSection' && supportedCondition;
77
79
  };
@@ -5,7 +5,7 @@ import { createElement } from 'react';
5
5
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
6
6
  import uuid from 'uuid';
7
7
  import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
8
- import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
8
+ import { getBaseNodeTypeName, isEmptyParagraph } from '@atlaskit/editor-common/utils';
9
9
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
10
10
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -239,7 +239,8 @@ export var dropTargetDecorations = function dropTargetDecorations(newState, api,
239
239
  return false; //not valid pos, so nested not valid either
240
240
  }
241
241
  var parentTypesWithEndDropTarget = editorExperiment('platform_synced_block', true) ? PARENT_WITH_END_DROP_TARGET_NEXT : PARENT_WITH_END_DROP_TARGET;
242
- if (parent.lastChild === node && !isEmptyParagraph(node) && parentTypesWithEndDropTarget.includes(parent.type.name)) {
242
+ var parentTypeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(parent.type) : parent.type.name;
243
+ if (parent.lastChild === node && !isEmptyParagraph(node) && parentTypesWithEndDropTarget.includes(parentTypeName)) {
243
244
  endPos = pos + node.nodeSize;
244
245
  }
245
246
  var previousNode = popNodeStack(depth); // created scoped variable
@@ -2,6 +2,7 @@ import memoizeOne from 'memoize-one';
2
2
  import { getParentOfTypeCount, isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
3
3
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
4
4
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  export var isInsideTable = function isInsideTable(nodeType) {
7
8
  var _nodeType$schema$node = nodeType.schema.nodes,
@@ -102,6 +103,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
102
103
  nestedExpand = _schema$nodes.nestedExpand,
103
104
  doc = _schema$nodes.doc,
104
105
  panel = _schema$nodes.panel,
106
+ panel_c1 = _schema$nodes.panel_c1,
105
107
  layoutColumn = _schema$nodes.layoutColumn,
106
108
  layoutSection = _schema$nodes.layoutSection;
107
109
  var destParentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type;
@@ -123,7 +125,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
123
125
  }
124
126
  return canCreateNodeWithContentInsideAnotherNode([tableCell, tableHeader], convertedFragment);
125
127
  }
126
- if (destParentNodeType === panel) {
128
+ if (destParentNodeType === panel || expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && destParentNodeType === panel_c1) {
127
129
  return canCreateNodeWithContentInsideAnotherNode([panel], layoutColumnContent);
128
130
  }
129
131
  if (destParentNodeType === expand) {
@@ -130,7 +130,7 @@ var dragHandleButtonStyles = css({
130
130
  backgroundColor: 'transparent'
131
131
  },
132
132
  '&:hover:disabled': {
133
- backgroundColor: "var(--ds-background-disabled, #17171708)"
133
+ backgroundColor: "var(--ds-background-disabled, #0515240F)"
134
134
  }
135
135
  });
136
136
 
@@ -186,7 +186,7 @@ var dragHandleButtonStylesOld = css({
186
186
  backgroundColor: 'transparent'
187
187
  },
188
188
  '&:hover:disabled': {
189
- backgroundColor: "var(--ds-background-disabled, #17171708)"
189
+ backgroundColor: "var(--ds-background-disabled, #0515240F)"
190
190
  }
191
191
  });
192
192
  var focusedStylesOld = css({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "11.5.2",
3
+ "version": "11.5.4",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/editor-plugin-quick-insert": "^10.4.0",
42
42
  "@atlaskit/editor-plugin-selection": "^10.1.0",
43
43
  "@atlaskit/editor-plugin-toolbar": "^7.3.0",
44
- "@atlaskit/editor-plugin-type-ahead": "^10.2.0",
44
+ "@atlaskit/editor-plugin-type-ahead": "^10.3.0",
45
45
  "@atlaskit/editor-plugin-user-intent": "^8.2.0",
46
46
  "@atlaskit/editor-plugin-width": "^11.1.0",
47
47
  "@atlaskit/editor-prosemirror": "^7.3.0",
@@ -56,9 +56,9 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
57
57
  "@atlaskit/primitives": "^19.0.0",
58
58
  "@atlaskit/theme": "^25.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^84.0.0",
60
- "@atlaskit/tokens": "^13.0.0",
61
- "@atlaskit/tooltip": "^22.3.0",
59
+ "@atlaskit/tmp-editor-statsig": "^85.0.0",
60
+ "@atlaskit/tokens": "^13.1.0",
61
+ "@atlaskit/tooltip": "^22.5.0",
62
62
  "@babel/runtime": "^7.0.0",
63
63
  "@emotion/react": "^11.7.1",
64
64
  "bind-event-listener": "^3.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^114.47.0",
70
+ "@atlaskit/editor-common": "^114.50.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"