@atlaskit/editor-common 107.7.0 → 107.7.2

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/afm-post-office/tsconfig.json +3 -0
  5. package/dist/cjs/extensibility/Extension/Extension/index.js +15 -2
  6. package/dist/cjs/extensibility/Extension/Extension/styles.js +4 -0
  7. package/dist/cjs/extensibility/Extension/LegacyContentHeader/index.js +109 -0
  8. package/dist/cjs/extensibility/index.js +7 -0
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/es2019/extensibility/Extension/Extension/index.js +10 -1
  12. package/dist/es2019/extensibility/Extension/Extension/styles.js +4 -0
  13. package/dist/es2019/extensibility/Extension/LegacyContentHeader/index.js +104 -0
  14. package/dist/es2019/extensibility/index.js +1 -0
  15. package/dist/es2019/monitoring/error.js +1 -1
  16. package/dist/es2019/ui/DropList/index.js +1 -1
  17. package/dist/esm/extensibility/Extension/Extension/index.js +15 -2
  18. package/dist/esm/extensibility/Extension/Extension/styles.js +4 -0
  19. package/dist/esm/extensibility/Extension/LegacyContentHeader/index.js +102 -0
  20. package/dist/esm/extensibility/index.js +1 -0
  21. package/dist/esm/monitoring/error.js +1 -1
  22. package/dist/esm/ui/DropList/index.js +1 -1
  23. package/dist/types/extensibility/Extension/LegacyContentHeader/index.d.ts +12 -0
  24. package/dist/types/extensibility/index.d.ts +1 -0
  25. package/dist/types-ts4.5/extensibility/Extension/LegacyContentHeader/index.d.ts +12 -0
  26. package/dist/types-ts4.5/extensibility/index.d.ts +1 -0
  27. package/package.json +8 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 107.7.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#179943](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/179943)
