@atlaskit/editor-plugin-extension 10.0.15 → 10.0.16
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-extension
|
|
2
2
|
|
|
3
|
+
## 10.0.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`584ac5ca3f498`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/584ac5ca3f498) -
|
|
8
|
+
[ux] EDITOR-5269 Disables the copy button for legacy content macro nodes
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 10.0.15
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getToolbarConfig = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
10
|
var _react = _interopRequireDefault(require("react"));
|
|
10
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -27,6 +28,8 @@ var _commands = require("../editor-commands/commands");
|
|
|
27
28
|
var _pluginKey = require("./macro/plugin-key");
|
|
28
29
|
var _pluginFactory = require("./plugin-factory");
|
|
29
30
|
var _utils3 = require("./utils");
|
|
31
|
+
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; }
|
|
32
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
33
|
// non-bodied extensions nested inside panels, blockquotes and lists do not support layouts
|
|
31
34
|
var isNestedNBM = function isNestedNBM(state, selectedExtNode) {
|
|
32
35
|
var _state$schema$nodes = state.schema.nodes,
|
|
@@ -301,6 +304,10 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
301
304
|
};
|
|
302
305
|
};
|
|
303
306
|
}
|
|
307
|
+
|
|
308
|
+
// disable copy button for legacy content macro
|
|
309
|
+
var isLegacyContentMacro = (extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === 'com.atlassian.confluence.migration' && (extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionKey) === 'legacy-content';
|
|
310
|
+
var shouldHideCopyButton = isLegacyContentMacro && (0, _expValEquals.expValEquals)('platform_editor_disable_lcm_copy_button', 'isEnabled', true);
|
|
304
311
|
return {
|
|
305
312
|
title: 'Extension floating controls',
|
|
306
313
|
// Ignored via go/ees005
|
|
@@ -318,14 +325,16 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
318
325
|
}, {
|
|
319
326
|
type: 'extensions-placeholder',
|
|
320
327
|
separator: 'end'
|
|
321
|
-
}, {
|
|
328
|
+
}, _objectSpread({
|
|
322
329
|
type: 'copy-button',
|
|
323
330
|
items: [{
|
|
324
331
|
state: state,
|
|
325
332
|
formatMessage: intl.formatMessage,
|
|
326
333
|
nodeType: nodeType
|
|
327
334
|
}]
|
|
328
|
-
}, {
|
|
335
|
+
}, shouldHideCopyButton && {
|
|
336
|
+
hidden: shouldHideCopyButton
|
|
337
|
+
}), {
|
|
329
338
|
type: 'separator'
|
|
330
339
|
}, {
|
|
331
340
|
id: 'editor.extension.delete',
|
|
@@ -298,6 +298,10 @@ export const getToolbarConfig = ({
|
|
|
298
298
|
};
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
+
|
|
302
|
+
// disable copy button for legacy content macro
|
|
303
|
+
const isLegacyContentMacro = (extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === 'com.atlassian.confluence.migration' && (extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionKey) === 'legacy-content';
|
|
304
|
+
const shouldHideCopyButton = isLegacyContentMacro && expValEquals('platform_editor_disable_lcm_copy_button', 'isEnabled', true);
|
|
301
305
|
return {
|
|
302
306
|
title: 'Extension floating controls',
|
|
303
307
|
// Ignored via go/ees005
|
|
@@ -317,7 +321,10 @@ export const getToolbarConfig = ({
|
|
|
317
321
|
state,
|
|
318
322
|
formatMessage: intl.formatMessage,
|
|
319
323
|
nodeType
|
|
320
|
-
}]
|
|
324
|
+
}],
|
|
325
|
+
...(shouldHideCopyButton && {
|
|
326
|
+
hidden: shouldHideCopyButton
|
|
327
|
+
})
|
|
321
328
|
}, {
|
|
322
329
|
type: 'separator'
|
|
323
330
|
}, {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
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; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2
5
|
import React from 'react';
|
|
3
6
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
7
|
import { messages } from '@atlaskit/editor-common/extensions';
|
|
@@ -295,6 +298,10 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
295
298
|
};
|
|
296
299
|
};
|
|
297
300
|
}
|
|
301
|
+
|
|
302
|
+
// disable copy button for legacy content macro
|
|
303
|
+
var isLegacyContentMacro = (extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === 'com.atlassian.confluence.migration' && (extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionKey) === 'legacy-content';
|
|
304
|
+
var shouldHideCopyButton = isLegacyContentMacro && expValEquals('platform_editor_disable_lcm_copy_button', 'isEnabled', true);
|
|
298
305
|
return {
|
|
299
306
|
title: 'Extension floating controls',
|
|
300
307
|
// Ignored via go/ees005
|
|
@@ -312,14 +319,16 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
312
319
|
}, {
|
|
313
320
|
type: 'extensions-placeholder',
|
|
314
321
|
separator: 'end'
|
|
315
|
-
}, {
|
|
322
|
+
}, _objectSpread({
|
|
316
323
|
type: 'copy-button',
|
|
317
324
|
items: [{
|
|
318
325
|
state: state,
|
|
319
326
|
formatMessage: intl.formatMessage,
|
|
320
327
|
nodeType: nodeType
|
|
321
328
|
}]
|
|
322
|
-
}, {
|
|
329
|
+
}, shouldHideCopyButton && {
|
|
330
|
+
hidden: shouldHideCopyButton
|
|
331
|
+
}), {
|
|
323
332
|
type: 'separator'
|
|
324
333
|
}, {
|
|
325
334
|
id: 'editor.extension.delete',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.16",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/textarea": "^8.2.0",
|
|
57
57
|
"@atlaskit/textfield": "^8.2.0",
|
|
58
58
|
"@atlaskit/theme": "^21.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^25.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^25.1.0",
|
|
60
60
|
"@atlaskit/toggle": "^15.2.0",
|
|
61
61
|
"@atlaskit/tokens": "^11.0.0",
|
|
62
62
|
"@atlaskit/tooltip": "^20.14.0",
|