@atlaskit/editor-plugin-block-controls 3.10.2 → 3.10.3

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-block-controls
2
2
 
3
+ ## 3.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#139698](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139698)
8
+ [`cf8ea53ed0264`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf8ea53ed0264) -
9
+ Clean-up nested expand feature gate
10
+ - [#142866](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142866)
11
+ [`b2ff4351e7e00`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2ff4351e7e00) -
12
+ Fix missing destroy callback for quick insert
13
+ - Updated dependencies
14
+
3
15
  ## 3.10.2
4
16
 
5
17
  ### Patch Changes
@@ -30,7 +30,9 @@ var findHandleDec = exports.findHandleDec = function findHandleDec(decorations,
30
30
  });
31
31
  };
32
32
  var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDecoration(api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache) {
33
- (0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
33
+ if (!(0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
34
+ (0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
35
+ }
34
36
  var unbind;
35
37
  var key = (0, _uuid.default)();
36
38
  return _view.Decoration.widget(pos, function (view, getPosUnsafe) {
@@ -121,8 +123,12 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
121
123
  side: -1,
122
124
  type: _decorationsCommon.TYPE_HANDLE_DEC,
123
125
  testid: "".concat(_decorationsCommon.TYPE_HANDLE_DEC, "-").concat((0, _uuid.default)()),
124
- destroy: function destroy() {
125
- return unbind && unbind();
126
+ destroy: function destroy(node) {
127
+ unbind && unbind();
128
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
129
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
130
+ _reactDom.default.unmountComponentAtNode(node);
131
+ }
126
132
  }
127
133
  });
128
134
  };
@@ -57,6 +57,11 @@ var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function
57
57
  return element;
58
58
  }, {
59
59
  side: -2,
60
- type: TYPE_QUICK_INSERT
60
+ type: TYPE_QUICK_INSERT,
61
+ destroy: function destroy(_) {
62
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_widget_destroy')) {
63
+ nodeViewPortalProviderAPI.remove(key);
64
+ }
65
+ }
61
66
  });
62
67
  };
@@ -144,13 +144,6 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
144
144
  }
145
145
  }
146
146
 
147
- // Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
148
- if ((0, _experiments.editorExperiment)('nested-expand-in-expand', false)) {
149
- if (destParentNodeType === expand && (activeNodeType === expand || activeNodeType === nestedExpand)) {
150
- return false;
151
- }
152
- }
153
-
154
147
  // NOTE: this will block drop targets from showing for dragging a table into another table
155
148
  // unless nested tables are supported and the nesting depth does not exceed 1
