@atlaskit/editor-plugin-block-menu 5.0.4 → 5.0.5
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 +8 -0
- package/dist/cjs/ui/block-menu.compiled.css +1 -1
- package/dist/cjs/ui/block-menu.js +1 -1
- package/dist/cjs/ui/copy-block.js +15 -5
- package/dist/es2019/ui/block-menu.compiled.css +1 -1
- package/dist/es2019/ui/block-menu.js +1 -1
- package/dist/es2019/ui/copy-block.js +13 -3
- package/dist/esm/ui/block-menu.compiled.css +1 -1
- package/dist/esm/ui/block-menu.js +1 -1
- package/dist/esm/ui/copy-block.js +15 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-menu
|
|
2
2
|
|
|
3
|
+
## 5.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`292d52fa1530f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/292d52fa1530f) -
|
|
8
|
+
EDITOR-2759 Copy content block menu option copies source sync block content
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 5.0.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
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}.
|
|
3
|
+
._1cc0glyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])~*){border-block-start:none}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
4
4
|
._1k2yglyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])){display:none}
|
|
5
5
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -27,7 +27,7 @@ var _blockMenuProvider = require("./block-menu-provider");
|
|
|
27
27
|
var _blockMenuRenderer = require("./block-menu-renderer");
|
|
28
28
|
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); }
|
|
29
29
|
var styles = {
|
|
30
|
-
base: "_2rko12b0 _bfhk1bhr
|
|
30
|
+
base: "_2rko12b0 _bfhk1bhr _16qs130s",
|
|
31
31
|
emptyMenuSectionStyles: "_1cc0glyw _1k2yglyw"
|
|
32
32
|
};
|
|
33
33
|
var DEFAULT_MENU_WIDTH = 230;
|
|
@@ -19,6 +19,7 @@ var _utils = require("@atlaskit/editor-tables/utils");
|
|
|
19
19
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
20
20
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
21
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
23
|
var _blockMenuProvider = require("./block-menu-provider");
|
|
23
24
|
var _consts = require("./consts");
|
|
24
25
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -87,7 +88,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
// for table
|
|
90
|
-
if ((0, _utils.isTableSelected)(selection)) {
|
|
91
|
+
else if ((0, _utils.isTableSelected)(selection)) {
|
|
91
92
|
var nodeType = schema.nodes.table;
|
|
92
93
|
var tableNode = selection.$anchorCell.node(-1);
|
|
93
94
|
if (!tableNode) {
|
|
@@ -98,7 +99,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
// for other nodes
|
|
101
|
-
if (selection instanceof _state.NodeSelection) {
|
|
102
|
+
else if (selection instanceof _state.NodeSelection) {
|
|
102
103
|
var _nodeType = selection.node.type;
|
|
103
104
|
|
|
104
105
|
// code block is a special case where it is a block node but has inlineContent to true,
|
|
@@ -110,9 +111,18 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
|
|
|
110
111
|
});
|
|
111
112
|
var _domNode2 = (0, _copyButton.toDOM)(selection.node, schema);
|
|
112
113
|
(0, _copyButton.copyDomNode)(_domNode2, codeBlockNodeType, selection);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
}
|
|
115
|
+
// source sync block (bodiedSyncBlock) is also a special case
|
|
116
|
+
// where we need to copy the content of the bodiedSyncBlock node
|
|
117
|
+
else if (selection.node.type.name === 'bodiedSyncBlock' && (0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_1')) {
|
|
118
|
+
var bodiedSyncBlockNode = selection.node;
|
|
119
|
+
var _domNode3 = toDOMFromFragment(bodiedSyncBlockNode.content, schema);
|
|
120
|
+
(0, _copyButton.copyDomNode)(_domNode3, bodiedSyncBlockNode.type, selection);
|
|
121
|
+
}
|
|
122
|
+
// for other nodes
|
|
123
|
+
else {
|
|
124
|
+
var _domNode4 = (0, _copyButton.toDOM)(selection.node, schema);
|
|
125
|
+
(0, _copyButton.copyDomNode)(_domNode4, _nodeType, selection);
|
|
116
126
|
}
|
|
117
127
|
}
|
|
118
128
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
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}.
|
|
3
|
+
._1cc0glyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])~*){border-block-start:none}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
4
4
|
._1k2yglyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])){display:none}
|
|
5
5
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -19,7 +19,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
19
19
|
import { useBlockMenu } from './block-menu-provider';
|
|
20
20
|
import { BlockMenuRenderer } from './block-menu-renderer';
|
|
21
21
|
const styles = {
|
|
22
|
-
base: "_2rko12b0 _bfhk1bhr
|
|
22
|
+
base: "_2rko12b0 _bfhk1bhr _16qs130s",
|
|
23
23
|
emptyMenuSectionStyles: "_1cc0glyw _1k2yglyw"
|
|
24
24
|
};
|
|
25
25
|
const DEFAULT_MENU_WIDTH = 230;
|
|
@@ -11,6 +11,7 @@ import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
|
11
11
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
12
12
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
15
|
import { useBlockMenu } from './block-menu-provider';
|
|
15
16
|
import { BLOCK_MENU_ITEM_NAME } from './consts';
|
|
16
17
|
const toDOMFromFragment = (fragment, schema) => {
|
|
@@ -81,7 +82,7 @@ const CopyBlockMenuItem = ({
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
// for table
|
|
84
|
-
if (isTableSelected(selection)) {
|
|
85
|
+
else if (isTableSelected(selection)) {
|
|
85
86
|
const nodeType = schema.nodes.table;
|
|
86
87
|
const tableNode = selection.$anchorCell.node(-1);
|
|
87
88
|
if (!tableNode) {
|
|
@@ -92,7 +93,7 @@ const CopyBlockMenuItem = ({
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
// for other nodes
|
|
95
|
-
if (selection instanceof NodeSelection) {
|
|
96
|
+
else if (selection instanceof NodeSelection) {
|
|
96
97
|
const nodeType = selection.node.type;
|
|
97
98
|
|
|
98
99
|
// code block is a special case where it is a block node but has inlineContent to true,
|
|
@@ -105,7 +106,16 @@ const CopyBlockMenuItem = ({
|
|
|
105
106
|
};
|
|
106
107
|
const domNode = toDOM(selection.node, schema);
|
|
107
108
|
copyDomNode(domNode, codeBlockNodeType, selection);
|
|
108
|
-
}
|
|
109
|
+
}
|
|
110
|
+
// source sync block (bodiedSyncBlock) is also a special case
|
|
111
|
+
// where we need to copy the content of the bodiedSyncBlock node
|
|
112
|
+
else if (selection.node.type.name === 'bodiedSyncBlock' && expValEquals('platform_synced_block', 'isEnabled', true) && fg('platform_editor_block_menu_patch_1')) {
|
|
113
|
+
const bodiedSyncBlockNode = selection.node;
|
|
114
|
+
const domNode = toDOMFromFragment(bodiedSyncBlockNode.content, schema);
|
|
115
|
+
copyDomNode(domNode, bodiedSyncBlockNode.type, selection);
|
|
116
|
+
}
|
|
117
|
+
// for other nodes
|
|
118
|
+
else {
|
|
109
119
|
const domNode = toDOM(selection.node, schema);
|
|
110
120
|
copyDomNode(domNode, nodeType, selection);
|
|
111
121
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
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}.
|
|
3
|
+
._1cc0glyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])~*){border-block-start:none}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
4
4
|
._1k2yglyw [data-toolbar-component=menu-section]:not(:has([data-toolbar-component=menu-item])){display:none}
|
|
5
5
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -19,7 +19,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
19
19
|
import { useBlockMenu } from './block-menu-provider';
|
|
20
20
|
import { BlockMenuRenderer } from './block-menu-renderer';
|
|
21
21
|
var styles = {
|
|
22
|
-
base: "_2rko12b0 _bfhk1bhr
|
|
22
|
+
base: "_2rko12b0 _bfhk1bhr _16qs130s",
|
|
23
23
|
emptyMenuSectionStyles: "_1cc0glyw _1k2yglyw"
|
|
24
24
|
};
|
|
25
25
|
var DEFAULT_MENU_WIDTH = 230;
|
|
@@ -14,6 +14,7 @@ import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
|
14
14
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
15
15
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
18
|
import { useBlockMenu } from './block-menu-provider';
|
|
18
19
|
import { BLOCK_MENU_ITEM_NAME } from './consts';
|
|
19
20
|
var toDOMFromFragment = function toDOMFromFragment(fragment, schema) {
|
|
@@ -80,7 +81,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
|
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
// for table
|
|
83
|
-
if (isTableSelected(selection)) {
|
|
84
|
+
else if (isTableSelected(selection)) {
|
|
84
85
|
var nodeType = schema.nodes.table;
|
|
85
86
|
var tableNode = selection.$anchorCell.node(-1);
|
|
86
87
|
if (!tableNode) {
|
|
@@ -91,7 +92,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
// for other nodes
|
|
94
|
-
if (selection instanceof NodeSelection) {
|
|
95
|
+
else if (selection instanceof NodeSelection) {
|
|
95
96
|
var _nodeType = selection.node.type;
|
|
96
97
|
|
|
97
98
|
// code block is a special case where it is a block node but has inlineContent to true,
|
|
@@ -103,9 +104,18 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
|
|
|
103
104
|
});
|
|
104
105
|
var _domNode2 = toDOM(selection.node, schema);
|
|
105
106
|
copyDomNode(_domNode2, codeBlockNodeType, selection);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
}
|
|
108
|
+
// source sync block (bodiedSyncBlock) is also a special case
|
|
109
|
+
// where we need to copy the content of the bodiedSyncBlock node
|
|
110
|
+
else if (selection.node.type.name === 'bodiedSyncBlock' && expValEquals('platform_synced_block', 'isEnabled', true) && fg('platform_editor_block_menu_patch_1')) {
|
|
111
|
+
var bodiedSyncBlockNode = selection.node;
|
|
112
|
+
var _domNode3 = toDOMFromFragment(bodiedSyncBlockNode.content, schema);
|
|
113
|
+
copyDomNode(_domNode3, bodiedSyncBlockNode.type, selection);
|
|
114
|
+
}
|
|
115
|
+
// for other nodes
|
|
116
|
+
else {
|
|
117
|
+
var _domNode4 = toDOM(selection.node, schema);
|
|
118
|
+
copyDomNode(_domNode4, _nodeType, selection);
|
|
109
119
|
}
|
|
110
120
|
}
|
|
111
121
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.5",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
41
41
|
"@atlaskit/editor-toolbar": "^0.17.0",
|
|
42
42
|
"@atlaskit/icon": "^28.5.0",
|
|
43
|
-
"@atlaskit/icon-lab": "^5.
|
|
43
|
+
"@atlaskit/icon-lab": "^5.12.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
46
46
|
"@atlaskit/primitives": "^16.1.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^13.33.0",
|
|
48
48
|
"@atlaskit/tokens": "^8.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^110.
|
|
52
|
+
"@atlaskit/editor-common": "^110.25.0",
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
55
55
|
},
|