@atlaskit/editor-plugin-block-menu 9.0.13 → 9.0.15
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 +15 -0
- package/dist/cjs/ui/block-menu-components.js +5 -22
- package/dist/cjs/ui/copy-section.js +4 -13
- package/dist/cjs/ui/utils/checkIsFormatMenuHidden.js +1 -7
- package/dist/es2019/ui/block-menu-components.js +5 -20
- package/dist/es2019/ui/copy-section.js +2 -10
- package/dist/es2019/ui/utils/checkIsFormatMenuHidden.js +1 -7
- package/dist/esm/ui/block-menu-components.js +6 -23
- package/dist/esm/ui/copy-section.js +3 -11
- package/dist/esm/ui/utils/checkIsFormatMenuHidden.js +1 -7
- package/dist/types/ui/copy-section.d.ts +1 -4
- package/dist/types-ts4.5/ui/copy-section.d.ts +1 -4
- package/package.json +2 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-menu
|
|
2
2
|
|
|
3
|
+
## 9.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ca8aefc573cc5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ca8aefc573cc5) -
|
|
8
|
+
Clean up feature gates `platform_editor_block_menu_divider_patch` and
|
|
9
|
+
`platform_editor_block_menu_copy_section` (both rolled out as true).
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 9.0.14
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 9.0.13
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -10,7 +10,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _blockMenu = require("@atlaskit/editor-common/block-menu");
|
|
11
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
12
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _utils = require("./block-menu-renderer/utils");
|
|
15
14
|
var _copyLink = require("./copy-link");
|
|
16
15
|
var _copySection = require("./copy-section");
|
|
@@ -88,9 +87,9 @@ var getTurnIntoMenuComponents = function getTurnIntoMenuComponents(api) {
|
|
|
88
87
|
api: api
|
|
89
88
|
}, children);
|
|
90
89
|
},
|
|
91
|
-
isHidden:
|
|
90
|
+
isHidden: function isHidden() {
|
|
92
91
|
return (0, _checkIsFormatMenuHidden.checkIsFormatMenuHidden)(api);
|
|
93
|
-
}
|
|
92
|
+
}
|
|
94
93
|
}, {
|
|
95
94
|
type: 'block-menu-section',
|
|
96
95
|
key: _blockMenu.TRANSFORM_SUGGESTED_MENU_SECTION.key,
|
|
@@ -209,11 +208,9 @@ var getBlockMenuComponents = exports.getBlockMenuComponents = function getBlockM
|
|
|
209
208
|
rank: _blockMenu.MAIN_BLOCK_MENU_SECTION_RANK[_blockMenu.BLOCK_ACTIONS_MENU_SECTION.key],
|
|
210
209
|
component: function component(_ref8) {
|
|
211
210
|
var children = _ref8.children;
|
|
212
|
-
return /*#__PURE__*/_react.default.createElement(_copySection.CopySection,
|
|
213
|
-
api: api
|
|
214
|
-
}, children);
|
|
211
|
+
return /*#__PURE__*/_react.default.createElement(_copySection.CopySection, null, children);
|
|
215
212
|
}
|
|
216
|
-
}
|
|
213
|
+
}, {
|
|
217
214
|
type: 'block-menu-section',
|
|
218
215
|
key: _blockMenu.BLOCK_ACTIONS_COPY_MENU_SECTION.key,
|
|
219
216
|
rank: _blockMenu.MAIN_BLOCK_MENU_SECTION_RANK[_blockMenu.BLOCK_ACTIONS_COPY_MENU_SECTION.key],
|
|
@@ -237,21 +234,7 @@ var getBlockMenuComponents = exports.getBlockMenuComponents = function getBlockM
|
|
|
237
234
|
config: config
|
|
238
235
|
});
|
|
239
236
|
}
|
|
240
|
-
}
|
|
241
|
-
type: 'block-menu-item',
|
|
242
|
-
key: _blockMenu.BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM.key,
|
|
243
|
-
parent: {
|
|
244
|
-
type: 'block-menu-section',
|
|
245
|
-
key: _blockMenu.BLOCK_ACTIONS_MENU_SECTION.key,
|
|
246
|
-
rank: _blockMenu.BLOCK_ACTIONS_MENU_SECTION_RANK[_blockMenu.BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM.key]
|
|
247
|
-
},
|
|
248
|
-
component: function component() {
|
|
249
|
-
return /*#__PURE__*/_react.default.createElement(_copyLink.CopyLinkDropdownItem, {
|
|
250
|
-
api: api,
|
|
251
|
-
config: config
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}]), [{
|
|
237
|
+
}, {
|
|
255
238
|
type: 'block-menu-section',
|
|
256
239
|
key: _blockMenu.POSITION_MENU_SECTION.key,
|
|
257
240
|
rank: _blockMenu.MAIN_BLOCK_MENU_SECTION_RANK[_blockMenu.POSITION_MENU_SECTION.key],
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.CopySection = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
|
-
var _checkIsFormatMenuHidden = require("./utils/checkIsFormatMenuHidden");
|
|
13
|
-
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); }
|
|
14
10
|
var CopySection = exports.CopySection = function CopySection(_ref) {
|
|
15
|
-
var
|
|
16
|
-
children = _ref.children;
|
|
17
|
-
var isFormatMenuHidden = (0, _react.useCallback)(function () {
|
|
18
|
-
return (0, _checkIsFormatMenuHidden.checkIsFormatMenuHidden)(api);
|
|
19
|
-
}, [api]);
|
|
20
|
-
var hasSeparator = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_divider_patch') ? true : (0, _experiments.editorExperiment)('platform_synced_block', true) ? true : !isFormatMenuHidden();
|
|
11
|
+
var children = _ref.children;
|
|
21
12
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
|
|
22
|
-
hasSeparator:
|
|
13
|
+
hasSeparator: true
|
|
23
14
|
}, children);
|
|
24
15
|
};
|
|
@@ -5,18 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.checkIsFormatMenuHidden = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema) {
|
|
10
9
|
var nodes = schema.nodes;
|
|
11
10
|
if (!nodes) {
|
|
12
11
|
return false;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
// When platform_editor_block_menu_divider_patch is enabled, the "Copy synced block"
|
|
16
|
-
// item is placed inside TRANSFORM_MENU_SECTION, so we must not hide the section for
|
|
17
|
-
// syncBlock/bodiedSyncBlock nodes — the "Turn into" nested item has its own isHidden
|
|
18
|
-
// guard that will still hide it for those node types.
|
|
19
|
-
var disabledOnNodes = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_divider_patch') ? [nodes.rule] : [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
13
|
+
var disabledOnNodes = [nodes.rule];
|
|
20
14
|
var disabledNode = (0, _utils.findSelectedNodeOfType)(disabledOnNodes)(selection);
|
|
21
15
|
return !!disabledNode;
|
|
22
16
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BLOCK_ACTIONS_COPY_MENU_SECTION, BLOCK_ACTIONS_COPY_MENU_SECTION_RANK, BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM, BLOCK_ACTIONS_MENU_SECTION,
|
|
2
|
+
import { BLOCK_ACTIONS_COPY_MENU_SECTION, BLOCK_ACTIONS_COPY_MENU_SECTION_RANK, BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM, BLOCK_ACTIONS_MENU_SECTION, DELETE_MENU_SECTION, DELETE_MENU_SECTION_RANK, DELETE_MENU_ITEM, POSITION_MENU_SECTION, POSITION_MENU_SECTION_RANK, POSITION_MOVE_DOWN_MENU_ITEM, POSITION_MOVE_UP_MENU_ITEM, TRANSFORM_MENU_ITEM, TRANSFORM_MENU_ITEM_RANK, TRANSFORM_MENU_SECTION, TRANSFORM_MENU_SECTION_RANK, TRANSFORM_CREATE_MENU_SECTION, TRANSFORM_SUGGESTED_MENU_SECTION, TRANSFORM_STRUCTURE_MENU_SECTION, TRANSFORM_HEADINGS_MENU_SECTION, MAIN_BLOCK_MENU_SECTION_RANK, TRANSFORM_SUGGESTED_MENU_SECTION_RANK, TRANSFORM_SUGGESTED_MENU_ITEM } from '@atlaskit/editor-common/block-menu';
|
|
3
3
|
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { buildChildrenMap, getChildrenMapKey, willComponentRender } from './block-menu-renderer/utils';
|
|
7
6
|
import { CopyLinkDropdownItem } from './copy-link';
|
|
8
7
|
import { CopySection } from './copy-section';
|
|
@@ -74,7 +73,7 @@ const getTurnIntoMenuComponents = api => {
|
|
|
74
73
|
api: api
|
|
75
74
|
}, children);
|
|
76
75
|
},
|
|
77
|
-
isHidden:
|
|
76
|
+
isHidden: () => checkIsFormatMenuHidden(api)
|
|
78
77
|
}, {
|
|
79
78
|
type: 'block-menu-section',
|
|
80
79
|
key: TRANSFORM_SUGGESTED_MENU_SECTION.key,
|
|
@@ -191,10 +190,8 @@ export const getBlockMenuComponents = ({
|
|
|
191
190
|
rank: MAIN_BLOCK_MENU_SECTION_RANK[BLOCK_ACTIONS_MENU_SECTION.key],
|
|
192
191
|
component: ({
|
|
193
192
|
children
|
|
194
|
-
}) => /*#__PURE__*/React.createElement(CopySection,
|
|
195
|
-
|
|
196
|
-
}, children)
|
|
197
|
-
}, ...(fg('platform_editor_block_menu_copy_section') ? [{
|
|
193
|
+
}) => /*#__PURE__*/React.createElement(CopySection, null, children)
|
|
194
|
+
}, {
|
|
198
195
|
type: 'block-menu-section',
|
|
199
196
|
key: BLOCK_ACTIONS_COPY_MENU_SECTION.key,
|
|
200
197
|
rank: MAIN_BLOCK_MENU_SECTION_RANK[BLOCK_ACTIONS_COPY_MENU_SECTION.key],
|
|
@@ -215,19 +212,7 @@ export const getBlockMenuComponents = ({
|
|
|
215
212
|
api: api,
|
|
216
213
|
config: config
|
|
217
214
|
})
|
|
218
|
-
}
|
|
219
|
-
type: 'block-menu-item',
|
|
220
|
-
key: BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM.key,
|
|
221
|
-
parent: {
|
|
222
|
-
type: 'block-menu-section',
|
|
223
|
-
key: BLOCK_ACTIONS_MENU_SECTION.key,
|
|
224
|
-
rank: BLOCK_ACTIONS_MENU_SECTION_RANK[BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM.key]
|
|
225
|
-
},
|
|
226
|
-
component: () => /*#__PURE__*/React.createElement(CopyLinkDropdownItem, {
|
|
227
|
-
api: api,
|
|
228
|
-
config: config
|
|
229
|
-
})
|
|
230
|
-
}]), {
|
|
215
|
+
}, {
|
|
231
216
|
type: 'block-menu-section',
|
|
232
217
|
key: POSITION_MENU_SECTION.key,
|
|
233
218
|
rank: MAIN_BLOCK_MENU_SECTION_RANK[POSITION_MENU_SECTION.key],
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
|
|
6
3
|
export const CopySection = ({
|
|
7
|
-
api,
|
|
8
4
|
children
|
|
9
5
|
}) => {
|
|
10
|
-
const isFormatMenuHidden = useCallback(() => {
|
|
11
|
-
return checkIsFormatMenuHidden(api);
|
|
12
|
-
}, [api]);
|
|
13
|
-
const hasSeparator = fg('platform_editor_block_menu_divider_patch') ? true : editorExperiment('platform_synced_block', true) ? true : !isFormatMenuHidden();
|
|
14
6
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
15
|
-
hasSeparator:
|
|
7
|
+
hasSeparator: true
|
|
16
8
|
}, children);
|
|
17
9
|
};
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
const getIsFormatMenuHidden = (selection, schema) => {
|
|
4
3
|
const nodes = schema.nodes;
|
|
5
4
|
if (!nodes) {
|
|
6
5
|
return false;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
// When platform_editor_block_menu_divider_patch is enabled, the "Copy synced block"
|
|
10
|
-
// item is placed inside TRANSFORM_MENU_SECTION, so we must not hide the section for
|
|
11
|
-
// syncBlock/bodiedSyncBlock nodes — the "Turn into" nested item has its own isHidden
|
|
12
|
-
// guard that will still hide it for those node types.
|
|
13
|
-
const disabledOnNodes = fg('platform_editor_block_menu_divider_patch') ? [nodes.rule] : [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
7
|
+
const disabledOnNodes = [nodes.rule];
|
|
14
8
|
const disabledNode = findSelectedNodeOfType(disabledOnNodes)(selection);
|
|
15
9
|
return !!disabledNode;
|
|
16
10
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { BLOCK_ACTIONS_COPY_MENU_SECTION, BLOCK_ACTIONS_COPY_MENU_SECTION_RANK, BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM, BLOCK_ACTIONS_MENU_SECTION,
|
|
3
|
+
import { BLOCK_ACTIONS_COPY_MENU_SECTION, BLOCK_ACTIONS_COPY_MENU_SECTION_RANK, BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM, BLOCK_ACTIONS_MENU_SECTION, DELETE_MENU_SECTION, DELETE_MENU_SECTION_RANK, DELETE_MENU_ITEM, POSITION_MENU_SECTION, POSITION_MENU_SECTION_RANK, POSITION_MOVE_DOWN_MENU_ITEM, POSITION_MOVE_UP_MENU_ITEM, TRANSFORM_MENU_ITEM, TRANSFORM_MENU_ITEM_RANK, TRANSFORM_MENU_SECTION, TRANSFORM_MENU_SECTION_RANK, TRANSFORM_CREATE_MENU_SECTION, TRANSFORM_SUGGESTED_MENU_SECTION, TRANSFORM_STRUCTURE_MENU_SECTION, TRANSFORM_HEADINGS_MENU_SECTION, MAIN_BLOCK_MENU_SECTION_RANK, TRANSFORM_SUGGESTED_MENU_SECTION_RANK, TRANSFORM_SUGGESTED_MENU_ITEM } from '@atlaskit/editor-common/block-menu';
|
|
4
4
|
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { buildChildrenMap, getChildrenMapKey, willComponentRender } from './block-menu-renderer/utils';
|
|
8
7
|
import { CopyLinkDropdownItem } from './copy-link';
|
|
9
8
|
import { CopySection } from './copy-section';
|
|
@@ -81,9 +80,9 @@ var getTurnIntoMenuComponents = function getTurnIntoMenuComponents(api) {
|
|
|
81
80
|
api: api
|
|
82
81
|
}, children);
|
|
83
82
|
},
|
|
84
|
-
isHidden:
|
|
83
|
+
isHidden: function isHidden() {
|
|
85
84
|
return checkIsFormatMenuHidden(api);
|
|
86
|
-
}
|
|
85
|
+
}
|
|
87
86
|
}, {
|
|
88
87
|
type: 'block-menu-section',
|
|
89
88
|
key: TRANSFORM_SUGGESTED_MENU_SECTION.key,
|
|
@@ -202,11 +201,9 @@ export var getBlockMenuComponents = function getBlockMenuComponents(_ref7) {
|
|
|
202
201
|
rank: MAIN_BLOCK_MENU_SECTION_RANK[BLOCK_ACTIONS_MENU_SECTION.key],
|
|
203
202
|
component: function component(_ref8) {
|
|
204
203
|
var children = _ref8.children;
|
|
205
|
-
return /*#__PURE__*/React.createElement(CopySection,
|
|
206
|
-
api: api
|
|
207
|
-
}, children);
|
|
204
|
+
return /*#__PURE__*/React.createElement(CopySection, null, children);
|
|
208
205
|
}
|
|
209
|
-
}
|
|
206
|
+
}, {
|
|
210
207
|
type: 'block-menu-section',
|
|
211
208
|
key: BLOCK_ACTIONS_COPY_MENU_SECTION.key,
|
|
212
209
|
rank: MAIN_BLOCK_MENU_SECTION_RANK[BLOCK_ACTIONS_COPY_MENU_SECTION.key],
|
|
@@ -230,21 +227,7 @@ export var getBlockMenuComponents = function getBlockMenuComponents(_ref7) {
|
|
|
230
227
|
config: config
|
|
231
228
|
});
|
|
232
229
|
}
|
|
233
|
-
}
|
|
234
|
-
type: 'block-menu-item',
|
|
235
|
-
key: BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM.key,
|
|
236
|
-
parent: {
|
|
237
|
-
type: 'block-menu-section',
|
|
238
|
-
key: BLOCK_ACTIONS_MENU_SECTION.key,
|
|
239
|
-
rank: BLOCK_ACTIONS_MENU_SECTION_RANK[BLOCK_ACTIONS_COPY_LINK_TO_BLOCK_MENU_ITEM.key]
|
|
240
|
-
},
|
|
241
|
-
component: function component() {
|
|
242
|
-
return /*#__PURE__*/React.createElement(CopyLinkDropdownItem, {
|
|
243
|
-
api: api,
|
|
244
|
-
config: config
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}]), [{
|
|
230
|
+
}, {
|
|
248
231
|
type: 'block-menu-section',
|
|
249
232
|
key: POSITION_MENU_SECTION.key,
|
|
250
233
|
rank: MAIN_BLOCK_MENU_SECTION_RANK[POSITION_MENU_SECTION.key],
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
|
|
6
3
|
export var CopySection = function CopySection(_ref) {
|
|
7
|
-
var
|
|
8
|
-
children = _ref.children;
|
|
9
|
-
var isFormatMenuHidden = useCallback(function () {
|
|
10
|
-
return checkIsFormatMenuHidden(api);
|
|
11
|
-
}, [api]);
|
|
12
|
-
var hasSeparator = fg('platform_editor_block_menu_divider_patch') ? true : editorExperiment('platform_synced_block', true) ? true : !isFormatMenuHidden();
|
|
4
|
+
var children = _ref.children;
|
|
13
5
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
14
|
-
hasSeparator:
|
|
6
|
+
hasSeparator: true
|
|
15
7
|
}, children);
|
|
16
8
|
};
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
var getIsFormatMenuHidden = function getIsFormatMenuHidden(selection, schema) {
|
|
4
3
|
var nodes = schema.nodes;
|
|
5
4
|
if (!nodes) {
|
|
6
5
|
return false;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
// When platform_editor_block_menu_divider_patch is enabled, the "Copy synced block"
|
|
10
|
-
// item is placed inside TRANSFORM_MENU_SECTION, so we must not hide the section for
|
|
11
|
-
// syncBlock/bodiedSyncBlock nodes — the "Turn into" nested item has its own isHidden
|
|
12
|
-
// guard that will still hide it for those node types.
|
|
13
|
-
var disabledOnNodes = fg('platform_editor_block_menu_divider_patch') ? [nodes.rule] : [nodes.syncBlock, nodes.bodiedSyncBlock, nodes.rule];
|
|
7
|
+
var disabledOnNodes = [nodes.rule];
|
|
14
8
|
var disabledNode = findSelectedNodeOfType(disabledOnNodes)(selection);
|
|
15
9
|
return !!disabledNode;
|
|
16
10
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import type { BlockMenuPlugin } from '../blockMenuPluginType';
|
|
4
|
-
export declare const CopySection: ({ api, children, }: {
|
|
5
|
-
api?: ExtractInjectionAPI<BlockMenuPlugin> | undefined;
|
|
2
|
+
export declare const CopySection: ({ children, }: {
|
|
6
3
|
children: React.ReactNode;
|
|
7
4
|
}) => React.JSX.Element;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import type { BlockMenuPlugin } from '../blockMenuPluginType';
|
|
4
|
-
export declare const CopySection: ({ api, children, }: {
|
|
5
|
-
api?: ExtractInjectionAPI<BlockMenuPlugin> | undefined;
|
|
2
|
+
export declare const CopySection: ({ children, }: {
|
|
6
3
|
children: React.ReactNode;
|
|
7
4
|
}) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.15",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/primitives": "^19.0.0",
|
|
46
46
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^75.2.0",
|
|
48
48
|
"@atlaskit/tokens": "^13.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"bind-event-listener": "^3.0.0"
|
|
@@ -94,18 +94,12 @@
|
|
|
94
94
|
"platform_editor_adf_with_localid": {
|
|
95
95
|
"type": "boolean"
|
|
96
96
|
},
|
|
97
|
-
"platform_editor_block_menu_copy_section": {
|
|
98
|
-
"type": "boolean"
|
|
99
|
-
},
|
|
100
97
|
"platform_editor_block_menu_v2_patch_2": {
|
|
101
98
|
"type": "boolean"
|
|
102
99
|
},
|
|
103
100
|
"platform_editor_block_menu_jira_patch_1": {
|
|
104
101
|
"type": "boolean"
|
|
105
102
|
},
|
|
106
|
-
"platform_editor_block_menu_divider_patch": {
|
|
107
|
-
"type": "boolean"
|
|
108
|
-
},
|
|
109
103
|
"cc_blocks_changeboarding": {
|
|
110
104
|
"type": "boolean"
|
|
111
105
|
}
|