156
149
  if ((destParentNodeType === tableCell || destParentNodeType === tableHeader) && activeNodeType === table) {
@@ -166,6 +166,7 @@ var tooltipContainerStyles = (0, _react2.css)({
166
166
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
167
167
  bottom: "-".concat(_consts.STICKY_CONTROLS_TOP_MARGIN, "px"),
168
168
  position: 'sticky',
169
+ display: 'block',
169
170
  zIndex: 100 // card = 100
170
171
  });
171
172
  var tooltipContainerStylesStickyHeaderWithMask = (0, _react2.css)({
@@ -105,6 +105,7 @@ var tooltipContainerStyles = (0, _react2.css)({
105
105
  top: '8px',
106
106
  bottom: '-8px',
107
107
  position: 'sticky',
108
+ display: 'block',
108
109
  zIndex: 'card'
109
110
  });
110
111
  var tooltipContainerStylesStickyHeader = (0, _react2.css)({
@@ -21,7 +21,9 @@ export const findHandleDec = (decorations, from, to) => {
21
21
  return decorations.find(from, to, spec => spec.type === TYPE_HANDLE_DEC);
22
22
  };
23
23
  export const dragHandleDecoration = (api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache) => {
24
- unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
24
+ if (!fg('platform_editor_fix_widget_destroy')) {
25
+ unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
26
+ }
25
27
  let unbind;
26
28
  const key = uuid();
27
29
  return Decoration.widget(pos, (view, getPosUnsafe) => {
@@ -112,6 +114,12 @@ export const dragHandleDecoration = (api, formatMessage, pos, anchorName, nodeTy
112
114
  side: -1,
113
115
  type: TYPE_HANDLE_DEC,
114
116
  testid: `${TYPE_HANDLE_DEC}-${uuid()}`,
115
- destroy: () => unbind && unbind()
117
+ destroy: node => {
118
+ unbind && unbind();
119
+ if (fg('platform_editor_fix_widget_destroy')) {
120
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
121
+ ReactDOM.unmountComponentAtNode(node);
122
+ }
123
+ }
116
124
  });
117
125
  };
@@ -44,6 +44,11 @@ export const quickInsertButtonDecoration = (api, formatMessage, rootPos, anchorN
44
44
  return element;
45
45
  }, {
46
46
  side: -2,
47
- type: TYPE_QUICK_INSERT
47
+ type: TYPE_QUICK_INSERT,
48
+ destroy: _ => {
49
+ if (fg('platform_editor_fix_widget_destroy')) {
50
+ nodeViewPortalProviderAPI.remove(key);
51
+ }
52
+ }
48
53
  });
49
54
  };
@@ -135,13 +135,6 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
135
135
  }
136
136
  }
137
137
 
138
- // Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
139
- if (editorExperiment('nested-expand-in-expand', false)) {
140
- if (destParentNodeType === expand && (activeNodeType === expand || activeNodeType === nestedExpand)) {
141
- return false;
142
- }
143
- }
144
-
145
138
  // NOTE: this will block drop targets from showing for dragging a table into another table
146
139
  // unless nested tables are supported and the nesting depth does not exceed 1
147
140
  if ((destParentNodeType === tableCell || destParentNodeType === tableHeader) && activeNodeType === table) {
@@ -158,6 +158,7 @@ const tooltipContainerStyles = css({
158
158
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
159
159
  bottom: `-${STICKY_CONTROLS_TOP_MARGIN}px`,
160
160
  position: 'sticky',
161
+ display: 'block',
161
162
  zIndex: 100 // card = 100
162
163
  });
163
164
  const tooltipContainerStylesStickyHeaderWithMask = css({
@@ -95,6 +95,7 @@ const tooltipContainerStyles = css({
95
95
  top: '8px',
96
96
  bottom: '-8px',
97
97
  position: 'sticky',
98
+ display: 'block',
98
99
  zIndex: 'card'
99
100
  });
100
101
  const tooltipContainerStylesStickyHeader = css({
@@ -23,7 +23,9 @@ export var findHandleDec = function findHandleDec(decorations, from, to) {
23
23
  });
24
24
  };
25
25
  export var dragHandleDecoration = function dragHandleDecoration(api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache) {
26
- unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
26
+ if (!fg('platform_editor_fix_widget_destroy')) {
27
+ unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drag-handle-container', 'data-blocks-drag-handle-key');
28
+ }
27
29
  var unbind;
28
30
  var key = uuid();
29
31
  return Decoration.widget(pos, function (view, getPosUnsafe) {
@@ -114,8 +116,12 @@ export var dragHandleDecoration = function dragHandleDecoration(api, formatMessa
114
116
  side: -1,
115
117
  type: TYPE_HANDLE_DEC,
116
118
  testid: "".concat(TYPE_HANDLE_DEC, "-").concat(uuid()),
117
- destroy: function destroy() {
118
- return unbind && unbind();
119
+ destroy: function destroy(node) {
120
+ unbind && unbind();
121
+ if (fg('platform_editor_fix_widget_destroy')) {
122
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
123
+ ReactDOM.unmountComponentAtNode(node);
124
+ }
119
125
  }
120
126
  });
121
127
  };
@@ -50,6 +50,11 @@ export var quickInsertButtonDecoration = function quickInsertButtonDecoration(ap
50
50
  return element;
51
51
  }, {
52
52
  side: -2,
53
- type: TYPE_QUICK_INSERT
53
+ type: TYPE_QUICK_INSERT,
54
+ destroy: function destroy(_) {
55
+ if (fg('platform_editor_fix_widget_destroy')) {
56
+ nodeViewPortalProviderAPI.remove(key);
57
+ }
58
+ }
54
59
  });
55
60
  };
@@ -134,13 +134,6 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
134
134
  }
135
135
  }
136
136
 
137
- // Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
138
- if (editorExperiment('nested-expand-in-expand', false)) {
139
- if (destParentNodeType === expand && (activeNodeType === expand || activeNodeType === nestedExpand)) {
140
- return false;
141
- }
142
- }
143
-
144
137
  // NOTE: this will block drop targets from showing for dragging a table into another table
145
138
  // unless nested tables are supported and the nesting depth does not exceed 1
146
139
  if ((destParentNodeType === tableCell || destParentNodeType === tableHeader) && activeNodeType === table) {
@@ -163,6 +163,7 @@ var tooltipContainerStyles = css({
163
163
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
164
164
  bottom: "-".concat(STICKY_CONTROLS_TOP_MARGIN, "px"),
165
165
  position: 'sticky',
166
+ display: 'block',
166
167
  zIndex: 100 // card = 100
167
168
  });
168
169
  var tooltipContainerStylesStickyHeaderWithMask = css({
@@ -99,6 +99,7 @@ var tooltipContainerStyles = css({
99
99
  top: '8px',
100
100
  bottom: '-8px',
101
101
  position: 'sticky',
102
+ display: 'block',
102
103
  zIndex: 'card'
103
104
  });
104
105
  var tooltipContainerStylesStickyHeader = css({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "3.10.2",
3
+ "version": "3.10.3",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,15 +33,15 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^103.8.0",
36
+ "@atlaskit/editor-common": "^103.9.0",
37
37
  "@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
40
40
  "@atlaskit/editor-plugin-feature-flags": "^1.4.0",
41
41
  "@atlaskit/editor-plugin-metrics": "^3.4.0",
42
- "@atlaskit/editor-plugin-quick-insert": "^2.3.0",
42
+ "@atlaskit/editor-plugin-quick-insert": "^2.4.0",
43
43
  "@atlaskit/editor-plugin-selection": "^2.1.0",
44
- "@atlaskit/editor-plugin-type-ahead": "^2.4.0",
44
+ "@atlaskit/editor-plugin-type-ahead": "^2.5.0",
45
45
  "@atlaskit/editor-plugin-width": "^3.0.0",
46
46
  "@atlaskit/editor-prosemirror": "7.0.0",
47
47
  "@atlaskit/editor-shared-styles": "^3.4.0",
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.1.0",
54
54
  "@atlaskit/primitives": "^14.4.0",
55
55
  "@atlaskit/theme": "^18.0.0",
56
- "@atlaskit/tmp-editor-statsig": "^4.10.0",
56
+ "@atlaskit/tmp-editor-statsig": "^4.12.0",
57
57
  "@atlaskit/tokens": "^4.8.0",
58
58
  "@atlaskit/tooltip": "^20.0.0",
59
59
  "@babel/runtime": "^7.0.0",
@@ -178,6 +178,9 @@
178
178
  },
179
179
  "platform_editor_controls_sticky_mask": {
180
180
  "type": "boolean"
181
+ },
182
+ "platform_editor_fix_widget_destroy": {
183
+ "type": "boolean"
181
184
  }
182
185
  }
183
186
  }