@atlaskit/editor-plugin-block-menu 4.0.19 → 4.0.20

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,13 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 4.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e053b5e610ac2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e053b5e610ac2) -
8
+ [ux] EDITOR-1652 add convert to sync block to block menu
9
+ - Updated dependencies
10
+
3
11
  ## 4.0.19
4
12
 
5
13
  ### Patch Changes
@@ -10,7 +10,6 @@ var _react = _interopRequireDefault(require("react"));
10
10
  var _blockMenu = require("@atlaskit/editor-common/block-menu");
11
11
  var _editorToolbar = require("@atlaskit/editor-toolbar");
12
12
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
- var _addBlocksSection = require("./add-blocks-section");
14
13
  var _copyBlock = _interopRequireDefault(require("./copy-block"));
15
14
  var _copyLink = require("./copy-link");
16
15
  var _copySection = require("./copy-section");
@@ -103,9 +102,9 @@ var getBlockMenuComponents = exports.getBlockMenuComponents = function getBlockM
103
102
  rank: _blockMenu.BLOCK_MENU_SECTION_RANK[_blockMenu.ADD_BLOCKS_MENU_SECTION.key],
104
103
  component: function component(_ref5) {
105
104
  var children = _ref5.children;
106
- return /*#__PURE__*/_react.default.createElement(_addBlocksSection.AddBlocksSection, {
107
- api: api
108
- }, " ", children, " ");
105
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
106
+ hasSeparator: true
107
+ }, children);
109
108
  }
110
109
  }] : []), [{
111
110
  type: 'block-menu-section',
@@ -1,3 +1,5 @@
1
1
 
2
- ._2rko12b0{border-radius:var(--ds-radius-small,4px)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._1cc0glyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])~*){border-block-start:none}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
4
+ ._1k2yglyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])){display:none}
3
5
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
@@ -24,7 +24,8 @@ var _blockMenuProvider = require("./block-menu-provider");
24
24
  var _blockMenuRenderer = require("./block-menu-renderer");
25
25
  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); }
26
26
  var styles = {
27
- base: "_2rko12b0 _bfhk1bhr _16qs1cd0"
27
+ base: "_2rko12b0 _bfhk1bhr _16qs1cd0",
28
+ emptyMenuSectionStyles: "_1cc0glyw _1k2yglyw"
28
29
  };
29
30
  var DEFAULT_MENU_WIDTH = 230;
30
31
  var DRAG_HANDLE_OFFSET_PADDING = 5;
@@ -42,7 +43,7 @@ var BlockMenuContent = function BlockMenuContent(_ref) {
42
43
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
43
44
  testId: "editor-block-menu",
44
45
  ref: ref,
45
- xcss: (0, _css.cx)(styles.base)
46
+ xcss: (0, _css.cx)(styles.base, (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_synced_block', 'isEnabled', true) && styles.emptyMenuSectionStyles)
46
47
  }, /*#__PURE__*/_react.default.createElement(_blockMenuRenderer.BlockMenuRenderer, {
47
48
  components: blockMenuComponents || [],
48
49
  fallbacks: {
@@ -23,6 +23,6 @@ var CopySection = exports.CopySection = function CopySection(_ref) {
23
23
  return null;
24
24
  }
25
25
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
26
- hasSeparator: !isFormatMenuHidden()
26
+ hasSeparator: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_synced_block', 'isEnabled', true) ? true : !isFormatMenuHidden()
27
27
  }, children);
28
28
  };
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { ADD_BLOCKS_MENU_SECTION, MOVE_UP_MENU_ITEM, MOVE_UP_DOWN_MENU_SECTION, MOVE_DOWN_MENU_ITEM, MOVE_BLOCK_SECTION_RANK, PRIMARY_MENU_SECTION, BLOCK_MENU_SECTION_RANK, COPY_MENU_SECTION, COPY_BLOCK_MENU_ITEM, COPY_MENU_SECTION_RANK, COPY_LINK_MENU_ITEM, DELETE_MENU_SECTION, DELETE_MENU_ITEM, DELETE_SECTION_RANK, NESTED_FORMAT_MENU_SECTION, NESTED_FORMAT_MENU } from '@atlaskit/editor-common/block-menu';
3
3
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
4
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
- import { AddBlocksSection } from './add-blocks-section';
6
5
  import CopyBlockMenuItem from './copy-block';
7
6
  import { CopyLinkDropdownItem } from './copy-link';
8
7
  import { CopySection } from './copy-section';
@@ -93,9 +92,9 @@ export const getBlockMenuComponents = ({
93
92
  rank: BLOCK_MENU_SECTION_RANK[ADD_BLOCKS_MENU_SECTION.key],
94
93
  component: ({
95
94
  children
96
- }) => /*#__PURE__*/React.createElement(AddBlocksSection, {
97
- api: api
98
- }, " ", children, " ")
95
+ }) => /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
96
+ hasSeparator: true
97
+ }, children)
99
98
  }] : []), {
100
99
  type: 'block-menu-section',
101
100
  key: COPY_MENU_SECTION.key,
@@ -1,3 +1,5 @@
1
1
 
2
- ._2rko12b0{border-radius:var(--ds-radius-small,4px)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._1cc0glyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])~*){border-block-start:none}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
4
+ ._1k2yglyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])){display:none}
3
5
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
@@ -16,7 +16,8 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
16
16
  import { useBlockMenu } from './block-menu-provider';
