@atlaskit/editor-plugin-block-controls 7.2.5 → 7.2.7

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
+ ## 7.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.2.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`0b4cd77e72217`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b4cd77e72217) -
14
+ clean up references to platform_editor_controls_performance_fixes
15
+ - Updated dependencies
16
+
3
17
  ## 7.2.5
4
18
 
5
19
  ### Patch Changes
@@ -11,7 +11,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
11
11
  var _ui = require("@atlaskit/editor-common/ui");
12
12
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
13
13
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
14
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
14
  var _blockMenuItems = require("./block-menu-items");
16
15
  var _consts = require("./consts");
17
16
  var _domAttrName = require("./utils/dom-attr-name");
@@ -95,70 +94,17 @@ var BlockMenu = function BlockMenu(_ref3) {
95
94
  if (isMenuOpen) {
96
95
  return null;
97
96
  }
98
- if ((0, _experiments.editorExperiment)('platform_editor_controls_performance_fixes', true)) {
99
- if (!menuTriggerBy) {
100
- return null;
101
- }
102
- return /*#__PURE__*/_react.default.createElement(BlockMenuContent, {
103
- editorView: editorView,
104
- mountPoint: mountPoint,
105
- boundariesElement: boundariesElement,
106
- scrollableElement: scrollableElement,
107
- api: api,
108
- menuTriggerBy: menuTriggerBy,
109
- formatMessage: formatMessage
110
- });
97
+ if (!menuTriggerBy) {
98
+ return null;
111
99
  }
112
- var activeNodeSelector = "[".concat((0, _domAttrName.getAnchorAttrName)(), "=").concat(menuTriggerBy, "]");
113
- var targetHandleRef = document.querySelector(activeNodeSelector);
114
- var items = (0, _blockMenuItems.getBlockMenuItems)(formatMessage);
115
- var handleOpenChange = function handleOpenChange(payload) {
116
- if (!(payload !== null && payload !== void 0 && payload.isOpen)) {
117
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
118
- closeMenu: true
119
- }));
120
- }
121
- };
122
- var onMenuItemActivated = function onMenuItemActivated(_ref4) {
123
- var item = _ref4.item;
124
- if (editorView) {
125
- var _menuItemsCallback2, _menuItemsCallback2$c;
126
- (_menuItemsCallback2 = _blockMenuItems.menuItemsCallback[item.value.name]) === null || _menuItemsCallback2 === void 0 || (_menuItemsCallback2$c = _menuItemsCallback2.call(_blockMenuItems.menuItemsCallback, api, formatMessage)) === null || _menuItemsCallback2$c === void 0 || _menuItemsCallback2$c(editorView.state, editorView.dispatch, editorView);
127
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
128
- closeMenu: true
129
- }));
130
- }
131
- };
132
- return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
133
- alignX: 'left',
134
- alignY: 'start'
135
- // Ignored via go/ees005
136
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
137
- ,
138
- target: targetHandleRef,
139
- mountTo: undefined,
140
- zIndex: _editorSharedStyles.akEditorFloatingOverlapPanelZIndex,
141
- forcePlacement: true,
142
- stick: true,
143
- offset: [-6, 8]
144
- }, /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenu, {
145
- mountTo: mountPoint,
100
+ return /*#__PURE__*/_react.default.createElement(BlockMenuContent, {
101
+ editorView: editorView,
102
+ mountPoint: mountPoint,
146
103
  boundariesElement: boundariesElement,
147
- scrollableElement: scrollableElement
148
- //This needs be removed when the a11y is completely handled
149
- //Disabling key navigation now as it works only partially
150
- ,
151
- arrowKeyNavigationProviderOptions: {
152
- type: _uiMenu.ArrowKeyNavigationType.MENU
153
- },
154
- items: items,
155
- isOpen: true,
156
- fitWidth: _consts.BLOCK_MENU_WIDTH,
157
- section: {
158
- hasSeparator: true
159
- },
160
- onOpenChange: handleOpenChange,
161
- onItemActivated: onMenuItemActivated
162
- }));
104
+ scrollableElement: scrollableElement,
105
+ api: api,
106
+ menuTriggerBy: menuTriggerBy,
107
+ formatMessage: formatMessage
108
+ });
163
109
  };
164
110
  var _default = exports.default = (0, _reactIntlNext.injectIntl)(BlockMenu);
@@ -4,7 +4,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
4
4
  import { Popup } from '@atlaskit/editor-common/ui';
5
5
  import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
6
6
  import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
7
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
7
  import { getBlockMenuItems, menuItemsCallback } from './block-menu-items';
9
8
  import { BLOCK_MENU_WIDTH } from './consts';
10
9
  import { getAnchorAttrName } from './utils/dom-attr-name';