14
+ [`3ecd2fde1b7b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3ecd2fde1b7b2) -
15
+ [ux] [EDITOR-981] Update extension to use new LegacyContentHeader behind fg
16
+ 'platform_editor_legacy_content_macro_visual_update'
17
+ - Updated dependencies
18
+
3
19
  ## 107.7.0
4
20
 
5
21
  ### Minor Changes
@@ -146,6 +146,9 @@
146
146
  {
147
147
  "path": "../../../design-system/spinner/afm-cc/tsconfig.json"
148
148
  },
149
+ {
150
+ "path": "../../../elements/status/afm-cc/tsconfig.json"
151
+ },
149
152
  {
150
153
  "path": "../../../elements/task-decision/afm-cc/tsconfig.json"
151
154
  },
@@ -146,6 +146,9 @@
146
146
  {
147
147
  "path": "../../../design-system/spinner/afm-jira/tsconfig.json"
148
148
  },
149
+ {
150
+ "path": "../../../elements/status/afm-jira/tsconfig.json"
151
+ },
149
152
  {
150
153
  "path": "../../../elements/task-decision/afm-jira/tsconfig.json"
151
154
  },
@@ -146,6 +146,9 @@
146
146
  {
147
147
  "path": "../../../design-system/spinner/afm-post-office/tsconfig.json"
148
148
  },
149
+ {
150
+ "path": "../../../elements/status/afm-post-office/tsconfig.json"
151
+ },
149
152
  {
150
153
  "path": "../../../elements/task-decision/afm-post-office/tsconfig.json"
151
154
  },
@@ -12,10 +12,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _react2 = require("@emotion/react");
14
14
  var _classnames2 = _interopRequireDefault(require("classnames"));
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _hooks = require("../../../hooks");
16
17
  var _useSharedPluginStateSelector = require("../../../hooks/useSharedPluginStateSelector/useSharedPluginStateSelector");
17
18
  var _ui = require("../../../ui");
18
19
  var _utils = require("../../../utils");
20
+ var _LegacyContentHeader = require("../LegacyContentHeader");
19
21
  var _Lozenge = _interopRequireDefault(require("../Lozenge"));
20
22
  var _styles = require("../styles");
21
23
  var _extensionUtils = require("./extension-utils");
@@ -56,6 +58,7 @@ function ExtensionWithPluginState(props) {
56
58
  var _extensionNode$attrs, _extensionNode$attrs2;
57
59
  return extensionNode.type.name === 'extension' && ((_extensionNode$attrs = extensionNode.attrs) === null || _extensionNode$attrs === void 0 ? void 0 : _extensionNode$attrs.extensionType) === 'com.atlassian.confluence.migration' && ((_extensionNode$attrs2 = extensionNode.attrs) === null || _extensionNode$attrs2 === void 0 ? void 0 : _extensionNode$attrs2.extensionKey) === 'legacy-content';
58
60
  };
61
+ var showLegacyContentHeader = (0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro_visual_update') && isLegacyContentMacroExtension(node);
59
62
  var hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
60
63
  var hasChildren = !!children;
61
64
  var removeBorder = showMacroInteractionDesignUpdates || !!(hideFrame && !hasBody);
@@ -87,7 +90,8 @@ function ExtensionWithPluginState(props) {
87
90
  'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
88
91
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
89
92
  'with-danger-overlay': showMacroInteractionDesignUpdates,
90
- 'without-frame': removeBorder
93
+ 'without-frame': removeBorder,
94
+ 'legacy-content': showLegacyContentHeader
91
95
  }, _styles2.widerLayoutClassName, shouldBreakout));
92
96
  var overflowClassNames = (0, _classnames2.default)('extension-overflow-wrapper', {
93
97
  'with-body': hasBody,
@@ -128,7 +132,16 @@ function ExtensionWithPluginState(props) {
128
132
  setIsNodeHovered(didHover);
129
133
  }
130
134
  };
131
- return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && (0, _react2.jsx)(_Lozenge.default, {
135
+ return (0, _react2.jsx)(_react.Fragment, null, showLegacyContentHeader && (0, _react2.jsx)(_LegacyContentHeader.LegacyContentHeader, {
136
+ isNodeSelected: isNodeSelected,
137
+ isNodeHovered: isNodeHovered,
138
+ onMouseEnter: function onMouseEnter() {
139
+ return handleMouseEvent(true);
140
+ },
141
+ onMouseLeave: function onMouseLeave() {
142
+ return handleMouseEvent(false);
143
+ }
144
+ }), !showLegacyContentHeader && showMacroInteractionDesignUpdates && !isLivePageViewMode && (0, _react2.jsx)(_Lozenge.default, {
132
145
  isNodeSelected: isNodeSelected,
133
146
  isNodeHovered: isNodeHovered,
134
147
  isNodeNested: isNodeNested,
@@ -33,6 +33,10 @@ var wrapperStyleWithoutCursor = (0, _react.css)(_styles.wrapperDefault, {
33
33
  '&.with-margin-styles': {
34
34
  margin: "0 ".concat("var(--ds-space-negative-250, -20px)"),
35
35
  padding: "0 ".concat("var(--ds-space-250, 20px)")
36
+ },
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
38
+ '&.legacy-content': {
39
+ borderRadius: "0 0 ".concat("var(--ds-border-radius, 3px)", " ", "var(--ds-border-radius, 3px)")
36
40
  }
37
41
  });
38
42
 
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.LegacyContentHeader = void 0;
8
+ var _react = require("react");
9
+ var _react2 = require("@emotion/react");
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _reactIntlNext = require("react-intl-next");
12
+ var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
13
+ var _link = _interopRequireDefault(require("@atlaskit/link"));
14
+ var _status = require("@atlaskit/status");
15
+ /**
16
+ * @jsxRuntime classic
17
+ * @jsx jsx
18
+ */
19
+
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
+
22
+ var i18n = (0, _reactIntlNext.defineMessages)({
23
+ legacyContentHeader: {
24
+ id: 'editor.extension.legacyContentHeader',
25
+ defaultMessage: 'Legacy Content',
26
+ description: 'Header for the legacy content extension in the editor.'
27
+ },
28
+ contentHasLimitedFunctionality: {
29
+ id: 'editor.extension.legacyContentHeader.contentHasLimitedFunctionality',
30
+ defaultMessage: 'This content has limited functionality, ',
31
+ description: 'Message indicating that the legacy content has limited functionality.'
32
+ },
33
+ learnMore: {
34
+ id: 'editor.extension.legacyContentHeader.learnMore',
35
+ defaultMessage: ' Learn more',
36
+ description: 'Link text for learning more about the legacy content.'
37
+ }
38
+ });
39
+ var lcmHeaderStyles = (0, _react2.css)({
40
+ padding: "0 ".concat("var(--ds-space-200, 16px)", " ", "var(--ds-space-050, 4px)", " ", "var(--ds-space-200, 16px)"),
41
+ backgroundColor: "var(--ds-background-neutral, #0515240F)",
42
+ borderRadius: "var(--ds-border-radius, 4px)".concat(" ", "var(--ds-border-radius, 4px)", " 0 0"),
43
+ boxShadow: "0 0 0 1px ".concat("var(--ds-background-neutral, #0515240F)"),
44
+ position: 'relative',
45
+ top: "-1px",
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
47
+ '&.with-hover-border': {
48
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-input, #8590A2)")
49
+ },
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
51
+ '&.selected': {
52
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, #0C66E4)"),
53
+ backgroundColor: "var(--ds-background-selected, #E9F2FF)"
54
+ },
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
56
+ '& .status-lozenge-span': {
57
+ marginRight: "var(--ds-space-100, 8px)"
58
+ },
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
60
+ '& > .legacy-content-header-text': {
61
+ font: "var(--ds-font-body-UNSAFE_small, 12px)",
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
63
+ '& span': {
64
+ paddingRight: "var(--ds-space-050, 4px)"
65
+ },
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
67
+ '& a': {
68
+ cursor: 'pointer'
69
+ }
70
+ }
71
+ });
72
+ var LegacyContentHeader = exports.LegacyContentHeader = function LegacyContentHeader(_ref) {
73
+ var isNodeHovered = _ref.isNodeHovered,
74
+ isNodeSelected = _ref.isNodeSelected,
75
+ onMouseEnter = _ref.onMouseEnter,
76
+ onMouseLeave = _ref.onMouseLeave;
77
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
78
+ formatMessage = _useIntl.formatMessage;
79
+ var classNames = (0, _classnames.default)('legacy-content-header', {
80
+ 'with-hover-border': isNodeHovered,
81
+ selected: isNodeSelected
82
+ });
83
+ var learnMore = (0, _react.useCallback)(function () {
84
+ window.open('https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/', '_blank');
85
+ }, []);
86
+ return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", {
87
+ "data-testid": "editor-extension-legacy-content-header",
88
+ css: [lcmHeaderStyles]
89
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
90
+ ,
91
+ className: classNames,
92
+ onMouseEnter: onMouseEnter,
93
+ onMouseLeave: onMouseLeave
94
+ }, (0, _react2.jsx)(_status.Status, {
95
+ text: formatMessage(i18n.legacyContentHeader),
96
+ color: isNodeSelected ? 'blue' : 'neutral',
97
+ style: "bold",
98
+ isBold: true
99
+ }), (0, _react2.jsx)("span", {
100
+ className: "legacy-content-header-text"
101
+ }, (0, _react2.jsx)(_statusWarning.default, {
102
+ label: formatMessage(i18n.contentHasLimitedFunctionality),
103
+ size: "small"
104
+ }), formatMessage(i18n.contentHasLimitedFunctionality), "\xA0", (0, _react2.jsx)(_link.default, {
105
+ onClick: learnMore,
106
+ href: "https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/",
107
+ target: "_blank"
108
+ }, formatMessage(i18n.learnMore)))));
109
+ };
@@ -34,8 +34,15 @@ Object.defineProperty(exports, "ExtensionNodeWrapper", {
34
34
  return _ExtensionNodeWrapper.ExtensionNodeWrapper;
35
35
  }
36
36
  });
37
+ Object.defineProperty(exports, "LegacyContentHeader", {
38
+ enumerable: true,
39
+ get: function get() {
40
+ return _LegacyContentHeader.LegacyContentHeader;
41
+ }
42
+ });
37
43
  var _ExtensionNodeWrapper = require("./ExtensionNodeWrapper");
38
44
  var _Extension = require("./Extension");
45
+ var _LegacyContentHeader = require("./Extension/LegacyContentHeader");
39
46
  var _extensionNodeView = _interopRequireWildcard(require("./extensionNodeView"));
40
47
  var _ExtensionComponent = require("./ExtensionComponent");
41
48
  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); }
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  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); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "107.6.1";
19
+ var packageVersion = "107.7.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "107.6.1";
26
+ var packageVersion = "107.7.1";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -9,10 +9,12 @@ import React, { Fragment } from 'react';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { jsx } from '@emotion/react';
11
11
  import classnames from 'classnames';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '../../../hooks';
13
14
  import { useSharedPluginStateSelector } from '../../../hooks/useSharedPluginStateSelector/useSharedPluginStateSelector';
14
15
  import { overflowShadow } from '../../../ui';
15
16
  import { calculateBreakoutStyles } from '../../../utils';
17
+ import { LegacyContentHeader } from '../LegacyContentHeader';
16
18
  import ExtensionLozenge from '../Lozenge';
17
19
  import { overlay } from '../styles';
18
20
  import { isEmptyBodiedMacro } from './extension-utils';
@@ -47,6 +49,7 @@ function ExtensionWithPluginState(props) {
47
49
  var _extensionNode$attrs, _extensionNode$attrs2;
48
50
  return extensionNode.type.name === 'extension' && ((_extensionNode$attrs = extensionNode.attrs) === null || _extensionNode$attrs === void 0 ? void 0 : _extensionNode$attrs.extensionType) === 'com.atlassian.confluence.migration' && ((_extensionNode$attrs2 = extensionNode.attrs) === null || _extensionNode$attrs2 === void 0 ? void 0 : _extensionNode$attrs2.extensionKey) === 'legacy-content';
49
51
  };
52
+ const showLegacyContentHeader = fg('platform_editor_legacy_content_macro_visual_update') && isLegacyContentMacroExtension(node);
50
53
  const hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
51
54
  const hasChildren = !!children;
52
55
  const removeBorder = showMacroInteractionDesignUpdates || !!(hideFrame && !hasBody);
@@ -81,6 +84,7 @@ function ExtensionWithPluginState(props) {
81
84
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
82
85
  'with-danger-overlay': showMacroInteractionDesignUpdates,
83
86
  'without-frame': removeBorder,
87
+ 'legacy-content': showLegacyContentHeader,
84
88
  [widerLayoutClassName]: shouldBreakout
85
89
  });
86
90
  const overflowClassNames = classnames('extension-overflow-wrapper', {
@@ -128,7 +132,12 @@ function ExtensionWithPluginState(props) {
128
132
  setIsNodeHovered(didHover);
129
133
  }
130
134
  };
131
- return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
135
+ return jsx(Fragment, null, showLegacyContentHeader && jsx(LegacyContentHeader, {
136
+ isNodeSelected: isNodeSelected,
137
+ isNodeHovered: isNodeHovered,
138
+ onMouseEnter: () => handleMouseEvent(true),
139
+ onMouseLeave: () => handleMouseEvent(false)
140
+ }), !showLegacyContentHeader && showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
132
141
  isNodeSelected: isNodeSelected,
133
142
  isNodeHovered: isNodeHovered,
134
143
  isNodeNested: isNodeNested,
@@ -26,6 +26,10 @@ const wrapperStyleWithoutCursor = css(wrapperDefault, {
26
26
  '&.with-margin-styles': {
27
27
  margin: `0 ${"var(--ds-space-negative-250, -20px)"}`,
28
28
  padding: `0 ${"var(--ds-space-250, 20px)"}`
29
+ },
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
31
+ '&.legacy-content': {
32
+ borderRadius: `0 0 ${"var(--ds-border-radius, 3px)"} ${"var(--ds-border-radius, 3px)"}`
29
33
  }
30
34
  });
31
35
 
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+
6
+ import { Fragment, useCallback } from 'react';
7
+
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
+ import { css, jsx } from '@emotion/react';
10
+ import classnames from 'classnames';
11
+ import { defineMessages, useIntl } from 'react-intl-next';
12
+ import StatusWarningIcon from '@atlaskit/icon/core/status-warning';
13
+ import Link from '@atlaskit/link';
14
+ import { Status } from '@atlaskit/status';
15
+ const i18n = defineMessages({
16
+ legacyContentHeader: {
17
+ id: 'editor.extension.legacyContentHeader',
18
+ defaultMessage: 'Legacy Content',
19
+ description: 'Header for the legacy content extension in the editor.'
20
+ },
21
+ contentHasLimitedFunctionality: {
22
+ id: 'editor.extension.legacyContentHeader.contentHasLimitedFunctionality',
23
+ defaultMessage: 'This content has limited functionality, ',
24
+ description: 'Message indicating that the legacy content has limited functionality.'
25
+ },
26
+ learnMore: {
27
+ id: 'editor.extension.legacyContentHeader.learnMore',
28
+ defaultMessage: ' Learn more',
29
+ description: 'Link text for learning more about the legacy content.'
30
+ }
31
+ });
32
+ const lcmHeaderStyles = css({
33
+ padding: `0 ${"var(--ds-space-200, 16px)"} ${"var(--ds-space-050, 4px)"} ${"var(--ds-space-200, 16px)"}`,
34
+ backgroundColor: "var(--ds-background-neutral, #0515240F)",
35
+ borderRadius: `${"var(--ds-border-radius, 4px)"} ${"var(--ds-border-radius, 4px)"} 0 0`,
36
+ boxShadow: `0 0 0 1px ${"var(--ds-background-neutral, #0515240F)"}`,
37
+ position: 'relative',
38
+ top: `-1px`,
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
40
+ '&.with-hover-border': {
41
+ boxShadow: `0 0 0 1px ${"var(--ds-border-input, #8590A2)"}`
42
+ },
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
44
+ '&.selected': {
45
+ boxShadow: `0 0 0 1px ${"var(--ds-border-selected, #0C66E4)"}`,
46
+ backgroundColor: "var(--ds-background-selected, #E9F2FF)"
47
+ },
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
49
+ '& .status-lozenge-span': {
50
+ marginRight: "var(--ds-space-100, 8px)"
51
+ },
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
53
+ '& > .legacy-content-header-text': {
54
+ font: "var(--ds-font-body-UNSAFE_small, 12px)",
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
56
+ '& span': {
57
+ paddingRight: "var(--ds-space-050, 4px)"
58
+ },
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
60
+ '& a': {
61
+ cursor: 'pointer'
62
+ }
63
+ }
64
+ });
65
+ export const LegacyContentHeader = ({
66
+ isNodeHovered,
67
+ isNodeSelected,
68
+ onMouseEnter,
69
+ onMouseLeave
70
+ }) => {
71
+ const {
72
+ formatMessage
73
+ } = useIntl();
74
+ const classNames = classnames('legacy-content-header', {
75
+ 'with-hover-border': isNodeHovered,
76
+ selected: isNodeSelected
77
+ });
78
+ const learnMore = useCallback(() => {
79
+ window.open('https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/', '_blank');
80
+ }, []);
81
+ return jsx(Fragment, null, jsx("div", {
82
+ "data-testid": "editor-extension-legacy-content-header",
83
+ css: [lcmHeaderStyles]
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
85
+ ,
86
+ className: classNames,
87
+ onMouseEnter: onMouseEnter,
88
+ onMouseLeave: onMouseLeave
89
+ }, jsx(Status, {
90
+ text: formatMessage(i18n.legacyContentHeader),
91
+ color: isNodeSelected ? 'blue' : 'neutral',
92
+ style: "bold",
93
+ isBold: true
94
+ }), jsx("span", {
95
+ className: "legacy-content-header-text"
96
+ }, jsx(StatusWarningIcon, {
97
+ label: formatMessage(i18n.contentHasLimitedFunctionality),
98
+ size: "small"
99
+ }), formatMessage(i18n.contentHasLimitedFunctionality), "\xA0", jsx(Link, {
100
+ onClick: learnMore,
101
+ href: "https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/",
102
+ target: "_blank"
103
+ }, formatMessage(i18n.learnMore)))));
104
+ };
@@ -3,5 +3,6 @@
3
3
 
4
4
  export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
5
5
  export { Extension } from './Extension';
6
+ export { LegacyContentHeader } from './Extension/LegacyContentHeader';
6
7
  export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
7
8
  export { ExtensionComponent } from './ExtensionComponent';
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "107.6.1";
4
+ const packageVersion = "107.7.1";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "107.6.1";
16
+ const packageVersion = "107.7.1";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -14,10 +14,12 @@ import React, { Fragment } from 'react';
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
15
  import { jsx } from '@emotion/react';
16
16
  import classnames from 'classnames';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '../../../hooks';
18
19
  import { useSharedPluginStateSelector } from '../../../hooks/useSharedPluginStateSelector/useSharedPluginStateSelector';
19
20
  import { overflowShadow } from '../../../ui';
20
21
  import { calculateBreakoutStyles } from '../../../utils';
22
+ import { LegacyContentHeader } from '../LegacyContentHeader';
21
23
  import ExtensionLozenge from '../Lozenge';
22
24
  import { overlay } from '../styles';
23
25
  import { isEmptyBodiedMacro } from './extension-utils';
@@ -49,6 +51,7 @@ function ExtensionWithPluginState(props) {
49
51
  var _extensionNode$attrs, _extensionNode$attrs2;
50
52
  return extensionNode.type.name === 'extension' && ((_extensionNode$attrs = extensionNode.attrs) === null || _extensionNode$attrs === void 0 ? void 0 : _extensionNode$attrs.extensionType) === 'com.atlassian.confluence.migration' && ((_extensionNode$attrs2 = extensionNode.attrs) === null || _extensionNode$attrs2 === void 0 ? void 0 : _extensionNode$attrs2.extensionKey) === 'legacy-content';
51
53
  };
54
+ var showLegacyContentHeader = fg('platform_editor_legacy_content_macro_visual_update') && isLegacyContentMacroExtension(node);
52
55
  var hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
53
56
  var hasChildren = !!children;
54
57
  var removeBorder = showMacroInteractionDesignUpdates || !!(hideFrame && !hasBody);
@@ -80,7 +83,8 @@ function ExtensionWithPluginState(props) {
80
83
  'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested && !showBodiedExtensionRendererView,
81
84
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
82
85
  'with-danger-overlay': showMacroInteractionDesignUpdates,
83
- 'without-frame': removeBorder
86
+ 'without-frame': removeBorder,
87
+ 'legacy-content': showLegacyContentHeader
84
88
  }, widerLayoutClassName, shouldBreakout));
85
89
  var overflowClassNames = classnames('extension-overflow-wrapper', {
86
90
  'with-body': hasBody,
@@ -121,7 +125,16 @@ function ExtensionWithPluginState(props) {
121
125
  setIsNodeHovered(didHover);
122
126
  }
123
127
  };
124
- return jsx(Fragment, null, showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
128
+ return jsx(Fragment, null, showLegacyContentHeader && jsx(LegacyContentHeader, {
129
+ isNodeSelected: isNodeSelected,
130
+ isNodeHovered: isNodeHovered,
131
+ onMouseEnter: function onMouseEnter() {
132
+ return handleMouseEvent(true);
133
+ },
134
+ onMouseLeave: function onMouseLeave() {
135
+ return handleMouseEvent(false);
136
+ }
137
+ }), !showLegacyContentHeader && showMacroInteractionDesignUpdates && !isLivePageViewMode && jsx(ExtensionLozenge, {
125
138
  isNodeSelected: isNodeSelected,
126
139
  isNodeHovered: isNodeHovered,
127
140
  isNodeNested: isNodeNested,
@@ -26,6 +26,10 @@ var wrapperStyleWithoutCursor = css(wrapperDefault, {
26
26
  '&.with-margin-styles': {
27
27
  margin: "0 ".concat("var(--ds-space-negative-250, -20px)"),
28
28
  padding: "0 ".concat("var(--ds-space-250, 20px)")
29
+ },
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
31
+ '&.legacy-content': {
32
+ borderRadius: "0 0 ".concat("var(--ds-border-radius, 3px)", " ", "var(--ds-border-radius, 3px)")
29
33
  }
30
34
  });
31
35
 
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+
6
+ import { Fragment, useCallback } from 'react';
7
+
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
+ import { css, jsx } from '@emotion/react';
10
+ import classnames from 'classnames';
11
+ import { defineMessages, useIntl } from 'react-intl-next';
12
+ import StatusWarningIcon from '@atlaskit/icon/core/status-warning';
13
+ import Link from '@atlaskit/link';
14
+ import { Status } from '@atlaskit/status';
15
+ var i18n = defineMessages({
16
+ legacyContentHeader: {
17
+ id: 'editor.extension.legacyContentHeader',
18
+ defaultMessage: 'Legacy Content',
19
+ description: 'Header for the legacy content extension in the editor.'
20
+ },
21
+ contentHasLimitedFunctionality: {
22
+ id: 'editor.extension.legacyContentHeader.contentHasLimitedFunctionality',
23
+ defaultMessage: 'This content has limited functionality, ',
24
+ description: 'Message indicating that the legacy content has limited functionality.'
25
+ },
26
+ learnMore: {
27
+ id: 'editor.extension.legacyContentHeader.learnMore',
28
+ defaultMessage: ' Learn more',
29
+ description: 'Link text for learning more about the legacy content.'
30
+ }
31
+ });
32
+ var lcmHeaderStyles = css({
33
+ padding: "0 ".concat("var(--ds-space-200, 16px)", " ", "var(--ds-space-050, 4px)", " ", "var(--ds-space-200, 16px)"),
34
+ backgroundColor: "var(--ds-background-neutral, #0515240F)",
35
+ borderRadius: "var(--ds-border-radius, 4px)".concat(" ", "var(--ds-border-radius, 4px)", " 0 0"),
36
+ boxShadow: "0 0 0 1px ".concat("var(--ds-background-neutral, #0515240F)"),
37
+ position: 'relative',
38
+ top: "-1px",
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
40
+ '&.with-hover-border': {
41
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-input, #8590A2)")
42
+ },
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
44
+ '&.selected': {
45
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, #0C66E4)"),
46
+ backgroundColor: "var(--ds-background-selected, #E9F2FF)"
47
+ },
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
49
+ '& .status-lozenge-span': {
50
+ marginRight: "var(--ds-space-100, 8px)"
51
+ },
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
53
+ '& > .legacy-content-header-text': {
54
+ font: "var(--ds-font-body-UNSAFE_small, 12px)",
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
56
+ '& span': {
57
+ paddingRight: "var(--ds-space-050, 4px)"
58
+ },
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
60
+ '& a': {
61
+ cursor: 'pointer'
62
+ }
63
+ }
64
+ });
65
+ export var LegacyContentHeader = function LegacyContentHeader(_ref) {
66
+ var isNodeHovered = _ref.isNodeHovered,
67
+ isNodeSelected = _ref.isNodeSelected,
68
+ onMouseEnter = _ref.onMouseEnter,
69
+ onMouseLeave = _ref.onMouseLeave;
70
+ var _useIntl = useIntl(),
71
+ formatMessage = _useIntl.formatMessage;
72
+ var classNames = classnames('legacy-content-header', {
73
+ 'with-hover-border': isNodeHovered,
74
+ selected: isNodeSelected
75
+ });
76
+ var learnMore = useCallback(function () {
77
+ window.open('https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/', '_blank');
78
+ }, []);
79
+ return jsx(Fragment, null, jsx("div", {
80
+ "data-testid": "editor-extension-legacy-content-header",
81
+ css: [lcmHeaderStyles]
82
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
83
+ ,
84
+ className: classNames,
85
+ onMouseEnter: onMouseEnter,
86
+ onMouseLeave: onMouseLeave
87
+ }, jsx(Status, {
88
+ text: formatMessage(i18n.legacyContentHeader),
89
+ color: isNodeSelected ? 'blue' : 'neutral',
90
+ style: "bold",
91
+ isBold: true
92
+ }), jsx("span", {
93
+ className: "legacy-content-header-text"
94
+ }, jsx(StatusWarningIcon, {
95
+ label: formatMessage(i18n.contentHasLimitedFunctionality),
96
+ size: "small"
97
+ }), formatMessage(i18n.contentHasLimitedFunctionality), "\xA0", jsx(Link, {
98
+ onClick: learnMore,
99
+ href: "https://support.atlassian.com/confluence-cloud/docs/the-legacy-content-macro/",
100
+ target: "_blank"
101
+ }, formatMessage(i18n.learnMore)))));
102
+ };
@@ -3,5 +3,6 @@
3
3
 
4
4
  export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
5
5
  export { Extension } from './Extension';
6
+ export { LegacyContentHeader } from './Extension/LegacyContentHeader';
6
7
  export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
7
8
  export { ExtensionComponent } from './ExtensionComponent';
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "107.6.1";
10
+ var packageVersion = "107.7.1";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "107.6.1";
23
+ var packageVersion = "107.7.1";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { jsx } from '@emotion/react';
6
+ export type LegacyContentHeaderProps = {
7
+ isNodeSelected?: boolean;
8
+ isNodeHovered?: boolean;
9
+ onMouseEnter?: () => void;
10
+ onMouseLeave?: () => void;
11
+ };
12
+ export declare const LegacyContentHeader: ({ isNodeHovered, isNodeSelected, onMouseEnter, onMouseLeave, }: LegacyContentHeaderProps) => jsx.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
2
2
  export { Extension } from './Extension';
3
+ export { LegacyContentHeader } from './Extension/LegacyContentHeader';
3
4
  export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
4
5
  export { ExtensionComponent } from './ExtensionComponent';
5
6
  export type { MacroInteractionDesignFeatureFlags, GetPMNodeHeight } from './types';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { jsx } from '@emotion/react';
6
+ export type LegacyContentHeaderProps = {
7
+ isNodeSelected?: boolean;
8
+ isNodeHovered?: boolean;
9
+ onMouseEnter?: () => void;
10
+ onMouseLeave?: () => void;
11
+ };
12
+ export declare const LegacyContentHeader: ({ isNodeHovered, isNodeSelected, onMouseEnter, onMouseLeave, }: LegacyContentHeaderProps) => jsx.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  export { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
2
2
  export { Extension } from './Extension';
3
+ export { LegacyContentHeader } from './Extension/LegacyContentHeader';
3
4
  export { default as ExtensionNodeView, ExtensionNode } from './extensionNodeView';
4
5
  export { ExtensionComponent } from './ExtensionComponent';
5
6
  export type { MacroInteractionDesignFeatureFlags, GetPMNodeHeight } from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.7.0",
3
+ "version": "107.7.2",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -140,7 +140,7 @@
140
140
  "@atlaskit/editor-shared-styles": "^3.4.0",
141
141
  "@atlaskit/editor-tables": "^2.9.0",
142
142
  "@atlaskit/emoji": "^69.3.0",
143
- "@atlaskit/icon": "^27.2.0",
143
+ "@atlaskit/icon": "^27.3.0",
144
144
  "@atlaskit/icon-object": "^7.1.0",
145
145
  "@atlaskit/link": "^3.2.0",
146
146
  "@atlaskit/link-datasource": "^4.12.0",
@@ -163,13 +163,14 @@
163
163
  "@atlaskit/profilecard": "^23.21.0",
164
164
  "@atlaskit/react-ufo": "^3.14.0",
165
165
  "@atlaskit/section-message": "^8.2.0",
166
- "@atlaskit/smart-card": "^39.0.0",
166
+ "@atlaskit/smart-card": "^39.1.0",
167
167
  "@atlaskit/smart-user-picker": "^8.0.0",
168
168
  "@atlaskit/spinner": "^18.0.0",
169
+ "@atlaskit/status": "^3.0.0",
169
170
  "@atlaskit/task-decision": "^19.2.0",
170
171
  "@atlaskit/textfield": "^8.0.0",
171
172
  "@atlaskit/theme": "^18.0.0",
172
- "@atlaskit/tmp-editor-statsig": "^8.8.0",
173
+ "@atlaskit/tmp-editor-statsig": "^9.0.0",
173
174
  "@atlaskit/tokens": "^5.4.0",
174
175
  "@atlaskit/tooltip": "^20.3.0",
175
176
  "@atlaskit/width-detector": "^5.0.0",
@@ -366,6 +367,9 @@
366
367
  },
367
368
  "platform_editor_fix_unsubscribe_of_provider": {
368
369
  "type": "boolean"
370
+ },
371
+ "platform_editor_legacy_content_macro_visual_update": {
372
+ "type": "boolean"
369
373
  }
370
374
  }
371
375
  }