17
17
  import { BlockMenuRenderer } from './block-menu-renderer';
18
18
  const styles = {
19
- base: "_2rko12b0 _bfhk1bhr _16qs1cd0"
19
+ base: "_2rko12b0 _bfhk1bhr _16qs1cd0",
20
+ emptyMenuSectionStyles: "_1cc0glyw _1k2yglyw"
20
21
  };
21
22
  const DEFAULT_MENU_WIDTH = 230;
22
23
  const DRAG_HANDLE_OFFSET_PADDING = 5;
@@ -35,7 +36,7 @@ const BlockMenuContent = ({
35
36
  return /*#__PURE__*/React.createElement(Box, {
36
37
  testId: "editor-block-menu",
37
38
  ref: ref,
38
- xcss: cx(styles.base)
39
+ xcss: cx(styles.base, expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) && styles.emptyMenuSectionStyles)
39
40
  }, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
40
41
  components: blockMenuComponents || [],
41
42
  fallbacks: {
@@ -16,6 +16,6 @@ export const CopySection = ({
16
16
  return null;
17
17
  }
18
18
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
19
- hasSeparator: !isFormatMenuHidden()
19
+ hasSeparator: expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) ? true : !isFormatMenuHidden()
20
20
  }, children);
21
21
  };
@@ -3,7 +3,6 @@ import React from 'react';
3
3
  import { ADD_BLOCKS_MENU_SECTION, MOVE_UP_MENU_ITEM, MOVE_UP_DOWN_MENU_SECTION, MOVE_DOWN_MENU_ITEM, MOVE_BLOCK_SECTION_RANK, PRIMARY_MENU_SECTION, BLOCK_MENU_SECTION_RANK, COPY_MENU_SECTION, COPY_BLOCK_MENU_ITEM, COPY_MENU_SECTION_RANK, COPY_LINK_MENU_ITEM, DELETE_MENU_SECTION, DELETE_MENU_ITEM, DELETE_SECTION_RANK, NESTED_FORMAT_MENU_SECTION, NESTED_FORMAT_MENU } from '@atlaskit/editor-common/block-menu';
4
4
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
- import { AddBlocksSection } from './add-blocks-section';
7
6
  import CopyBlockMenuItem from './copy-block';
8
7
  import { CopyLinkDropdownItem } from './copy-link';
9
8
  import { CopySection } from './copy-section';
@@ -96,9 +95,9 @@ export var getBlockMenuComponents = function getBlockMenuComponents(_ref4) {
96
95
  rank: BLOCK_MENU_SECTION_RANK[ADD_BLOCKS_MENU_SECTION.key],
97
96
  component: function component(_ref5) {
98
97
  var children = _ref5.children;
99
- return /*#__PURE__*/React.createElement(AddBlocksSection, {
100
- api: api
101
- }, " ", children, " ");
98
+ return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
99
+ hasSeparator: true
100
+ }, children);
102
101
  }
103
102
  }] : []), [{
104
103
  type: 'block-menu-section',
@@ -1,3 +1,5 @@
1
1
 
2
- ._2rko12b0{border-radius:var(--ds-radius-small,4px)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._1cc0glyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])~*){border-block-start:none}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
4
+ ._1k2yglyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])){display:none}
3
5
  ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
@@ -16,7 +16,8 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
16
16
  import { useBlockMenu } from './block-menu-provider';
17
17
  import { BlockMenuRenderer } from './block-menu-renderer';
