@atlaskit/editor-plugin-extension 5.0.11 → 5.1.1
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 +21 -0
- package/dist/cjs/pm-plugins/toolbar.js +21 -8
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +1 -0
- package/dist/cjs/ui/ConfigPanel/DescriptionSummary.js +5 -1
- package/dist/cjs/ui/ConfigPanel/Header.js +5 -1
- package/dist/es2019/pm-plugins/toolbar.js +20 -7
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +1 -0
- package/dist/es2019/ui/ConfigPanel/DescriptionSummary.js +5 -1
- package/dist/es2019/ui/ConfigPanel/Header.js +5 -1
- package/dist/esm/pm-plugins/toolbar.js +22 -8
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -0
- package/dist/esm/ui/ConfigPanel/DescriptionSummary.js +5 -1
- package/dist/esm/ui/ConfigPanel/Header.js +5 -1
- package/dist/types/ui/ConfigPanel/Header.d.ts +2 -0
- package/dist/types-ts4.5/ui/ConfigPanel/Header.d.ts +2 -0
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 5.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134468](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134468)
|
|
8
|
+
[`e312ec529d05a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e312ec529d05a) -
|
|
9
|
+
[ux] Apply hover decoration when hovering on copy/delete button on overflow menu
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.1.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#131974](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131974)
|
|
17
|
+
[`b09c9ea34848f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b09c9ea34848f) -
|
|
18
|
+
[PGXT-7297] Add support for deprecation status to extension manifest
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 5.0.11
|
|
4
25
|
|
|
5
26
|
### 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 _extensions = require("@atlaskit/editor-common/extensions");
|
|
@@ -12,6 +13,7 @@ var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages
|
|
|
12
13
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
15
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
16
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
17
|
var _contentWidthNarrow = _interopRequireDefault(require("@atlaskit/icon/core/content-width-narrow"));
|
|
16
18
|
var _contentWidthWide = _interopRequireDefault(require("@atlaskit/icon/core/content-width-wide"));
|
|
17
19
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
@@ -30,6 +32,8 @@ var _commands = require("../editor-commands/commands");
|
|
|
30
32
|
var _pluginKey = require("./macro/plugin-key");
|
|
31
33
|
var _pluginFactory = require("./plugin-factory");
|
|
32
34
|
var _utils3 = require("./utils");
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
33
37
|
// non-bodied extensions nested inside panels, blockquotes and lists do not support layouts
|
|
34
38
|
var isNestedNBM = function isNestedNBM(state, selectedExtNode) {
|
|
35
39
|
var _state$schema$nodes = state.schema.nodes,
|
|
@@ -254,7 +258,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
254
258
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
255
259
|
extensionApi = _ref.extensionApi;
|
|
256
260
|
return function (state, intl) {
|
|
257
|
-
var
|
|
261
|
+
var _hoverDecoration5, _hoverDecoration6, _hoverDecoration7, _hoverDecoration8;
|
|
258
262
|
var formatMessage = intl.formatMessage;
|
|
259
263
|
var extensionState = (0, _pluginFactory.getPluginState)(state);
|
|
260
264
|
if ((0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro')) {
|
|
@@ -295,6 +299,15 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
295
299
|
};
|
|
296
300
|
};
|
|
297
301
|
}
|
|
302
|
+
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
303
|
+
var _hoverDecoration, _hoverDecoration2, _hoverDecoration3, _hoverDecoration4;
|
|
304
|
+
return (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_1') ? {
|
|
305
|
+
onMouseEnter: (_hoverDecoration = hoverDecoration) === null || _hoverDecoration === void 0 ? void 0 : _hoverDecoration(nodeType, true, className),
|
|
306
|
+
onMouseLeave: (_hoverDecoration2 = hoverDecoration) === null || _hoverDecoration2 === void 0 ? void 0 : _hoverDecoration2(nodeType, false, className),
|
|
307
|
+
onFocus: (_hoverDecoration3 = hoverDecoration) === null || _hoverDecoration3 === void 0 ? void 0 : _hoverDecoration3(nodeType, true, className),
|
|
308
|
+
onBlur: (_hoverDecoration4 = hoverDecoration) === null || _hoverDecoration4 === void 0 ? void 0 : _hoverDecoration4(nodeType, false, className)
|
|
309
|
+
} : undefined;
|
|
310
|
+
};
|
|
298
311
|
return {
|
|
299
312
|
title: 'Extension floating controls',
|
|
300
313
|
// Ignored via go/ees005
|
|
@@ -328,10 +341,10 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
328
341
|
iconFallback: _remove.default,
|
|
329
342
|
appearance: 'danger',
|
|
330
343
|
onClick: (0, _commands.removeExtension)(editorAnalyticsAPI),
|
|
331
|
-
onMouseEnter: (
|
|
332
|
-
onMouseLeave: (
|
|
333
|
-
onFocus: (
|
|
334
|
-
onBlur: (
|
|
344
|
+
onMouseEnter: (_hoverDecoration5 = hoverDecoration) === null || _hoverDecoration5 === void 0 ? void 0 : _hoverDecoration5(nodeType, true),
|
|
345
|
+
onMouseLeave: (_hoverDecoration6 = hoverDecoration) === null || _hoverDecoration6 === void 0 ? void 0 : _hoverDecoration6(nodeType, false),
|
|
346
|
+
onFocus: (_hoverDecoration7 = hoverDecoration) === null || _hoverDecoration7 === void 0 ? void 0 : _hoverDecoration7(nodeType, true),
|
|
347
|
+
onBlur: (_hoverDecoration8 = hoverDecoration) === null || _hoverDecoration8 === void 0 ? void 0 : _hoverDecoration8(nodeType, false),
|
|
335
348
|
focusEditoronEnter: true,
|
|
336
349
|
title: formatMessage(_messages.default.remove),
|
|
337
350
|
tabIndex: null,
|
|
@@ -344,7 +357,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
344
357
|
separator: breakoutItems.length > 0 ? 'both' : 'end'
|
|
345
358
|
}, {
|
|
346
359
|
type: 'overflow-dropdown',
|
|
347
|
-
options: [{
|
|
360
|
+
options: [_objectSpread({
|
|
348
361
|
title: 'Copy',
|
|
349
362
|
onClick: function onClick() {
|
|
350
363
|
var _extensionApi$core, _extensionApi$floatin;
|
|
@@ -355,13 +368,13 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
355
368
|
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
356
369
|
label: "Copy"
|
|
357
370
|
})
|
|
358
|
-
}, {
|
|
371
|
+
}, hoverDecorationProps(nodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
|
|
359
372
|
title: 'Delete',
|
|
360
373
|
onClick: (0, _commands.removeExtension)(editorAnalyticsAPI),
|
|
361
374
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
362
375
|
label: "Delete"
|
|
363
376
|
})
|
|
364
|
-
}]
|
|
377
|
+
}, hoverDecorationProps(nodeType))]
|
|
365
378
|
}])),
|
|
366
379
|
scrollable: true
|
|
367
380
|
};
|
|
@@ -296,6 +296,7 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
296
296
|
icon: extensionManifest.icons['48'],
|
|
297
297
|
title: extensionManifest.title,
|
|
298
298
|
description: extensionManifest.description,
|
|
299
|
+
deprecation: extensionManifest.deprecation,
|
|
299
300
|
summary: extensionManifest.summary,
|
|
300
301
|
documentationUrl: extensionManifest.documentationUrl,
|
|
301
302
|
onClose: onCancel,
|
|
@@ -8,6 +8,7 @@ exports.DescriptionSummary = DescriptionSummary;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _primitives = require("@atlaskit/primitives");
|
|
12
13
|
var _HelpLink = require("./HelpLink");
|
|
13
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -23,6 +24,7 @@ function DescriptionSummary(_ref) {
|
|
|
23
24
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
24
25
|
formatMessage = _useIntl.formatMessage;
|
|
25
26
|
var description = extensionManifest.description,
|
|
27
|
+
deprecation = extensionManifest.deprecation,
|
|
26
28
|
documentationUrl = extensionManifest.documentationUrl;
|
|
27
29
|
// Use a temporary allowlist of top 3 macros to test out a new "Documentation" CTA ("Need help?")
|
|
28
30
|
// This will be removed when Top 5 Modernized Macros updates are rolled out
|
|
@@ -36,7 +38,9 @@ function DescriptionSummary(_ref) {
|
|
|
36
38
|
}, description && /*#__PURE__*/_react.default.createElement(_react.Fragment, null,
|
|
37
39
|
// Ignored via go/ees005
|
|
38
40
|
// eslint-disable-next-line require-unicode-regexp
|
|
39
|
-
description.replace(/([^.])$/, '$1.'), ' '),
|
|
41
|
+
description.replace(/([^.])$/, '$1.'), ' '), (deprecation === null || deprecation === void 0 ? void 0 : deprecation.isDeprecated) && (deprecation === null || deprecation === void 0 ? void 0 : deprecation.message) && (0, _platformFeatureFlags.fg)('platform_editor_extension_deprecation_status') && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
42
|
+
paddingBlockStart: "space.150"
|
|
43
|
+
}, deprecation.message), documentationUrl && (enableHelpCTA ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
40
44
|
xcss: helpLinkStyles
|
|
41
45
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
42
46
|
as: "p"
|
|
@@ -12,6 +12,7 @@ var _new = require("@atlaskit/button/new");
|
|
|
12
12
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _closeCross = _interopRequireDefault(require("@atlaskit/icon/core/migration/close--cross"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _primitives = require("@atlaskit/primitives");
|
|
16
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
18
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -94,6 +95,7 @@ var Header = function Header(_ref) {
|
|
|
94
95
|
title = _ref.title,
|
|
95
96
|
description = _ref.description,
|
|
96
97
|
summary = _ref.summary,
|
|
98
|
+
deprecation = _ref.deprecation,
|
|
97
99
|
documentationUrl = _ref.documentationUrl,
|
|
98
100
|
enableHelpCTA = _ref.enableHelpCTA,
|
|
99
101
|
onClose = _ref.onClose,
|
|
@@ -149,7 +151,9 @@ var Header = function Header(_ref) {
|
|
|
149
151
|
}, description && (0, _react2.jsx)(_react.Fragment, null,
|
|
150
152
|
// Ignored via go/ees005
|
|
151
153
|
// eslint-disable-next-line require-unicode-regexp
|
|
152
|
-
description.replace(/([^.])$/, '$1.'), ' '),
|
|
154
|
+
description.replace(/([^.])$/, '$1.'), ' '), (deprecation === null || deprecation === void 0 ? void 0 : deprecation.isDeprecated) && (deprecation === null || deprecation === void 0 ? void 0 : deprecation.message) && (0, _platformFeatureFlags.fg)('platform_editor_extension_deprecation_status') && (0, _react2.jsx)(_primitives.Box, {
|
|
155
|
+
paddingBlockStart: "space.150"
|
|
156
|
+
}, deprecation.message), documentationUrl && (enableHelpCTA ? (0, _react2.jsx)(_primitives.Box, {
|
|
153
157
|
xcss: helpLinkStyles
|
|
154
158
|
}, (0, _react2.jsx)(_primitives.Text, {
|
|
155
159
|
as: "p"
|
|
@@ -4,6 +4,7 @@ import commonMessages from '@atlaskit/editor-common/messages';
|
|
|
4
4
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
7
8
|
import ContentWidthNarrowIcon from '@atlaskit/icon/core/content-width-narrow';
|
|
8
9
|
import ContentWidthWideIcon from '@atlaskit/icon/core/content-width-wide';
|
|
9
10
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
@@ -22,6 +23,7 @@ import { removeDescendantNodes, removeExtension, updateExtensionLayout } from '.
|
|
|
22
23
|
import { pluginKey as macroPluginKey } from './macro/plugin-key';
|
|
23
24
|
import { getPluginState } from './plugin-factory';
|
|
24
25
|
import { getSelectedExtension } from './utils';
|
|
26
|
+
|
|
25
27
|
// non-bodied extensions nested inside panels, blockquotes and lists do not support layouts
|
|
26
28
|
const isNestedNBM = (state, selectedExtNode) => {
|
|
27
29
|
const {
|
|
@@ -261,7 +263,7 @@ export const getToolbarConfig = ({
|
|
|
261
263
|
editorAnalyticsAPI,
|
|
262
264
|
extensionApi
|
|
263
265
|
}) => (state, intl) => {
|
|
264
|
-
var
|
|
266
|
+
var _hoverDecoration5, _hoverDecoration6, _hoverDecoration7, _hoverDecoration8;
|
|
265
267
|
const {
|
|
266
268
|
formatMessage
|
|
267
269
|
} = intl;
|
|
@@ -299,6 +301,15 @@ export const getToolbarConfig = ({
|
|
|
299
301
|
};
|
|
300
302
|
};
|
|
301
303
|
}
|
|
304
|
+
const hoverDecorationProps = (nodeType, className) => {
|
|
305
|
+
var _hoverDecoration, _hoverDecoration2, _hoverDecoration3, _hoverDecoration4;
|
|
306
|
+
return fg('platform_editor_controls_patch_1') ? {
|
|
307
|
+
onMouseEnter: (_hoverDecoration = hoverDecoration) === null || _hoverDecoration === void 0 ? void 0 : _hoverDecoration(nodeType, true, className),
|
|
308
|
+
onMouseLeave: (_hoverDecoration2 = hoverDecoration) === null || _hoverDecoration2 === void 0 ? void 0 : _hoverDecoration2(nodeType, false, className),
|
|
309
|
+
onFocus: (_hoverDecoration3 = hoverDecoration) === null || _hoverDecoration3 === void 0 ? void 0 : _hoverDecoration3(nodeType, true, className),
|
|
310
|
+
onBlur: (_hoverDecoration4 = hoverDecoration) === null || _hoverDecoration4 === void 0 ? void 0 : _hoverDecoration4(nodeType, false, className)
|
|
311
|
+
} : undefined;
|
|
312
|
+
};
|
|
302
313
|
return {
|
|
303
314
|
title: 'Extension floating controls',
|
|
304
315
|
// Ignored via go/ees005
|
|
@@ -328,10 +339,10 @@ export const getToolbarConfig = ({
|
|
|
328
339
|
iconFallback: RemoveIcon,
|
|
329
340
|
appearance: 'danger',
|
|
330
341
|
onClick: removeExtension(editorAnalyticsAPI),
|
|
331
|
-
onMouseEnter: (
|
|
332
|
-
onMouseLeave: (
|
|
333
|
-
onFocus: (
|
|
334
|
-
onBlur: (
|
|
342
|
+
onMouseEnter: (_hoverDecoration5 = hoverDecoration) === null || _hoverDecoration5 === void 0 ? void 0 : _hoverDecoration5(nodeType, true),
|
|
343
|
+
onMouseLeave: (_hoverDecoration6 = hoverDecoration) === null || _hoverDecoration6 === void 0 ? void 0 : _hoverDecoration6(nodeType, false),
|
|
344
|
+
onFocus: (_hoverDecoration7 = hoverDecoration) === null || _hoverDecoration7 === void 0 ? void 0 : _hoverDecoration7(nodeType, true),
|
|
345
|
+
onBlur: (_hoverDecoration8 = hoverDecoration) === null || _hoverDecoration8 === void 0 ? void 0 : _hoverDecoration8(nodeType, false),
|
|
335
346
|
focusEditoronEnter: true,
|
|
336
347
|
title: formatMessage(commonMessages.remove),
|
|
337
348
|
tabIndex: null,
|
|
@@ -354,13 +365,15 @@ export const getToolbarConfig = ({
|
|
|
354
365
|
},
|
|
355
366
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
356
367
|
label: "Copy"
|
|
357
|
-
})
|
|
368
|
+
}),
|
|
369
|
+
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
358
370
|
}, {
|
|
359
371
|
title: 'Delete',
|
|
360
372
|
onClick: removeExtension(editorAnalyticsAPI),
|
|
361
373
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
362
374
|
label: "Delete"
|
|
363
|
-
})
|
|
375
|
+
}),
|
|
376
|
+
...hoverDecorationProps(nodeType)
|
|
364
377
|
}]
|
|
365
378
|
}])],
|
|
366
379
|
scrollable: true
|
|
@@ -240,6 +240,7 @@ class ConfigPanel extends React.Component {
|
|
|
240
240
|
icon: extensionManifest.icons['48'],
|
|
241
241
|
title: extensionManifest.title,
|
|
242
242
|
description: extensionManifest.description,
|
|
243
|
+
deprecation: extensionManifest.deprecation,
|
|
243
244
|
summary: extensionManifest.summary,
|
|
244
245
|
documentationUrl: extensionManifest.documentationUrl,
|
|
245
246
|
onClose: onCancel,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
5
6
|
import { HelpLink } from './HelpLink';
|
|
6
7
|
const descriptionStyles = xcss({
|
|
@@ -17,6 +18,7 @@ export function DescriptionSummary({
|
|
|
17
18
|
} = useIntl();
|
|
18
19
|
const {
|
|
19
20
|
description,
|
|
21
|
+
deprecation,
|
|
20
22
|
documentationUrl
|
|
21
23
|
} = extensionManifest;
|
|
22
24
|
// Use a temporary allowlist of top 3 macros to test out a new "Documentation" CTA ("Need help?")
|
|
@@ -31,7 +33,9 @@ export function DescriptionSummary({
|
|
|
31
33
|
}, description && /*#__PURE__*/React.createElement(Fragment, null,
|
|
32
34
|
// Ignored via go/ees005
|
|
33
35
|
// eslint-disable-next-line require-unicode-regexp
|
|
34
|
-
description.replace(/([^.])$/, '$1.'), ' '),
|
|
36
|
+
description.replace(/([^.])$/, '$1.'), ' '), (deprecation === null || deprecation === void 0 ? void 0 : deprecation.isDeprecated) && (deprecation === null || deprecation === void 0 ? void 0 : deprecation.message) && fg('platform_editor_extension_deprecation_status') && /*#__PURE__*/React.createElement(Box, {
|
|
37
|
+
paddingBlockStart: "space.150"
|
|
38
|
+
}, deprecation.message), documentationUrl && (enableHelpCTA ? /*#__PURE__*/React.createElement(Box, {
|
|
35
39
|
xcss: helpLinkStyles
|
|
36
40
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
37
41
|
as: "p"
|
|
@@ -11,6 +11,7 @@ import { IconButton } from '@atlaskit/button/new';
|
|
|
11
11
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
12
12
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import CrossIcon from '@atlaskit/icon/core/migration/close--cross';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
15
16
|
import { N200 } from '@atlaskit/theme/colors';
|
|
16
17
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -86,6 +87,7 @@ const Header = ({
|
|
|
86
87
|
title,
|
|
87
88
|
description,
|
|
88
89
|
summary,
|
|
90
|
+
deprecation,
|
|
89
91
|
documentationUrl,
|
|
90
92
|
enableHelpCTA,
|
|
91
93
|
onClose,
|
|
@@ -140,7 +142,9 @@ const Header = ({
|
|
|
140
142
|
}, description && jsx(Fragment, null,
|
|
141
143
|
// Ignored via go/ees005
|
|
142
144
|
// eslint-disable-next-line require-unicode-regexp
|
|
143
|
-
description.replace(/([^.])$/, '$1.'), ' '),
|
|
145
|
+
description.replace(/([^.])$/, '$1.'), ' '), (deprecation === null || deprecation === void 0 ? void 0 : deprecation.isDeprecated) && (deprecation === null || deprecation === void 0 ? void 0 : deprecation.message) && fg('platform_editor_extension_deprecation_status') && jsx(Box, {
|
|
146
|
+
paddingBlockStart: "space.150"
|
|
147
|
+
}, deprecation.message), documentationUrl && (enableHelpCTA ? jsx(Box, {
|
|
144
148
|
xcss: helpLinkStyles
|
|
145
149
|
}, jsx(Text, {
|
|
146
150
|
as: "p"
|
|
@@ -1,10 +1,14 @@
|
|
|
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 { messages } from '@atlaskit/editor-common/extensions';
|
|
4
7
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
5
8
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
6
9
|
import { getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
7
10
|
import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
+
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
8
12
|
import ContentWidthNarrowIcon from '@atlaskit/icon/core/content-width-narrow';
|
|
9
13
|
import ContentWidthWideIcon from '@atlaskit/icon/core/content-width-wide';
|
|
10
14
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
@@ -23,6 +27,7 @@ import { removeDescendantNodes, removeExtension, updateExtensionLayout } from '.
|
|
|
23
27
|
import { pluginKey as macroPluginKey } from './macro/plugin-key';
|
|
24
28
|
import { getPluginState } from './plugin-factory';
|
|
25
29
|
import { getSelectedExtension } from './utils';
|
|
30
|
+
|
|
26
31
|
// non-bodied extensions nested inside panels, blockquotes and lists do not support layouts
|
|
27
32
|
var isNestedNBM = function isNestedNBM(state, selectedExtNode) {
|
|
28
33
|
var _state$schema$nodes = state.schema.nodes,
|
|
@@ -247,7 +252,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
247
252
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
248
253
|
extensionApi = _ref.extensionApi;
|
|
249
254
|
return function (state, intl) {
|
|
250
|
-
var
|
|
255
|
+
var _hoverDecoration5, _hoverDecoration6, _hoverDecoration7, _hoverDecoration8;
|
|
251
256
|
var formatMessage = intl.formatMessage;
|
|
252
257
|
var extensionState = getPluginState(state);
|
|
253
258
|
if (fg('platform_editor_legacy_content_macro')) {
|
|
@@ -288,6 +293,15 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
288
293
|
};
|
|
289
294
|
};
|
|
290
295
|
}
|
|
296
|
+
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
297
|
+
var _hoverDecoration, _hoverDecoration2, _hoverDecoration3, _hoverDecoration4;
|
|
298
|
+
return fg('platform_editor_controls_patch_1') ? {
|
|
299
|
+
onMouseEnter: (_hoverDecoration = hoverDecoration) === null || _hoverDecoration === void 0 ? void 0 : _hoverDecoration(nodeType, true, className),
|
|
300
|
+
onMouseLeave: (_hoverDecoration2 = hoverDecoration) === null || _hoverDecoration2 === void 0 ? void 0 : _hoverDecoration2(nodeType, false, className),
|
|
301
|
+
onFocus: (_hoverDecoration3 = hoverDecoration) === null || _hoverDecoration3 === void 0 ? void 0 : _hoverDecoration3(nodeType, true, className),
|
|
302
|
+
onBlur: (_hoverDecoration4 = hoverDecoration) === null || _hoverDecoration4 === void 0 ? void 0 : _hoverDecoration4(nodeType, false, className)
|
|
303
|
+
} : undefined;
|
|
304
|
+
};
|
|
291
305
|
return {
|
|
292
306
|
title: 'Extension floating controls',
|
|
293
307
|
// Ignored via go/ees005
|
|
@@ -321,10 +335,10 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
321
335
|
iconFallback: RemoveIcon,
|
|
322
336
|
appearance: 'danger',
|
|
323
337
|
onClick: removeExtension(editorAnalyticsAPI),
|
|
324
|
-
onMouseEnter: (
|
|
325
|
-
onMouseLeave: (
|
|
326
|
-
onFocus: (
|
|
327
|
-
onBlur: (
|
|
338
|
+
onMouseEnter: (_hoverDecoration5 = hoverDecoration) === null || _hoverDecoration5 === void 0 ? void 0 : _hoverDecoration5(nodeType, true),
|
|
339
|
+
onMouseLeave: (_hoverDecoration6 = hoverDecoration) === null || _hoverDecoration6 === void 0 ? void 0 : _hoverDecoration6(nodeType, false),
|
|
340
|
+
onFocus: (_hoverDecoration7 = hoverDecoration) === null || _hoverDecoration7 === void 0 ? void 0 : _hoverDecoration7(nodeType, true),
|
|
341
|
+
onBlur: (_hoverDecoration8 = hoverDecoration) === null || _hoverDecoration8 === void 0 ? void 0 : _hoverDecoration8(nodeType, false),
|
|
328
342
|
focusEditoronEnter: true,
|
|
329
343
|
title: formatMessage(commonMessages.remove),
|
|
330
344
|
tabIndex: null,
|
|
@@ -337,7 +351,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
337
351
|
separator: breakoutItems.length > 0 ? 'both' : 'end'
|
|
338
352
|
}, {
|
|
339
353
|
type: 'overflow-dropdown',
|
|
340
|
-
options: [{
|
|
354
|
+
options: [_objectSpread({
|
|
341
355
|
title: 'Copy',
|
|
342
356
|
onClick: function onClick() {
|
|
343
357
|
var _extensionApi$core, _extensionApi$floatin;
|
|
@@ -348,13 +362,13 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
348
362
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
349
363
|
label: "Copy"
|
|
350
364
|
})
|
|
351
|
-
}, {
|
|
365
|
+
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)), _objectSpread({
|
|
352
366
|
title: 'Delete',
|
|
353
367
|
onClick: removeExtension(editorAnalyticsAPI),
|
|
354
368
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
355
369
|
label: "Delete"
|
|
356
370
|
})
|
|
357
|
-
}]
|
|
371
|
+
}, hoverDecorationProps(nodeType))]
|
|
358
372
|
}])),
|
|
359
373
|
scrollable: true
|
|
360
374
|
};
|
|
@@ -286,6 +286,7 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
286
286
|
icon: extensionManifest.icons['48'],
|
|
287
287
|
title: extensionManifest.title,
|
|
288
288
|
description: extensionManifest.description,
|
|
289
|
+
deprecation: extensionManifest.deprecation,
|
|
289
290
|
summary: extensionManifest.summary,
|
|
290
291
|
documentationUrl: extensionManifest.documentationUrl,
|
|
291
292
|
onClose: onCancel,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
5
6
|
import { HelpLink } from './HelpLink';
|
|
6
7
|
var descriptionStyles = xcss({
|
|
@@ -14,6 +15,7 @@ export function DescriptionSummary(_ref) {
|
|
|
14
15
|
var _useIntl = useIntl(),
|
|
15
16
|
formatMessage = _useIntl.formatMessage;
|
|
16
17
|
var description = extensionManifest.description,
|
|
18
|
+
deprecation = extensionManifest.deprecation,
|
|
17
19
|
documentationUrl = extensionManifest.documentationUrl;
|
|
18
20
|
// Use a temporary allowlist of top 3 macros to test out a new "Documentation" CTA ("Need help?")
|
|
19
21
|
// This will be removed when Top 5 Modernized Macros updates are rolled out
|
|
@@ -27,7 +29,9 @@ export function DescriptionSummary(_ref) {
|
|
|
27
29
|
}, description && /*#__PURE__*/React.createElement(Fragment, null,
|
|
28
30
|
// Ignored via go/ees005
|
|
29
31
|
// eslint-disable-next-line require-unicode-regexp
|
|
30
|
-
description.replace(/([^.])$/, '$1.'), ' '),
|
|
32
|
+
description.replace(/([^.])$/, '$1.'), ' '), (deprecation === null || deprecation === void 0 ? void 0 : deprecation.isDeprecated) && (deprecation === null || deprecation === void 0 ? void 0 : deprecation.message) && fg('platform_editor_extension_deprecation_status') && /*#__PURE__*/React.createElement(Box, {
|
|
33
|
+
paddingBlockStart: "space.150"
|
|
34
|
+
}, deprecation.message), documentationUrl && (enableHelpCTA ? /*#__PURE__*/React.createElement(Box, {
|
|
31
35
|
xcss: helpLinkStyles
|
|
32
36
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
33
37
|
as: "p"
|
|
@@ -11,6 +11,7 @@ import { IconButton } from '@atlaskit/button/new';
|
|
|
11
11
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
12
12
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import CrossIcon from '@atlaskit/icon/core/migration/close--cross';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
15
16
|
import { N200 } from '@atlaskit/theme/colors';
|
|
16
17
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -86,6 +87,7 @@ var Header = function Header(_ref) {
|
|
|
86
87
|
title = _ref.title,
|
|
87
88
|
description = _ref.description,
|
|
88
89
|
summary = _ref.summary,
|
|
90
|
+
deprecation = _ref.deprecation,
|
|
89
91
|
documentationUrl = _ref.documentationUrl,
|
|
90
92
|
enableHelpCTA = _ref.enableHelpCTA,
|
|
91
93
|
onClose = _ref.onClose,
|
|
@@ -141,7 +143,9 @@ var Header = function Header(_ref) {
|
|
|
141
143
|
}, description && jsx(Fragment, null,
|
|
142
144
|
// Ignored via go/ees005
|
|
143
145
|
// eslint-disable-next-line require-unicode-regexp
|
|
144
|
-
description.replace(/([^.])$/, '$1.'), ' '),
|
|
146
|
+
description.replace(/([^.])$/, '$1.'), ' '), (deprecation === null || deprecation === void 0 ? void 0 : deprecation.isDeprecated) && (deprecation === null || deprecation === void 0 ? void 0 : deprecation.message) && fg('platform_editor_extension_deprecation_status') && jsx(Box, {
|
|
147
|
+
paddingBlockStart: "space.150"
|
|
148
|
+
}, deprecation.message), documentationUrl && (enableHelpCTA ? jsx(Box, {
|
|
145
149
|
xcss: helpLinkStyles
|
|
146
150
|
}, jsx(Text, {
|
|
147
151
|
as: "p"
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { Icon } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { type ExtensionDeprecationStatus } from '@atlaskit/editor-common/extensions';
|
|
4
5
|
type Props = {
|
|
5
6
|
title: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
summary?: string;
|
|
9
|
+
deprecation?: ExtensionDeprecationStatus;
|
|
8
10
|
documentationUrl?: string;
|
|
9
11
|
enableHelpCTA?: boolean;
|
|
10
12
|
icon: Icon;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { Icon } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import { type ExtensionDeprecationStatus } from '@atlaskit/editor-common/extensions';
|
|
4
5
|
type Props = {
|
|
5
6
|
title: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
summary?: string;
|
|
9
|
+
deprecation?: ExtensionDeprecationStatus;
|
|
8
10
|
documentationUrl?: string;
|
|
9
11
|
enableHelpCTA?: boolean;
|
|
10
12
|
icon: Icon;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/button": "^22.0.0",
|
|
33
33
|
"@atlaskit/checkbox": "^17.0.0",
|
|
34
34
|
"@atlaskit/datetime-picker": "^16.2.0",
|
|
35
|
-
"@atlaskit/editor-common": "^102.
|
|
35
|
+
"@atlaskit/editor-common": "^102.15.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-context-identifier": "^2.0.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/empty-state": "^9.0.0",
|
|
47
47
|
"@atlaskit/form": "^12.0.0",
|
|
48
48
|
"@atlaskit/heading": "^5.1.0",
|
|
49
|
-
"@atlaskit/icon": "^25.
|
|
49
|
+
"@atlaskit/icon": "^25.3.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
51
|
"@atlaskit/primitives": "^14.2.0",
|
|
52
52
|
"@atlaskit/radio": "^8.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/textarea": "^8.0.0",
|
|
59
59
|
"@atlaskit/textfield": "^8.0.0",
|
|
60
60
|
"@atlaskit/theme": "^18.0.0",
|
|
61
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
62
62
|
"@atlaskit/toggle": "^15.0.0",
|
|
63
63
|
"@atlaskit/tokens": "^4.5.0",
|
|
64
64
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -117,6 +117,12 @@
|
|
|
117
117
|
},
|
|
118
118
|
"platform_editor_ai_object_sidebar_injection": {
|
|
119
119
|
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"platform_editor_extension_deprecation_status": {
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"platform_editor_controls_patch_1": {
|
|
125
|
+
"type": "boolean"
|
|
120
126
|
}
|
|
121
127
|
},
|
|
122
128
|
"stricter": {
|