@atlaskit/editor-plugin-synced-block 5.1.7 → 5.1.9
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-synced-block
|
|
2
2
|
|
|
3
|
+
## 5.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.1.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`2f2aca53f492c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f2aca53f492c) -
|
|
14
|
+
[ux] Remove 'copy synced block' from block menu
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 5.1.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -51,56 +51,24 @@ var CreateSyncedBlockDropdownItem = function CreateSyncedBlockDropdownItem(_ref)
|
|
|
51
51
|
}),
|
|
52
52
|
onClick: onClick,
|
|
53
53
|
isDisabled: isOffline,
|
|
54
|
-
testId:
|
|
54
|
+
testId: 'create-synced-block-block-menu-btn',
|
|
55
55
|
elemAfter: /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
56
56
|
appearance: "new"
|
|
57
57
|
}, formatMessage(_messages.blockMenuMessages.newLozenge))
|
|
58
58
|
}, formatMessage(_messages.blockMenuMessages.createSyncedBlock));
|
|
59
59
|
};
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['
|
|
65
|
-
var _states$connectivityS2;
|
|
66
|
-
return {
|
|
67
|
-
mode: (_states$connectivityS2 = states.connectivityState) === null || _states$connectivityS2 === void 0 ? void 0 : _states$connectivityS2.mode
|
|
68
|
-
};
|
|
69
|
-
}),
|
|
70
|
-
mode = _useSharedPluginState2.mode;
|
|
71
|
-
var onClick = function onClick() {
|
|
72
|
-
var _api$core3, _api$core4, _api$blockControls2;
|
|
73
|
-
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 ? void 0 : api.syncedBlock.commands.copySyncedBlockReferenceToClipboard());
|
|
74
|
-
api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 || _api$core4.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.toggleBlockMenu({
|
|
75
|
-
closeMenu: true
|
|
76
|
-
}));
|
|
77
|
-
};
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
79
|
-
elemBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.SyncBlocksIcon, {
|
|
80
|
-
label: ""
|
|
81
|
-
}),
|
|
82
|
-
onClick: onClick,
|
|
83
|
-
isDisabled: (0, _editorPluginConnectivity.isOfflineMode)(mode),
|
|
84
|
-
elemAfter: /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
85
|
-
appearance: "new"
|
|
86
|
-
}, formatMessage(_messages.blockMenuMessages.newLozenge))
|
|
87
|
-
}, formatMessage(_messages.blockMenuMessages.copySyncedBlock));
|
|
88
|
-
};
|
|
89
|
-
var CreateOrCopySyncedBlockDropdownItem = exports.CreateOrCopySyncedBlockDropdownItem = function CreateOrCopySyncedBlockDropdownItem(_ref3) {
|
|
90
|
-
var api = _ref3.api,
|
|
91
|
-
enableSourceSyncedBlockCreation = _ref3.enableSourceSyncedBlockCreation;
|
|
92
|
-
var _useSharedPluginState3 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['blockControls'], function (states) {
|
|
60
|
+
var CreateOrCopySyncedBlockDropdownItem = exports.CreateOrCopySyncedBlockDropdownItem = function CreateOrCopySyncedBlockDropdownItem(_ref2) {
|
|
61
|
+
var _menuTriggerByNode$no;
|
|
62
|
+
var api = _ref2.api,
|
|
63
|
+
enableSourceSyncedBlockCreation = _ref2.enableSourceSyncedBlockCreation;
|
|
64
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['blockControls'], function (states) {
|
|
93
65
|
var _states$blockControls3, _states$blockControls4;
|
|
94
66
|
return {
|
|
95
67
|
menuTriggerByNode: (_states$blockControls3 = (_states$blockControls4 = states.blockControlsState) === null || _states$blockControls4 === void 0 ? void 0 : _states$blockControls4.menuTriggerByNode) !== null && _states$blockControls3 !== void 0 ? _states$blockControls3 : undefined
|
|
96
68
|
};
|
|
97
69
|
}),
|
|
98
|
-
menuTriggerByNode =
|
|
99
|
-
if ((menuTriggerByNode === null || menuTriggerByNode === void 0 ? void 0 : menuTriggerByNode.nodeType)
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement(CopySyncedBlockDropdownItem, {
|
|
101
|
-
api: api
|
|
102
|
-
});
|
|
103
|
-
} else if (enableSourceSyncedBlockCreation) {
|
|
70
|
+
menuTriggerByNode = _useSharedPluginState2.menuTriggerByNode;
|
|
71
|
+
if (!['syncBlock', 'bodiedSyncBlock'].includes((_menuTriggerByNode$no = menuTriggerByNode === null || menuTriggerByNode === void 0 ? void 0 : menuTriggerByNode.nodeType) !== null && _menuTriggerByNode$no !== void 0 ? _menuTriggerByNode$no : '') && enableSourceSyncedBlockCreation) {
|
|
104
72
|
return /*#__PURE__*/_react.default.createElement(CreateSyncedBlockDropdownItem, {
|
|
105
73
|
api: api
|
|
106
74
|
});
|
|
@@ -43,48 +43,17 @@ const CreateSyncedBlockDropdownItem = ({
|
|
|
43
43
|
}),
|
|
44
44
|
onClick: onClick,
|
|
45
45
|
isDisabled: isOffline,
|
|
46
|
-
testId:
|
|
46
|
+
testId: 'create-synced-block-block-menu-btn',
|
|
47
47
|
elemAfter: /*#__PURE__*/React.createElement(Lozenge, {
|
|
48
48
|
appearance: "new"
|
|
49
49
|
}, formatMessage(blockMenuMessages.newLozenge))
|
|
50
50
|
}, formatMessage(blockMenuMessages.createSyncedBlock));
|
|
51
51
|
};
|
|
52
|
-
const CopySyncedBlockDropdownItem = ({
|
|
53
|
-
api
|
|
54
|
-
}) => {
|
|
55
|
-
const {
|
|
56
|
-
formatMessage
|
|
57
|
-
} = useIntl();
|
|
58
|
-
const {
|
|
59
|
-
mode
|
|
60
|
-
} = useSharedPluginStateWithSelector(api, ['connectivity'], states => {
|
|
61
|
-
var _states$connectivityS2;
|
|
62
|
-
return {
|
|
63
|
-
mode: (_states$connectivityS2 = states.connectivityState) === null || _states$connectivityS2 === void 0 ? void 0 : _states$connectivityS2.mode
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
const onClick = () => {
|
|
67
|
-
var _api$core3, _api$core4, _api$blockControls2, _api$blockControls2$c;
|
|
68
|
-
api === null || api === void 0 ? void 0 : (_api$core3 = api.core) === null || _api$core3 === void 0 ? void 0 : _api$core3.actions.execute(api === null || api === void 0 ? void 0 : api.syncedBlock.commands.copySyncedBlockReferenceToClipboard());
|
|
69
|
-
api === null || api === void 0 ? void 0 : (_api$core4 = api.core) === null || _api$core4 === void 0 ? void 0 : _api$core4.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : (_api$blockControls2$c = _api$blockControls2.commands) === null || _api$blockControls2$c === void 0 ? void 0 : _api$blockControls2$c.toggleBlockMenu({
|
|
70
|
-
closeMenu: true
|
|
71
|
-
}));
|
|
72
|
-
};
|
|
73
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
74
|
-
elemBefore: /*#__PURE__*/React.createElement(SyncBlocksIcon, {
|
|
75
|
-
label: ""
|
|
76
|
-
}),
|
|
77
|
-
onClick: onClick,
|
|
78
|
-
isDisabled: isOfflineMode(mode),
|
|
79
|
-
elemAfter: /*#__PURE__*/React.createElement(Lozenge, {
|
|
80
|
-
appearance: "new"
|
|
81
|
-
}, formatMessage(blockMenuMessages.newLozenge))
|
|
82
|
-
}, formatMessage(blockMenuMessages.copySyncedBlock));
|
|
83
|
-
};
|
|
84
52
|
export const CreateOrCopySyncedBlockDropdownItem = ({
|
|
85
53
|
api,
|
|
86
54
|
enableSourceSyncedBlockCreation
|
|
87
55
|
}) => {
|
|
56
|
+
var _menuTriggerByNode$no;
|
|
88
57
|
const {
|
|
89
58
|
menuTriggerByNode
|
|
90
59
|
} = useSharedPluginStateWithSelector(api, ['blockControls'], states => {
|
|
@@ -93,11 +62,7 @@ export const CreateOrCopySyncedBlockDropdownItem = ({
|
|
|
93
62
|
menuTriggerByNode: (_states$blockControls3 = (_states$blockControls4 = states.blockControlsState) === null || _states$blockControls4 === void 0 ? void 0 : _states$blockControls4.menuTriggerByNode) !== null && _states$blockControls3 !== void 0 ? _states$blockControls3 : undefined
|
|
94
63
|
};
|
|
95
64
|
});
|
|
96
|
-
if ((menuTriggerByNode === null || menuTriggerByNode === void 0 ? void 0 : menuTriggerByNode.nodeType)
|
|
97
|
-
return /*#__PURE__*/React.createElement(CopySyncedBlockDropdownItem, {
|
|
98
|
-
api: api
|
|
99
|
-
});
|
|
100
|
-
} else if (enableSourceSyncedBlockCreation) {
|
|
65
|
+
if (!['syncBlock', 'bodiedSyncBlock'].includes((_menuTriggerByNode$no = menuTriggerByNode === null || menuTriggerByNode === void 0 ? void 0 : menuTriggerByNode.nodeType) !== null && _menuTriggerByNode$no !== void 0 ? _menuTriggerByNode$no : '') && enableSourceSyncedBlockCreation) {
|
|
101
66
|
return /*#__PURE__*/React.createElement(CreateSyncedBlockDropdownItem, {
|
|
102
67
|
api: api
|
|
103
68
|
});
|
|
@@ -42,56 +42,24 @@ var CreateSyncedBlockDropdownItem = function CreateSyncedBlockDropdownItem(_ref)
|
|
|
42
42
|
}),
|
|
43
43
|
onClick: onClick,
|
|
44
44
|
isDisabled: isOffline,
|
|
45
|
-
testId:
|
|
45
|
+
testId: 'create-synced-block-block-menu-btn',
|
|
46
46
|
elemAfter: /*#__PURE__*/React.createElement(Lozenge, {
|
|
47
47
|
appearance: "new"
|
|
48
48
|
}, formatMessage(blockMenuMessages.newLozenge))
|
|
49
49
|
}, formatMessage(blockMenuMessages.createSyncedBlock));
|
|
50
50
|
};
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
var _useSharedPluginState2 = useSharedPluginStateWithSelector(api, ['
|
|
56
|
-
var _states$connectivityS2;
|
|
57
|
-
return {
|
|
58
|
-
mode: (_states$connectivityS2 = states.connectivityState) === null || _states$connectivityS2 === void 0 ? void 0 : _states$connectivityS2.mode
|
|
59
|
-
};
|
|
60
|
-
}),
|
|
61
|
-
mode = _useSharedPluginState2.mode;
|
|
62
|
-
var onClick = function onClick() {
|
|
63
|
-
var _api$core3, _api$core4, _api$blockControls2;
|
|
64
|
-
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 ? void 0 : api.syncedBlock.commands.copySyncedBlockReferenceToClipboard());
|
|
65
|
-
api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 || _api$core4.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.toggleBlockMenu({
|
|
66
|
-
closeMenu: true
|
|
67
|
-
}));
|
|
68
|
-
};
|
|
69
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
70
|
-
elemBefore: /*#__PURE__*/React.createElement(SyncBlocksIcon, {
|
|
71
|
-
label: ""
|
|
72
|
-
}),
|
|
73
|
-
onClick: onClick,
|
|
74
|
-
isDisabled: isOfflineMode(mode),
|
|
75
|
-
elemAfter: /*#__PURE__*/React.createElement(Lozenge, {
|
|
76
|
-
appearance: "new"
|
|
77
|
-
}, formatMessage(blockMenuMessages.newLozenge))
|
|
78
|
-
}, formatMessage(blockMenuMessages.copySyncedBlock));
|
|
79
|
-
};
|
|
80
|
-
export var CreateOrCopySyncedBlockDropdownItem = function CreateOrCopySyncedBlockDropdownItem(_ref3) {
|
|
81
|
-
var api = _ref3.api,
|
|
82
|
-
enableSourceSyncedBlockCreation = _ref3.enableSourceSyncedBlockCreation;
|
|
83
|
-
var _useSharedPluginState3 = useSharedPluginStateWithSelector(api, ['blockControls'], function (states) {
|
|
51
|
+
export var CreateOrCopySyncedBlockDropdownItem = function CreateOrCopySyncedBlockDropdownItem(_ref2) {
|
|
52
|
+
var _menuTriggerByNode$no;
|
|
53
|
+
var api = _ref2.api,
|
|
54
|
+
enableSourceSyncedBlockCreation = _ref2.enableSourceSyncedBlockCreation;
|
|
55
|
+
var _useSharedPluginState2 = useSharedPluginStateWithSelector(api, ['blockControls'], function (states) {
|
|
84
56
|
var _states$blockControls3, _states$blockControls4;
|
|
85
57
|
return {
|
|
86
58
|
menuTriggerByNode: (_states$blockControls3 = (_states$blockControls4 = states.blockControlsState) === null || _states$blockControls4 === void 0 ? void 0 : _states$blockControls4.menuTriggerByNode) !== null && _states$blockControls3 !== void 0 ? _states$blockControls3 : undefined
|
|
87
59
|
};
|
|
88
60
|
}),
|
|
89
|
-
menuTriggerByNode =
|
|
90
|
-
if ((menuTriggerByNode === null || menuTriggerByNode === void 0 ? void 0 : menuTriggerByNode.nodeType)
|
|
91
|
-
return /*#__PURE__*/React.createElement(CopySyncedBlockDropdownItem, {
|
|
92
|
-
api: api
|
|
93
|
-
});
|
|
94
|
-
} else if (enableSourceSyncedBlockCreation) {
|
|
61
|
+
menuTriggerByNode = _useSharedPluginState2.menuTriggerByNode;
|
|
62
|
+
if (!['syncBlock', 'bodiedSyncBlock'].includes((_menuTriggerByNode$no = menuTriggerByNode === null || menuTriggerByNode === void 0 ? void 0 : menuTriggerByNode.nodeType) !== null && _menuTriggerByNode$no !== void 0 ? _menuTriggerByNode$no : '') && enableSourceSyncedBlockCreation) {
|
|
95
63
|
return /*#__PURE__*/React.createElement(CreateSyncedBlockDropdownItem, {
|
|
96
64
|
api: api
|
|
97
65
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.9",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@atlaskit/modal-dialog": "^14.9.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
51
|
"@atlaskit/primitives": "^17.0.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
53
|
-
"@atlaskit/tokens": "9.1.
|
|
54
|
-
"@atlaskit/tooltip": "^20.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^16.18.0",
|
|
53
|
+
"@atlaskit/tokens": "9.1.2",
|
|
54
|
+
"@atlaskit/tooltip": "^20.14.0",
|
|
55
55
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"bind-event-listener": "^3.0.0",
|