@atlaskit/editor-plugin-block-controls 19.0.4 → 19.0.6

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,21 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 19.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9e6211ceb4ceb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9e6211ceb4ceb) -
8
+ Clean up the fully rolled-out `platform_editor_small_font_size` experiment and make its permanent
9
+ `true` behavior unconditional across editor formatting, task and list handling, paste behavior,
10
+ controls, and rendering.
11
+ - Updated dependencies
12
+
13
+ ## 19.0.5
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 19.0.4
4
20
 
5
21
  ### Patch Changes
@@ -33,7 +33,7 @@ var getSubType = function getSubType(node) {
33
33
  return '';
34
34
  };
35
35
  var getNodeTypeWithLevel = exports.getNodeTypeWithLevel = function getNodeTypeWithLevel(node) {
36
- var subType = (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) ? getSubType(node) : node.attrs.level ? "-".concat(node.attrs.level) : '';
36
+ var subType = getSubType(node);
37
37
  var typeName = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? (0, _nodeTypeUtils.getBaseNodeTypeName)(node.type) : node.type.name;
38
38
  return typeName + subType;
39
39
  };
@@ -10,7 +10,6 @@ var _react = require("react");
10
10
  var _uuid = require("uuid");
11
11
  var _view = require("@atlaskit/editor-prosemirror/view");
12
12
  var _fg = require("@atlaskit/platform-feature-flags/fg");
13
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
13
  var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
15
14
  var _consts = require("../ui/consts");
16
15
  var _dragHandle = require("../ui/drag-handle");
@@ -73,13 +72,13 @@ var dragHandleDecoration = exports.dragHandleDecoration = function dragHandleDec
73
72
  * Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
74
73
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
75
74
  */
