@atlaskit/editor-plugin-block-menu 11.1.12 → 11.1.14

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-menu
2
2
 
3
+ ## 11.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.1.13
10
+
11
+ ### Patch Changes
12
+
13
+ - [`1e9a079140e1f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1e9a079140e1f) -
14
+ Clean up launched block menu Jira patch feature gates.
15
+ - Updated dependencies
16
+
3
17
  ## 11.1.12
4
18
 
5
19
  ### Patch Changes
@@ -50,6 +50,7 @@ var transformNode = exports.transformNode = function transformNode(api) {
50
50
  var isEmptyLine = sourceNodes.length === 1 && (sourceNodes[0].type === nodes.paragraph || sourceNodes[0].type === nodes.heading) && (sourceNodes[0].content.size === 0 || sourceNodes[0].textContent.trim() === '');
51
51
  var isSuggested = Boolean(metadata === null || metadata === void 0 ? void 0 : metadata.isSuggested);
52
52
  try {
53
+ var _api$blockControls4;
53
54
  var resultNodes = (0, _transform2.convertNodesToTargetType)({
54
55
  sourceNodes: sourceNodes,
55
56
  targetNodeType: targetType,
@@ -105,14 +106,11 @@ var transformNode = exports.transformNode = function transformNode(api) {
105
106
  });
106
107
  }
107
108
  }
108
- if ((0, _platformFeatureFlags.fg)('platform_editor_block_menu_jira_patch_3')) {
109
- var _api$blockControls4;
110
- api === null || api === void 0 || (_api$blockControls4 = api.blockControls) === null || _api$blockControls4 === void 0 || _api$blockControls4.commands.toggleBlockMenu({
111
- closeMenu: true
112
- })({
113
- tr: tr
114
- });
115
- }
109
+ api === null || api === void 0 || (_api$blockControls4 = api.blockControls) === null || _api$blockControls4 === void 0 || _api$blockControls4.commands.toggleBlockMenu({
110
+ closeMenu: true
111
+ })({
112
+ tr: tr
113
+ });
116
114
  (0, _performanceMeasures.stopMeasure)(measureId, function (duration, startTime) {
117
115
  var _api$analytics;
118
116
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent({
@@ -23,7 +23,6 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
23
23
  var _uiReact = require("@atlaskit/editor-common/ui-react");
24
24
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
25
25
  var _toolbarMenuContainer = require("@atlaskit/editor-toolbar/toolbar-menu-container");
26
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
26
  var _compiled = require("@atlaskit/primitives/compiled");
28
27
  var _prosemirrorHistory = require("@atlaskit/prosemirror-history");
29
28
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
@@ -198,7 +197,6 @@ var BlockMenu = function BlockMenu(_ref5) {
198
197
  var _useBlockMenu = (0, _blockMenuProvider.useBlockMenu)(),
199
198
  onDropdownOpenChanged = _useBlockMenu.onDropdownOpenChanged;
200
199
  var targetHandleRef = editorView === null || editorView === void 0 || (_editorView$dom = editorView.dom) === null || _editorView$dom === void 0 ? void 0 : _editorView$dom.querySelector(_styles.DRAG_HANDLE_SELECTOR);
201
- var shouldCloseBlockMenuOnResize = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_jira_patch_4');
202
200
  var closeMenu = _react.default.useCallback(function () {
203
201
  api === null || api === void 0 || api.core.actions.execute(function (_ref6) {
204
202
  var _api$blockControls, _api$userIntent2;
@@ -216,7 +214,7 @@ var BlockMenu = function BlockMenu(_ref5) {
216
214
  });
217
215
  }, [api, currentUserIntent, onDropdownOpenChanged]);
218
216
  useCloseBlockMenuOnResize({
219
- isEnabled: Boolean(isMenuOpen && shouldCloseBlockMenuOnResize),
217
+ isEnabled: Boolean(isMenuOpen),
220
218
  mountTo: mountTo,
221
219
  boundariesElement: boundariesElement,
222
220
  scrollableElement: scrollableElement,
@@ -14,7 +14,6 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
14
14
  var _changes = _interopRequireDefault(require("@atlaskit/icon/core/changes"));
15
15
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
17
  var _consts = require("./consts");
19
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
19
  var BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR = '[data-test-id="block-menu-transform-spotlight-portal-container"]';
@@ -26,9 +25,7 @@ var FormatMenuComponent = exports.FormatMenuComponent = function FormatMenuCompo
26
25
  children = _ref.children;
27
26
  var _useIntl = (0, _reactIntl.useIntl)(),
28
27
  formatMessage = _useIntl.formatMessage;
29
-
30
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning -- gate + experiment layering for MAUI rollout (cc-maui-experiment + cc-maui-phase-3); will simplify post-rollout
31
- var formatMenuLabel = (0, _expValEquals.expValEquals)('cc-maui-experiment', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('cc-maui-phase-3') || (0, _platformFeatureFlags.fg)('platform_editor_block_menu_jira_patch_3') ? _messages.blockMenuMessages.changeFormat : _messages.blockMenuMessages.turnInto;
28
+ var formatMenuLabel = _messages.blockMenuMessages.changeFormat;
32
29
  var handleClick = (0, _react.useCallback)(function () {
33
30
  api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
34
31
  var _api$analytics;
@@ -42,6 +42,7 @@ export const transformNode = api => (targetType, metadata) => ({
42
42
  const isEmptyLine = sourceNodes.length === 1 && (sourceNodes[0].type === nodes.paragraph || sourceNodes[0].type === nodes.heading) && (sourceNodes[0].content.size === 0 || sourceNodes[0].textContent.trim() === '');
43
43
  const isSuggested = Boolean(metadata === null || metadata === void 0 ? void 0 : metadata.isSuggested);
44
44
  try {
45
+ var _api$blockControls4;
45
46
  const resultNodes = convertNodesToTargetType({
46
47
  sourceNodes,
47
48
  targetNodeType: targetType,
@@ -95,14 +96,11 @@ export const transformNode = api => (targetType, metadata) => ({
95
96
  });
96
97
  }
97
98
  }
98
- if (fg('platform_editor_block_menu_jira_patch_3')) {
99
- var _api$blockControls4;
100
- api === null || api === void 0 ? void 0 : (_api$blockControls4 = api.blockControls) === null || _api$blockControls4 === void 0 ? void 0 : _api$blockControls4.commands.toggleBlockMenu({
101
- closeMenu: true
102
- })({
103
- tr
104
- });
105
- }
99
+ api === null || api === void 0 ? void 0 : (_api$blockControls4 = api.blockControls) === null || _api$blockControls4 === void 0 ? void 0 : _api$blockControls4.commands.toggleBlockMenu({
100
+ closeMenu: true
101
+ })({
102
+ tr
103
+ });
106
104
  stopMeasure(measureId, (duration, startTime) => {
107
105
  var _api$analytics, _api$analytics$action;
108
106
  api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.attachAnalyticsEvent({
@@ -14,7 +14,6 @@ import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/ed
14
14
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners } from '@atlaskit/editor-common/ui-react';
15
15
  import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
16
16
  import { ToolbarMenuContainer } from '@atlaskit/editor-toolbar/toolbar-menu-container';
17
- import { fg } from '@atlaskit/platform-feature-flags';
18
17
  import { Box } from '@atlaskit/primitives/compiled';
19
18
  import { redo, undo } from '@atlaskit/prosemirror-history';
20
19
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -188,7 +187,6 @@ const BlockMenu = ({
188
187
  onDropdownOpenChanged
189
188
  } = useBlockMenu();
190
189
  const targetHandleRef = editorView === null || editorView === void 0 ? void 0 : (_editorView$dom = editorView.dom) === null || _editorView$dom === void 0 ? void 0 : _editorView$dom.querySelector(DRAG_HANDLE_SELECTOR);
191
- const shouldCloseBlockMenuOnResize = fg('platform_editor_block_menu_jira_patch_4');
192
190
  const closeMenu = React.useCallback(() => {
193
191
  api === null || api === void 0 ? void 0 : api.core.actions.execute(({
194
192
  tr
@@ -207,7 +205,7 @@ const BlockMenu = ({
207
205
  });
208
206
  }, [api, currentUserIntent, onDropdownOpenChanged]);
209
207
  useCloseBlockMenuOnResize({
210
- isEnabled: Boolean(isMenuOpen && shouldCloseBlockMenuOnResize),
208
+ isEnabled: Boolean(isMenuOpen),
211
209
  mountTo,
212
210
  boundariesElement,
213
211
  scrollableElement,
@@ -6,7 +6,6 @@ import { ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
6
6
  import ChangesIcon from '@atlaskit/icon/core/changes';
7
7
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
9
  import { BLOCK_MENU_ITEM_NAME } from './consts';
11
10
  const BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR = '[data-test-id="block-menu-transform-spotlight-portal-container"]';
12
11
  const shouldIgnoreBlockMenuTransformSpotlightCloseEvent = event => event.target instanceof Element && event.target.closest(BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR) !== null;
@@ -17,9 +16,7 @@ export const FormatMenuComponent = ({
17
16
  const {
18
17
  formatMessage
19
18
  } = useIntl();
20
-
21
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning -- gate + experiment layering for MAUI rollout (cc-maui-experiment + cc-maui-phase-3); will simplify post-rollout
22
- const formatMenuLabel = expValEquals('cc-maui-experiment', 'isEnabled', true) && fg('cc-maui-phase-3') || fg('platform_editor_block_menu_jira_patch_3') ? blockMenuMessages.changeFormat : blockMenuMessages.turnInto;
19
+ const formatMenuLabel = blockMenuMessages.changeFormat;
23
20
  const handleClick = useCallback(() => {
24
21
  api === null || api === void 0 ? void 0 : api.core.actions.execute(({
25
22
  tr
@@ -43,6 +43,7 @@ export var transformNode = function transformNode(api) {
43
43
  var isEmptyLine = sourceNodes.length === 1 && (sourceNodes[0].type === nodes.paragraph || sourceNodes[0].type === nodes.heading) && (sourceNodes[0].content.size === 0 || sourceNodes[0].textContent.trim() === '');
44
44
  var isSuggested = Boolean(metadata === null || metadata === void 0 ? void 0 : metadata.isSuggested);
45
45
  try {
46
+ var _api$blockControls4;
46
47
  var resultNodes = convertNodesToTargetType({
47
48
  sourceNodes: sourceNodes,
48
49
  targetNodeType: targetType,
@@ -98,14 +99,11 @@ export var transformNode = function transformNode(api) {
98
99
  });
99
100
  }
100
101
  }
101
- if (fg('platform_editor_block_menu_jira_patch_3')) {
102
- var _api$blockControls4;
103
- api === null || api === void 0 || (_api$blockControls4 = api.blockControls) === null || _api$blockControls4 === void 0 || _api$blockControls4.commands.toggleBlockMenu({
104
- closeMenu: true
105
- })({
106
- tr: tr
107
- });
108
- }
102
+ api === null || api === void 0 || (_api$blockControls4 = api.blockControls) === null || _api$blockControls4 === void 0 || _api$blockControls4.commands.toggleBlockMenu({
103
+ closeMenu: true
104
+ })({
105
+ tr: tr
106
+ });
109
107
  stopMeasure(measureId, function (duration, startTime) {
110
108
  var _api$analytics;
111
109
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent({
@@ -15,7 +15,6 @@ import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/ed
15
15
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners } from '@atlaskit/editor-common/ui-react';
16
16
  import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
17
17
  import { ToolbarMenuContainer } from '@atlaskit/editor-toolbar/toolbar-menu-container';
18
- import { fg } from '@atlaskit/platform-feature-flags';
19
18
  import { Box } from '@atlaskit/primitives/compiled';
20
19
  import { redo, undo } from '@atlaskit/prosemirror-history';
21
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -189,7 +188,6 @@ var BlockMenu = function BlockMenu(_ref5) {
189
188
  var _useBlockMenu = useBlockMenu(),
190
189
  onDropdownOpenChanged = _useBlockMenu.onDropdownOpenChanged;
191
190
  var targetHandleRef = editorView === null || editorView === void 0 || (_editorView$dom = editorView.dom) === null || _editorView$dom === void 0 ? void 0 : _editorView$dom.querySelector(DRAG_HANDLE_SELECTOR);
192
- var shouldCloseBlockMenuOnResize = fg('platform_editor_block_menu_jira_patch_4');
193
191
  var closeMenu = React.useCallback(function () {
194
192
  api === null || api === void 0 || api.core.actions.execute(function (_ref6) {
195
193
  var _api$blockControls, _api$userIntent2;
@@ -207,7 +205,7 @@ var BlockMenu = function BlockMenu(_ref5) {
207
205
  });
208
206
  }, [api, currentUserIntent, onDropdownOpenChanged]);
209
207
  useCloseBlockMenuOnResize({
210
- isEnabled: Boolean(isMenuOpen && shouldCloseBlockMenuOnResize),
208
+ isEnabled: Boolean(isMenuOpen),
211
209
  mountTo: mountTo,
212
210
  boundariesElement: boundariesElement,
213
211
  scrollableElement: scrollableElement,
@@ -6,7 +6,6 @@ import { ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
6
6
  import ChangesIcon from '@atlaskit/icon/core/changes';
7
7
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
9
  import { BLOCK_MENU_ITEM_NAME } from './consts';
11
10
  var BLOCK_MENU_TRANSFORM_SPOTLIGHT_PORTAL_SELECTOR = '[data-test-id="block-menu-transform-spotlight-portal-container"]';
12
11
  var shouldIgnoreBlockMenuTransformSpotlightCloseEvent = function shouldIgnoreBlockMenuTransformSpotlightCloseEvent(event) {
@@ -17,9 +16,7 @@ export var FormatMenuComponent = function FormatMenuComponent(_ref) {
17
16
  children = _ref.children;
18
17
  var _useIntl = useIntl(),
19
18
  formatMessage = _useIntl.formatMessage;
20
-
21
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning -- gate + experiment layering for MAUI rollout (cc-maui-experiment + cc-maui-phase-3); will simplify post-rollout
22
- var formatMenuLabel = expValEquals('cc-maui-experiment', 'isEnabled', true) && fg('cc-maui-phase-3') || fg('platform_editor_block_menu_jira_patch_3') ? blockMenuMessages.changeFormat : blockMenuMessages.turnInto;
19
+ var formatMenuLabel = blockMenuMessages.changeFormat;
23
20
  var handleClick = useCallback(function () {
24
21
  api === null || api === void 0 || api.core.actions.execute(function (_ref2) {
25
22
  var _api$analytics;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "11.1.12",
3
+ "version": "11.1.14",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,7 +23,7 @@
23
23
  "@atlaskit/browser-apis": "^1.1.0",
24
24
  "@atlaskit/css": "^1.0.0",
25
25
  "@atlaskit/editor-plugin-analytics": "^12.0.0",
26
- "@atlaskit/editor-plugin-block-controls": "^13.1.0",
26
+ "@atlaskit/editor-plugin-block-controls": "^13.2.0",
27
27
  "@atlaskit/editor-plugin-decorations": "^12.0.0",
28
28
  "@atlaskit/editor-plugin-selection": "^12.0.0",
29
29
  "@atlaskit/editor-plugin-user-intent": "^10.0.0",
@@ -34,15 +34,15 @@
34
34
  "@atlaskit/flag": "^18.1.0",
35
35
  "@atlaskit/icon": "^36.2.0",
36
36
  "@atlaskit/platform-feature-flags": "^2.0.0",
37
- "@atlaskit/primitives": "^20.3.0",
37
+ "@atlaskit/primitives": "^20.5.0",
38
38
  "@atlaskit/prosemirror-history": "^1.0.0",
39
- "@atlaskit/tmp-editor-statsig": "^121.0.0",
40
- "@atlaskit/tokens": "^15.4.0",
39
+ "@atlaskit/tmp-editor-statsig": "^122.0.0",
40
+ "@atlaskit/tokens": "^15.5.0",
41
41
  "@babel/runtime": "^7.0.0",
42
42
  "bind-event-listener": "^3.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@atlaskit/editor-common": "^116.22.0",
45
+ "@atlaskit/editor-common": "^116.24.0",
46
46
  "react": "^18.2.0",
47
47
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
48
48
  },
@@ -86,12 +86,6 @@
86
86
  "platform_editor_adf_with_localid": {
87
87
  "type": "boolean"
88
88
  },
89
- "platform_editor_block_menu_jira_patch_3": {
90
- "type": "boolean"
91
- },
92
- "platform_editor_block_menu_jira_patch_4": {
93
- "type": "boolean"
94
- },
95
89
  "cc_blocks_changeboarding": {
96
90
  "type": "boolean"
97
91
  },