@@ -93,71 +92,17 @@ const BlockMenu = ({
93
92
  if (isMenuOpen) {
94
93
  return null;
95
94
  }
96
- if (editorExperiment('platform_editor_controls_performance_fixes', true)) {
97
- if (!menuTriggerBy) {
98
- return null;
99
- }
100
- return /*#__PURE__*/React.createElement(BlockMenuContent, {
101
- editorView: editorView,
102
- mountPoint: mountPoint,
103
- boundariesElement: boundariesElement,
104
- scrollableElement: scrollableElement,
105
- api: api,
106
- menuTriggerBy: menuTriggerBy,
107
- formatMessage: formatMessage
108
- });
95
+ if (!menuTriggerBy) {
96
+ return null;
109
97
  }
110
- const activeNodeSelector = `[${getAnchorAttrName()}=${menuTriggerBy}]`;
111
- const targetHandleRef = document.querySelector(activeNodeSelector);
112
- const items = getBlockMenuItems(formatMessage);
113
- const handleOpenChange = payload => {
114
- if (!(payload !== null && payload !== void 0 && payload.isOpen)) {
115
- api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
116
- closeMenu: true
117
- }));
118
- }
119
- };
120
- const onMenuItemActivated = ({
121
- item
122
- }) => {
123
- if (editorView) {
124
- var _menuItemsCallback2, _menuItemsCallback2$c;
125
- (_menuItemsCallback2 = menuItemsCallback[item.value.name]) === null || _menuItemsCallback2 === void 0 ? void 0 : (_menuItemsCallback2$c = _menuItemsCallback2.call(menuItemsCallback, api, formatMessage)) === null || _menuItemsCallback2$c === void 0 ? void 0 : _menuItemsCallback2$c(editorView.state, editorView.dispatch, editorView);
126
- api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
127
- closeMenu: true
128
- }));
129
- }
130
- };
131
- return /*#__PURE__*/React.createElement(Popup, {
132
- alignX: 'left',
133
- alignY: 'start'
134
- // Ignored via go/ees005
135
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
136
- ,
137
- target: targetHandleRef,
138
- mountTo: undefined,
139
- zIndex: akEditorFloatingOverlapPanelZIndex,
140
- forcePlacement: true,
141
- stick: true,
142
- offset: [-6, 8]
143
- }, /*#__PURE__*/React.createElement(DropdownMenu, {
144
- mountTo: mountPoint,
98
+ return /*#__PURE__*/React.createElement(BlockMenuContent, {
99
+ editorView: editorView,
100
+ mountPoint: mountPoint,
145
101
  boundariesElement: boundariesElement,
146
- scrollableElement: scrollableElement
147
- //This needs be removed when the a11y is completely handled
148
- //Disabling key navigation now as it works only partially
149
- ,
150
- arrowKeyNavigationProviderOptions: {
151
- type: ArrowKeyNavigationType.MENU
152
- },
153
- items: items,
154
- isOpen: true,
155
- fitWidth: BLOCK_MENU_WIDTH,
156
- section: {
157
- hasSeparator: true
158
- },
159
- onOpenChange: handleOpenChange,
160
- onItemActivated: onMenuItemActivated
161
- }));
102
+ scrollableElement: scrollableElement,
103
+ api: api,
104
+ menuTriggerBy: menuTriggerBy,
105
+ formatMessage: formatMessage
106
+ });
162
107
  };
163
108
  export default injectIntl(BlockMenu);
@@ -4,7 +4,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
4
4
  import { Popup } from '@atlaskit/editor-common/ui';
5
5
  import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
6
6
  import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
7
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
7
  import { getBlockMenuItems, menuItemsCallback } from './block-menu-items';
9
8
  import { BLOCK_MENU_WIDTH } from './consts';
10
9
  import { getAnchorAttrName } from './utils/dom-attr-name';