18
18
  var styles = {
19
- base: "_2rko12b0 _bfhk1bhr _16qs1cd0"
19
+ base: "_2rko12b0 _bfhk1bhr _16qs1cd0",
20
+ emptyMenuSectionStyles: "_1cc0glyw _1k2yglyw"
20
21
  };
21
22
  var DEFAULT_MENU_WIDTH = 230;
22
23
  var DRAG_HANDLE_OFFSET_PADDING = 5;
@@ -34,7 +35,7 @@ var BlockMenuContent = function BlockMenuContent(_ref) {
34
35
  return /*#__PURE__*/React.createElement(Box, {
35
36
  testId: "editor-block-menu",
36
37
  ref: ref,
37
- xcss: cx(styles.base)
38
+ xcss: cx(styles.base, expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) && styles.emptyMenuSectionStyles)
38
39
  }, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
39
40
  components: blockMenuComponents || [],
40
41
  fallbacks: {
@@ -15,6 +15,6 @@ export var CopySection = function CopySection(_ref) {
15
15
  return null;
16
16
  }
17
17
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
18
- hasSeparator: !isFormatMenuHidden()
18
+ hasSeparator: expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) ? true : !isFormatMenuHidden()
19
19
  }, children);
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "4.0.19",
3
+ "version": "4.0.20",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,12 +43,12 @@
43
43
  "@atlaskit/icon-lab": "^5.10.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/primitives": "^14.15.0",
46
- "@atlaskit/tmp-editor-statsig": "^13.5.0",
46
+ "@atlaskit/tmp-editor-statsig": "^13.6.0",
47
47
  "@atlaskit/tokens": "^6.4.0",
48
48
  "@babel/runtime": "^7.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^110.8.0",
51
+ "@atlaskit/editor-common": "^110.9.0",
52
52
  "react": "^18.2.0",
53
53
  "react-intl-next": "npm:react-intl@^5.18.1"
54
54
  },
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.AddBlocksSection = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _editorToolbar = require("@atlaskit/editor-toolbar");
10
- var AddBlocksSection = exports.AddBlocksSection = function AddBlocksSection(_ref) {
11
- var _api$selection;
12
- var api = _ref.api,
13
- children = _ref.children;
14
- var selection = api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || (_api$selection = _api$selection.sharedState) === null || _api$selection === void 0 || (_api$selection = _api$selection.currentState()) === null || _api$selection === void 0 ? void 0 : _api$selection.selection;
15
- if (!(selection !== null && selection !== void 0 && selection.empty)) {
16
- return null;
17
- }
18
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
19
- hasSeparator: true
20
- }, children);
21
- };
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
3
- export const AddBlocksSection = ({
4
- api,
5
- children
6
- }) => {
7
- var _api$selection, _api$selection$shared, _api$selection$shared2;
8
- const selection = api === null || api === void 0 ? void 0 : (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : (_api$selection$shared = _api$selection.sharedState) === null || _api$selection$shared === void 0 ? void 0 : (_api$selection$shared2 = _api$selection$shared.currentState()) === null || _api$selection$shared2 === void 0 ? void 0 : _api$selection$shared2.selection;
9
- if (!(selection !== null && selection !== void 0 && selection.empty)) {
10
- return null;
11
- }
12
- return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
13
- hasSeparator: true
14
- }, children);
15
- };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
3
- export var AddBlocksSection = function AddBlocksSection(_ref) {
4
- var _api$selection;
5
- var api = _ref.api,
6
- children = _ref.children;
7
- var selection = api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || (_api$selection = _api$selection.sharedState) === null || _api$selection === void 0 || (_api$selection = _api$selection.currentState()) === null || _api$selection === void 0 ? void 0 : _api$selection.selection;
8
- if (!(selection !== null && selection !== void 0 && selection.empty)) {
9
- return null;
10
- }
11
- return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
12
- hasSeparator: true
13
- }, children);
14
- };
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockMenuPlugin } from '../blockMenuPluginType';
4
- export declare const AddBlocksSection: ({ api, children, }: {
5
- api: ExtractInjectionAPI<BlockMenuPlugin> | undefined;
6
- children: React.ReactNode;
7
- }) => React.JSX.Element | null;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockMenuPlugin } from '../blockMenuPluginType';
4
- export declare const AddBlocksSection: ({ api, children, }: {
5
- api: ExtractInjectionAPI<BlockMenuPlugin> | undefined;
6
- children: React.ReactNode;
7
- }) => React.JSX.Element | null;