76
- marks: (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) ? (0, _marks.getMatchingBlockMarks)(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : []
75
+ marks: (0, _marks.getMatchingBlockMarks)(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
77
76
  } : {
78
77
  side: -1,
79
78
  type: _decorationsCommon.TYPE_HANDLE_DEC,
80
79
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
81
80
  testid: "".concat(_decorationsCommon.TYPE_HANDLE_DEC, "-").concat((0, _uuid.v4)()),
82
- marks: (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) ? (0, _marks.getMatchingBlockMarks)(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : []
81
+ marks: (0, _marks.getMatchingBlockMarks)(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
83
82
  };
84
83
  return _view.Decoration.widget(pos, function (view, getPosUnsafe) {
85
84
  var element = document.createElement('span');
@@ -10,7 +10,6 @@ var _react = require("react");
10
10
  var _uuid = require("uuid");
11
11
  var _view = require("@atlaskit/editor-prosemirror/view");
12
12
  var _fg = require("@atlaskit/platform-feature-flags/fg");
13
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
13
  var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
15
14
  var _consts = require("../ui/consts");
16
15
  var _quickInsertButton = require("../ui/quick-insert-button");
@@ -62,7 +61,7 @@ var quickInsertButtonDecoration = exports.quickInsertButtonDecoration = function
62
61
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
63
62
  */
64
63
 
65
- marks: (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) ? (0, _marks.getMatchingBlockMarks)(editorState, rootPos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : [],
64
+ marks: (0, _marks.getMatchingBlockMarks)(editorState, rootPos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]),
66
65
  destroy: function destroy(_) {
67
66
  nodeViewPortalProviderAPI.remove(key);
68
67
  cleanupCallbacks.forEach(function (cb) {
@@ -62,7 +62,7 @@ var isPanelNodeTypeName = function isPanelNodeTypeName(nodeTypeName) {
62
62
  // the mark wrapper instead of the panel content container. When that happens, recalculate
63
63
  // the index relative to the panel content so the first-child check stays accurate.
64
64
  var getBlockMarkPanelIndexAdjustment = function getBlockMarkPanelIndexAdjustment(parentRootElement, index) {
65
- if ((0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) && parentRootElement.classList.contains('fabric-editor-block-mark') && parentRootElement.parentElement) {
65
+ if (parentRootElement.classList.contains('fabric-editor-block-mark') && parentRootElement.parentElement) {
66
66
  return Array.from(parentRootElement.parentElement.childNodes).indexOf(parentRootElement);
67
67
  }
68
68
  return index;
@@ -243,7 +243,7 @@ var TypeAheadControl = exports.TypeAheadControl = function TypeAheadControl(_ref
243
243
  return _objectSpread({
244
244
  left: isEdgeCase ? "calc(".concat(anchorStart, " + ").concat((0, _widgetPositions.getLeftPositionForRootElement)(dom, rootNodeType, _consts.QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(_consts.QUICK_INSERT_LEFT_OFFSET, "px)") : "calc(".concat(anchorStart, " - ").concat(_consts.QUICK_INSERT_DIMENSIONS.width, "px - ").concat((0, _consts.rootElementGap)(rootNodeType), "px + -").concat(_consts.QUICK_INSERT_LEFT_OFFSET, "px)"),
245
245
  // small text requires further tweaking to positioning, re-using existing methods to calculate to keep it unified with drag handle
246
- top: "calc(".concat(anchorStart, " + ").concat((0, _consts.topPositionAdjustment)(node && node.type.name === 'paragraph' && (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) ? (0, _decorationsCommon.getNodeTypeWithLevel)(node) : rootNodeType), "px)")
246
+ top: "calc(".concat(anchorStart, " + ").concat((0, _consts.topPositionAdjustment)(node && node.type.name === 'paragraph' ? (0, _decorationsCommon.getNodeTypeWithLevel)(node) : rootNodeType), "px)")
247
247
  }, bottom);
248
248
  }
249
249
 
@@ -23,7 +23,7 @@ const getSubType = node => {
23
23
  return '';
24
24
  };
25
25
  export const getNodeTypeWithLevel = node => {
26
- const subType = expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getSubType(node) : node.attrs.level ? `-${node.attrs.level}` : '';
26
+ const subType = getSubType(node);
27
27
  const typeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(node.type) : node.type.name;
28
28
  return typeName + subType;
29
29
  };
@@ -3,7 +3,6 @@ import { createElement } from 'react';
3
3
  import { v4 as uuid } from 'uuid';
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
5
  import { fg } from '@atlaskit/platform-feature-flags/fg';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
8
7
  import { ACTIVE_DRAG_HANDLE_ATTR } from '../ui/consts';
9
8
  import { DragHandle, DragHandleWithVisibility } from '../ui/drag-handle';
@@ -60,13 +59,13 @@ export const dragHandleDecoration = ({
60
59
  * Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
61
60
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
62
61
  */
63
- marks: expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : []
62
+ marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
64
63
  } : {
65
64
  side: -1,
66
65
  type: TYPE_HANDLE_DEC,
67
66
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
68
67
  testid: `${TYPE_HANDLE_DEC}-${uuid()}`,
69
- marks: expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : []
68
+ marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
70
69
  };
71
70
  return Decoration.widget(pos, (view, getPosUnsafe) => {
72
71
  const element = document.createElement('span');
@@ -3,7 +3,6 @@ import { createElement } from 'react';
3
3
  import { v4 as uuid } from 'uuid';
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
5
  import { fg } from '@atlaskit/platform-feature-flags/fg';
6
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
8
7
  import { ACTIVE_QUICK_INSERT_ATTR } from '../ui/consts';
9
8
  import { QuickInsertWithVisibility } from '../ui/quick-insert-button';
@@ -48,7 +47,7 @@ export const quickInsertButtonDecoration = ({
48
47
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
49
48
  */
50
49
 
51
- marks: expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getMatchingBlockMarks(editorState, rootPos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : [],
50
+ marks: getMatchingBlockMarks(editorState, rootPos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]),
52
51
  destroy: _ => {
53
52
  nodeViewPortalProviderAPI.remove(key);
54
53
  cleanupCallbacks.forEach(cb => {
@@ -52,7 +52,7 @@ const isPanelNodeTypeName = nodeTypeName => {
52
52
  // the mark wrapper instead of the panel content container. When that happens, recalculate
53
53
  // the index relative to the panel content so the first-child check stays accurate.
54
54
  const getBlockMarkPanelIndexAdjustment = (parentRootElement, index) => {
55
- if (expValEquals('platform_editor_small_font_size', 'isEnabled', true) && parentRootElement.classList.contains('fabric-editor-block-mark') && parentRootElement.parentElement) {
55
+ if (parentRootElement.classList.contains('fabric-editor-block-mark') && parentRootElement.parentElement) {
56
56
  return Array.from(parentRootElement.parentElement.childNodes).indexOf(parentRootElement);
57
57
  }
58
58
  return index;
@@ -233,7 +233,7 @@ export const TypeAheadControl = ({
233
233
  return {
234
234
  left: isEdgeCase ? `calc(${anchorStart} + ${getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates)} + -${QUICK_INSERT_LEFT_OFFSET}px)` : `calc(${anchorStart} - ${QUICK_INSERT_DIMENSIONS.width}px - ${rootElementGap(rootNodeType)}px + -${QUICK_INSERT_LEFT_OFFSET}px)`,
235
235
  // small text requires further tweaking to positioning, re-using existing methods to calculate to keep it unified with drag handle
236
- top: `calc(${anchorStart} + ${topPositionAdjustment(node && node.type.name === 'paragraph' && expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getNodeTypeWithLevel(node) : rootNodeType)}px)`,
236
+ top: `calc(${anchorStart} + ${topPositionAdjustment(node && node.type.name === 'paragraph' ? getNodeTypeWithLevel(node) : rootNodeType)}px)`,
237
237
  ...bottom
238
238
  };
239
239
  }
@@ -25,7 +25,7 @@ var getSubType = function getSubType(node) {
25
25
  return '';
26
26
  };
27
27
  export var getNodeTypeWithLevel = function getNodeTypeWithLevel(node) {
28
- var subType = expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getSubType(node) : node.attrs.level ? "-".concat(node.attrs.level) : '';
28
+ var subType = getSubType(node);
29
29
  var typeName = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? getBaseNodeTypeName(node.type) : node.type.name;
30
30
  return typeName + subType;
31
31
  };
@@ -4,7 +4,6 @@ import { createElement } from 'react';
4
4
  import { v4 as uuid } from 'uuid';
5
5
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
6
  import { fg } from '@atlaskit/platform-feature-flags/fg';
7
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
9
8
  import { ACTIVE_DRAG_HANDLE_ATTR } from '../ui/consts';
10
9
  import { DragHandle, DragHandleWithVisibility } from '../ui/drag-handle';
@@ -65,13 +64,13 @@ export var dragHandleDecoration = function dragHandleDecoration(_ref) {
65
64
  * Exclude 'breakout' on purpose, so the widgets render at the top of the document to avoid z-index issues
66
65
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
67
66
  */
68
- marks: expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : []
67
+ marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
69
68
  } : {
70
69
  side: -1,
71
70
  type: TYPE_HANDLE_DEC,
72
71
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
73
72
  testid: "".concat(TYPE_HANDLE_DEC, "-").concat(uuid()),
74
- marks: expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : []
73
+ marks: getMatchingBlockMarks(editorState, pos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize])
75
74
  };
76
75
  return Decoration.widget(pos, function (view, getPosUnsafe) {
77
76
  var element = document.createElement('span');
@@ -4,7 +4,6 @@ import { createElement } from 'react';
4
4
  import { v4 as uuid } from 'uuid';
5
5
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
6
  import { fg } from '@atlaskit/platform-feature-flags/fg';
7
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
9
8
  import { ACTIVE_QUICK_INSERT_ATTR } from '../ui/consts';
10
9
  import { QuickInsertWithVisibility } from '../ui/quick-insert-button';
@@ -54,7 +53,7 @@ export var quickInsertButtonDecoration = function quickInsertButtonDecoration(_r
54
53
  * Other block marks must be added, otherwise PM will split the DOM elements causing mutations and re-draws
55
54
  */
56
55
 
57
- marks: expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getMatchingBlockMarks(editorState, rootPos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]) : [],
56
+ marks: getMatchingBlockMarks(editorState, rootPos, [editorState.schema.marks.alignment, editorState.schema.marks.fontSize]),
58
57
  destroy: function destroy(_) {
59
58
  nodeViewPortalProviderAPI.remove(key);
60
59
  cleanupCallbacks.forEach(function (cb) {
@@ -55,7 +55,7 @@ var isPanelNodeTypeName = function isPanelNodeTypeName(nodeTypeName) {
55
55
  // the mark wrapper instead of the panel content container. When that happens, recalculate
56
56
  // the index relative to the panel content so the first-child check stays accurate.
57
57
  var getBlockMarkPanelIndexAdjustment = function getBlockMarkPanelIndexAdjustment(parentRootElement, index) {
58
- if (expValEquals('platform_editor_small_font_size', 'isEnabled', true) && parentRootElement.classList.contains('fabric-editor-block-mark') && parentRootElement.parentElement) {
58
+ if (parentRootElement.classList.contains('fabric-editor-block-mark') && parentRootElement.parentElement) {
59
59
  return Array.from(parentRootElement.parentElement.childNodes).indexOf(parentRootElement);
60
60
  }
61
61
  return index;
@@ -237,7 +237,7 @@ export var TypeAheadControl = function TypeAheadControl(_ref2) {
237
237
  return _objectSpread({
238
238
  left: isEdgeCase ? "calc(".concat(anchorStart, " + ").concat(getLeftPositionForRootElement(dom, rootNodeType, QUICK_INSERT_DIMENSIONS, innerContainer, isMacroInteractionUpdates), " + -").concat(QUICK_INSERT_LEFT_OFFSET, "px)") : "calc(".concat(anchorStart, " - ").concat(QUICK_INSERT_DIMENSIONS.width, "px - ").concat(rootElementGap(rootNodeType), "px + -").concat(QUICK_INSERT_LEFT_OFFSET, "px)"),
239
239
  // small text requires further tweaking to positioning, re-using existing methods to calculate to keep it unified with drag handle
240
- top: "calc(".concat(anchorStart, " + ").concat(topPositionAdjustment(node && node.type.name === 'paragraph' && expValEquals('platform_editor_small_font_size', 'isEnabled', true) ? getNodeTypeWithLevel(node) : rootNodeType), "px)")
240
+ top: "calc(".concat(anchorStart, " + ").concat(topPositionAdjustment(node && node.type.name === 'paragraph' ? getNodeTypeWithLevel(node) : rootNodeType), "px)")
241
241
  }, bottom);
242
242
  }
243
243
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "19.0.4",
3
+ "version": "19.0.6",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -45,8 +45,8 @@
45
45
  "@atlaskit/editor-shared-styles": "^4.3.0",
46
46
  "@atlaskit/editor-tables": "^3.2.0",
47
47
  "@atlaskit/editor-ui-control-model": "^2.9.0",
48
- "@atlaskit/icon": "^37.6.0",
49
- "@atlaskit/icon-lab": "^7.8.0",
48
+ "@atlaskit/icon": "^37.7.0",
49
+ "@atlaskit/icon-lab": "^7.9.0",
50
50
  "@atlaskit/link": "^5.1.0",
51
51
  "@atlaskit/platform-feature-experiments": "^0.3.0",
52
52
  "@atlaskit/platform-feature-flags": "^2.2.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/primitives": "^22.5.0",
57
57
  "@atlaskit/section-message": "^10.2.0",
58
58
  "@atlaskit/theme": "^28.2.0",
59
- "@atlaskit/tmp-editor-statsig": "^192.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^194.0.0",
60
60
  "@atlaskit/tokens": "^16.12.0",
61
61
  "@atlaskit/tooltip": "^24.3.0",
62
62
  "@babel/runtime": "^7.0.0",
@@ -68,7 +68,7 @@
68
68
  "uuid": "^11.1.1"
69
69
  },
70
70
  "peerDependencies": {
71
- "@atlaskit/editor-common": "^122.3.0",
71
+ "@atlaskit/editor-common": "^122.6.0",
72
72
  "react": "^18.2.0 || ^19.2.0",
73
73
  "react-dom": "^18.2.0 || ^19.2.0",
74
74
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"