@@ -87,70 +86,17 @@ var BlockMenu = function BlockMenu(_ref3) {
87
86
  if (isMenuOpen) {
88
87
  return null;
89
88
  }
90
- if (editorExperiment('platform_editor_controls_performance_fixes', true)) {
91
- if (!menuTriggerBy) {
92
- return null;
93
- }
94
- return /*#__PURE__*/React.createElement(BlockMenuContent, {
95
- editorView: editorView,
96
- mountPoint: mountPoint,
97
- boundariesElement: boundariesElement,
98
- scrollableElement: scrollableElement,
99
- api: api,
100
- menuTriggerBy: menuTriggerBy,
101
- formatMessage: formatMessage
102
- });
89
+ if (!menuTriggerBy) {
90
+ return null;
103
91
  }
104
- var activeNodeSelector = "[".concat(getAnchorAttrName(), "=").concat(menuTriggerBy, "]");
105
- var targetHandleRef = document.querySelector(activeNodeSelector);
106
- var items = getBlockMenuItems(formatMessage);
107
- var handleOpenChange = function handleOpenChange(payload) {
108
- if (!(payload !== null && payload !== void 0 && payload.isOpen)) {
109
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
110
- closeMenu: true
111
- }));
112
- }
113
- };
114
- var onMenuItemActivated = function onMenuItemActivated(_ref4) {
115
- var item = _ref4.item;
116
- if (editorView) {
117
- var _menuItemsCallback2, _menuItemsCallback2$c;
118
- (_menuItemsCallback2 = menuItemsCallback[item.value.name]) === null || _menuItemsCallback2 === void 0 || (_menuItemsCallback2$c = _menuItemsCallback2.call(menuItemsCallback, api, formatMessage)) === null || _menuItemsCallback2$c === void 0 || _menuItemsCallback2$c(editorView.state, editorView.dispatch, editorView);
119
- api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
120
- closeMenu: true
121
- }));
122
- }
123
- };
124
- return /*#__PURE__*/React.createElement(Popup, {
125
- alignX: 'left',
126
- alignY: 'start'
127
- // Ignored via go/ees005
128
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
129
- ,
130
- target: targetHandleRef,
131
- mountTo: undefined,
132
- zIndex: akEditorFloatingOverlapPanelZIndex,
133
- forcePlacement: true,
134
- stick: true,
135
- offset: [-6, 8]
136
- }, /*#__PURE__*/React.createElement(DropdownMenu, {
137
- mountTo: mountPoint,
92
+ return /*#__PURE__*/React.createElement(BlockMenuContent, {
93
+ editorView: editorView,
94
+ mountPoint: mountPoint,
138
95
  boundariesElement: boundariesElement,
139
- scrollableElement: scrollableElement
140
- //This needs be removed when the a11y is completely handled
141
- //Disabling key navigation now as it works only partially
142
- ,
143
- arrowKeyNavigationProviderOptions: {
144
- type: ArrowKeyNavigationType.MENU
145
- },
146
- items: items,
147
- isOpen: true,
148
- fitWidth: BLOCK_MENU_WIDTH,
149
- section: {
150
- hasSeparator: true
151
- },
152
- onOpenChange: handleOpenChange,
153
- onItemActivated: onMenuItemActivated
154
- }));
96
+ scrollableElement: scrollableElement,
97
+ api: api,
98
+ menuTriggerBy: menuTriggerBy,
99
+ formatMessage: formatMessage
100
+ });
155
101
  };
156
102
  export default injectIntl(BlockMenu);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "7.2.5",
3
+ "version": "7.2.7",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,18 +31,18 @@
31
31
  "@atlaskit/adf-schema": "^51.2.0",
32
32
  "@atlaskit/editor-plugin-accessibility-utils": "^6.0.0",
33
33
  "@atlaskit/editor-plugin-analytics": "^6.1.0",
34
- "@atlaskit/editor-plugin-editor-disabled": "^6.0.0",
34
+ "@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
35
35
  "@atlaskit/editor-plugin-feature-flags": "^5.0.0",
36
36
  "@atlaskit/editor-plugin-interaction": "^8.0.0",
37
37
  "@atlaskit/editor-plugin-limited-mode": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-metrics": "^7.0.0",
39
39
  "@atlaskit/editor-plugin-quick-insert": "^6.0.0",
40
40
  "@atlaskit/editor-plugin-selection": "^6.1.0",
41
- "@atlaskit/editor-plugin-type-ahead": "^6.3.0",
41
+ "@atlaskit/editor-plugin-type-ahead": "^6.4.0",
42
42
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
43
43
  "@atlaskit/editor-plugin-width": "^7.0.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
45
- "@atlaskit/editor-shared-styles": "^3.6.0",
45
+ "@atlaskit/editor-shared-styles": "^3.7.0",
46
46
  "@atlaskit/editor-tables": "^2.9.0",
47
47
  "@atlaskit/icon": "^28.5.0",
48
48
  "@atlaskit/link": "^3.2.0",
@@ -50,10 +50,10 @@
50
50
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
52
52
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
53
- "@atlaskit/primitives": "^14.15.0",
53
+ "@atlaskit/primitives": "^15.0.0",
54
54
  "@atlaskit/theme": "^21.0.0",
55
- "@atlaskit/tmp-editor-statsig": "^13.5.0",
56
- "@atlaskit/tokens": "^6.4.0",
55
+ "@atlaskit/tmp-editor-statsig": "^13.10.0",
56
+ "@atlaskit/tokens": "^6.5.0",
57
57
  "@atlaskit/tooltip": "^20.5.0",
58
58
  "@babel/runtime": "^7.0.0",
59
59
  "@emotion/react": "^11.7.1",
@@ -64,7 +64,7 @@
64
64
  "uuid": "^3.1.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@atlaskit/editor-common": "^110.8.0",
67
+ "@atlaskit/editor-common": "^110.12.0",
68
68
  "react": "^18.2.0",
69
69
  "react-dom": "^18.2.0",
70
70
  "react-intl-next": "npm:react-intl@^5.18.1"