@atlaskit/editor-common 78.9.4 → 78.10.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/extensibility/Extension/InlineExtension/index.js +6 -2
  3. package/dist/cjs/extensibility/ExtensionComponent.js +2 -1
  4. package/dist/cjs/extensibility/ExtensionNodeWrapper.js +19 -2
  5. package/dist/cjs/extensibility/MultiBodiedExtension/index.js +21 -7
  6. package/dist/cjs/extensibility/MultiBodiedExtension/styles.js +17 -4
  7. package/dist/cjs/extensibility/extensionNodeView.js +2 -1
  8. package/dist/cjs/monitoring/error.js +1 -1
  9. package/dist/cjs/ui/DropList/index.js +1 -1
  10. package/dist/es2019/extensibility/Extension/InlineExtension/index.js +7 -3
  11. package/dist/es2019/extensibility/ExtensionComponent.js +2 -1
  12. package/dist/es2019/extensibility/ExtensionNodeWrapper.js +20 -2
  13. package/dist/es2019/extensibility/MultiBodiedExtension/index.js +22 -8
  14. package/dist/es2019/extensibility/MultiBodiedExtension/styles.js +16 -14
  15. package/dist/es2019/extensibility/extensionNodeView.js +2 -1
  16. package/dist/es2019/monitoring/error.js +1 -1
  17. package/dist/es2019/ui/DropList/index.js +1 -1
  18. package/dist/esm/extensibility/Extension/InlineExtension/index.js +7 -3
  19. package/dist/esm/extensibility/ExtensionComponent.js +2 -1
  20. package/dist/esm/extensibility/ExtensionNodeWrapper.js +18 -2
  21. package/dist/esm/extensibility/MultiBodiedExtension/index.js +22 -8
  22. package/dist/esm/extensibility/MultiBodiedExtension/styles.js +17 -3
  23. package/dist/esm/extensibility/extensionNodeView.js +2 -1
  24. package/dist/esm/monitoring/error.js +1 -1
  25. package/dist/esm/ui/DropList/index.js +1 -1
  26. package/dist/types/extensibility/ExtensionNodeWrapper.d.ts +5 -1
  27. package/dist/types/extensibility/MultiBodiedExtension/index.d.ts +1 -0
  28. package/dist/types/preset/plugin-injection-api.d.ts +1 -1
  29. package/dist/types/types/feature-flags.d.ts +16 -0
  30. package/dist/types-ts4.5/extensibility/ExtensionNodeWrapper.d.ts +5 -1
  31. package/dist/types-ts4.5/extensibility/MultiBodiedExtension/index.d.ts +1 -0
  32. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +2 -2
  33. package/dist/types-ts4.5/types/feature-flags.d.ts +16 -0
  34. package/package.json +3 -3
  35. package/tsconfig.json +0 -1043
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#77796](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77796) [`eab996d08513`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eab996d08513) - Add new statsig experiement for preserve table width, add support for passing through width to create table. Allow tables to be inserted at full width
8
+
9
+ ## 78.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#77821](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77821) [`41dfb88ade75`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/41dfb88ade75) - [ux] Adds lozenge design update to inline macros if macroInteractionDesignUpdate flag is true
14
+
15
+ ### Patch Changes
16
+
17
+ - [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224) [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) - ED-22219: adf-schema updated to 35.5.2
18
+ - Updated dependencies
19
+
3
20
  ## 78.9.4
4
21
 
5
22
  ### Patch Changes
@@ -37,7 +37,11 @@ var InlineExtension = exports.default = /*#__PURE__*/function (_Component) {
37
37
  isNodeSelected = _this$props.isNodeSelected;
38
38
  var hasChildren = !!children;
39
39
  var className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
40
- return (0, _react2.jsx)("div", {
40
+ return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && (0, _react2.jsx)(_Lozenge.default, {
41
+ node: node,
42
+ isNodeSelected: isNodeSelected,
43
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
44
+ }), (0, _react2.jsx)("div", {
41
45
  css: _styles2.wrapperStyle,
42
46
  className: "extension-container inline ".concat(className)
43
47
  }, (0, _react2.jsx)("div", {
@@ -47,7 +51,7 @@ var InlineExtension = exports.default = /*#__PURE__*/function (_Component) {
47
51
  node: node,
48
52
  isNodeSelected: isNodeSelected,
49
53
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
50
- }));
54
+ })));
51
55
  }
52
56
  }]);
53
57
  return InlineExtension;
@@ -208,7 +208,8 @@ var ExtensionComponent = exports.ExtensionComponent = /*#__PURE__*/function (_Co
208
208
  eventDispatcher: eventDispatcher,
209
209
  pluginInjectionApi: pluginInjectionApi,
210
210
  editorAppearance: editorAppearance,
211
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
211
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
212
+ isNodeSelected: selectedNode === node
212
213
  });
213
214
  }
214
215
  var extensionHandlerResult = this.tryExtensionHandler(undefined);
@@ -6,9 +6,19 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.ExtensionNodeWrapper = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _react2 = require("@emotion/react");
10
+ var _classnames = _interopRequireDefault(require("classnames"));
9
11
  var _utils = require("../utils");
12
+ /** @jsx jsx */
13
+
14
+ var styles = (0, _react2.css)({
15
+ '&.inline-extension': {
16
+ display: 'inline-block'
17
+ }
18
+ });
10
19
  /**
11
20
  * If inlineExtension, add zero width space to the end of the nodes and wrap with span;
21
+ * Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
12
22
  * else wrap with a div (for multi bodied extensions)
13
23
  *
14
24
  * @param param0
@@ -16,6 +26,13 @@ var _utils = require("../utils");
16
26
  */
17
27
  var ExtensionNodeWrapper = exports.ExtensionNodeWrapper = function ExtensionNodeWrapper(_ref) {
18
28
  var children = _ref.children,
19
- nodeType = _ref.nodeType;
20
- return /*#__PURE__*/_react.default.createElement("span", null, children, nodeType === 'inlineExtension' && _utils.ZERO_WIDTH_SPACE);
29
+ nodeType = _ref.nodeType,
30
+ showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
31
+ var wrapperClassNames = (0, _classnames.default)({
32
+ 'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates
33
+ });
34
+ return (0, _react2.jsx)("span", {
35
+ className: wrapperClassNames,
36
+ css: styles
37
+ }, children, nodeType === 'inlineExtension' && _utils.ZERO_WIDTH_SPACE);
21
38
  };
@@ -19,6 +19,7 @@ var _hooks = require("../../hooks");
19
19
  var _MultiBodiedExtension = require("../../ui/MultiBodiedExtension");
20
20
  var _utils = require("../../utils");
21
21
  var _withPluginState = require("../../with-plugin-state");
22
+ var _Lozenge = _interopRequireDefault(require("../Extension/Lozenge"));
22
23
  var _actionApi = require("./action-api");
23
24
  var _styles = require("./styles");
24
25
  var _excluded = ["url"];
@@ -27,7 +28,10 @@ var _excluded = ["url"];
27
28
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
28
29
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
30
  // Similar to the one in platform/packages/editor/editor-common/src/extensibility/Extension/Lozenge.tsx
30
- var getWrapperTitleContent = function getWrapperTitleContent(imageData, title) {
31
+ var getWrapperTitleContent = function getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates) {
32
+ if (showMacroInteractionDesignUpdates) {
33
+ return null;
34
+ }
31
35
  if (imageData) {
32
36
  var url = imageData.url,
33
37
  rest = (0, _objectWithoutProperties2.default)(imageData, _excluded);
@@ -44,7 +48,8 @@ var getWrapperTitleContent = function getWrapperTitleContent(imageData, title) {
44
48
  })), title);
45
49
  }
46
50
  return (0, _react2.jsx)("div", {
47
- className: "extension-title"
51
+ className: "extension-title",
52
+ "data-testid": 'multiBodiedExtension-default-lozenge'
48
53
  }, (0, _react2.jsx)(_file.default, {
49
54
  label: title
50
55
  }), title);
@@ -57,7 +62,9 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
57
62
  editorView = _ref.editorView,
58
63
  eventDispatcher = _ref.eventDispatcher,
59
64
  widthState = _ref.widthState,
60
- editorAppearance = _ref.editorAppearance;
65
+ editorAppearance = _ref.editorAppearance,
66
+ showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates,
67
+ isNodeSelected = _ref.isNodeSelected;
61
68
  var _node$attrs = node.attrs,
62
69
  parameters = _node$attrs.parameters,
63
70
  extensionKey = _node$attrs.extensionKey;
@@ -108,13 +115,20 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
108
115
  breakoutStyles = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_calculateBreakoutSty), _calculateBreakoutSty));
109
116
  mbeWrapperStyles = breakoutStyles;
110
117
  }
111
- var wrapperClassNames = (0, _classnames.default)('multiBodiedExtension--wrapper', 'extension-container', 'block');
112
- return (0, _react2.jsx)("div", {
118
+ var wrapperClassNames = (0, _classnames.default)('multiBodiedExtension--wrapper', 'extension-container', 'block', {
119
+ 'remove-margin-top': showMacroInteractionDesignUpdates
120
+ });
121
+ return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && (0, _react2.jsx)(_Lozenge.default, {
122
+ isNodeSelected: isNodeSelected,
123
+ node: node,
124
+ showMacroInteractionDesignUpdates: true,
125
+ customContainerStyles: mbeWrapperStyles
126
+ }), (0, _react2.jsx)("div", {
113
127
  className: wrapperClassNames,
114
128
  css: _styles.mbeExtensionWrapperCSS,
115
129
  "data-testid": "multiBodiedExtension--wrapper",
116
130
  style: mbeWrapperStyles
117
- }, getWrapperTitleContent(imageData, title), (0, _react2.jsx)("div", {
131
+ }, getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates), (0, _react2.jsx)("div", {
118
132
  className: "multiBodiedExtension--container",
119
133
  css: containerCssExtended,
120
134
  "data-testid": "multiBodiedExtension--container",
@@ -127,7 +141,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
127
141
  className: "multiBodiedExtension--frames",
128
142
  "data-testid": "multiBodiedExtension--frames",
129
143
  ref: articleRef
130
- })));
144
+ }))));
131
145
  };
132
146
  var MultiBodiedExtensionWithSharedState = function MultiBodiedExtensionWithSharedState(props) {
133
147
  var pluginInjectionApi = props.pluginInjectionApi;
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.mbeExtensionWrapperCSS = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
7
  var _react = require("@emotion/react");
10
8
  var _styles = require("../Extension/styles");
11
- var _templateObject;
12
9
  // Wrapper the extension title and extensionContainer
13
- var mbeExtensionWrapperCSS = exports.mbeExtensionWrapperCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n cursor: pointer;\n margin-top: ", ";\n margin-bottom: ", ";\n .extension-title {\n display: flex;\n align-items: center;\n line-height: 16px !important;\n margin-bottom: ", ";\n margin-left: ", " !important;\n margin-right: ", ";\n padding-top: ", " !important;\n }\n"])), _styles.wrapperDefault, "var(--ds-space-250, 24px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
10
+ var mbeExtensionWrapperCSS = exports.mbeExtensionWrapperCSS = (0, _react.css)(_styles.wrapperDefault, {
11
+ '&.remove-margin-top': {
12
+ marginTop: 0
13
+ },
14
+ cursor: 'pointer',
15
+ marginTop: "var(--ds-space-250, 24px)",
16
+ marginBottom: "var(--ds-space-200, 16px)",
17
+ '.extension-title': {
18
+ display: 'flex',
19
+ alignItems: 'center',
20
+ lineHeight: '16px !important',
21
+ marginBottom: "var(--ds-space-100, 8px)",
22
+ marginLeft: "var(--ds-space-050, 4px)".concat(" !important"),
23
+ marginRight: "var(--ds-space-100, 8px)",
24
+ paddingTop: "var(--ds-space-100, 8px)".concat(" !important")
25
+ }
26
+ });
@@ -55,7 +55,8 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
55
55
  value: function render(props, forwardRef) {
56
56
  var _props$extensionNodeV;
57
57
  return /*#__PURE__*/_react.default.createElement(_ExtensionNodeWrapper.ExtensionNodeWrapper, {
58
- nodeType: this.node.type.name
58
+ nodeType: this.node.type.name,
59
+ showMacroInteractionDesignUpdates: props.showMacroInteractionDesignUpdates
59
60
  }, /*#__PURE__*/_react.default.createElement(_Extension.Extension, {
60
61
  editorView: this.view,
61
62
  node: this.node,
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 = "78.9.4";
19
+ var packageVersion = "78.10.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
22
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
23
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "78.9.4";
25
+ var packageVersion = "78.10.1";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import React, { Component } from 'react';
2
+ import React, { Component, Fragment } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import ExtensionLozenge from '../Lozenge';
5
5
  import { overlay } from '../styles';
@@ -14,7 +14,11 @@ export default class InlineExtension extends Component {
14
14
  } = this.props;
15
15
  const hasChildren = !!children;
16
16
  const className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
17
- return jsx("div", {
17
+ return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
18
+ node: node,
19
+ isNodeSelected: isNodeSelected,
20
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
21
+ }), jsx("div", {
18
22
  css: wrapperStyle,
19
23
  className: `extension-container inline ${className}`
20
24
  }, jsx("div", {
@@ -24,6 +28,6 @@ export default class InlineExtension extends Component {
24
28
  node: node,
25
29
  isNodeSelected: isNodeSelected,
26
30
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
27
- }));
31
+ })));
28
32
  }
29
33
  }
@@ -163,7 +163,8 @@ export class ExtensionComponent extends Component {
163
163
  eventDispatcher: eventDispatcher,
164
164
  pluginInjectionApi: pluginInjectionApi,
165
165
  editorAppearance: editorAppearance,
166
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
166
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
167
+ isNodeSelected: selectedNode === node
167
168
  });
168
169
  }
169
170
  const extensionHandlerResult = this.tryExtensionHandler(undefined);
@@ -1,7 +1,16 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { css, jsx } from '@emotion/react';
4
+ import classnames from 'classnames';
2
5
  import { ZERO_WIDTH_SPACE } from '../utils';
6
+ const styles = css({
7
+ '&.inline-extension': {
8
+ display: 'inline-block'
9
+ }
10
+ });
3
11
  /**
4
12
  * If inlineExtension, add zero width space to the end of the nodes and wrap with span;
13
+ * Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
5
14
  * else wrap with a div (for multi bodied extensions)
6
15
  *
7
16
  * @param param0
@@ -9,5 +18,14 @@ import { ZERO_WIDTH_SPACE } from '../utils';
9
18
  */
10
19
  export const ExtensionNodeWrapper = ({
11
20
  children,
12
- nodeType
13
- }) => /*#__PURE__*/React.createElement("span", null, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
21
+ nodeType,
22
+ showMacroInteractionDesignUpdates
23
+ }) => {
24
+ const wrapperClassNames = classnames({
25
+ 'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates
26
+ });
27
+ return jsx("span", {
28
+ className: wrapperClassNames,
29
+ css: styles
30
+ }, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
31
+ };
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
3
3
  /** @jsx jsx */
4
4
 
5
- import React, { useState } from 'react';
5
+ import React, { Fragment, useState } from 'react';
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import classnames from 'classnames';
8
8
  import EditorFileIcon from '@atlaskit/icon/glyph/editor/file';
@@ -10,10 +10,14 @@ import { useSharedPluginState } from '../../hooks';
10
10
  import { sharedMultiBodiedExtensionStyles } from '../../ui/MultiBodiedExtension';
11
11
  import { calculateBreakoutStyles, getExtensionLozengeData } from '../../utils';
12
12
  import { WithPluginState } from '../../with-plugin-state';
13
+ import ExtensionLozenge from '../Extension/Lozenge';
13
14
  import { useMultiBodiedExtensionActions } from './action-api';
14
15
  import { mbeExtensionWrapperCSS } from './styles';
15
16
  // Similar to the one in platform/packages/editor/editor-common/src/extensibility/Extension/Lozenge.tsx
16
- const getWrapperTitleContent = (imageData, title) => {
17
+ const getWrapperTitleContent = (imageData, title, showMacroInteractionDesignUpdates) => {
18
+ if (showMacroInteractionDesignUpdates) {
19
+ return null;
20
+ }
17
21
  if (imageData) {
18
22
  const {
19
23
  url,
@@ -32,7 +36,8 @@ const getWrapperTitleContent = (imageData, title) => {
32
36
  })), title);
33
37
  }
34
38
  return jsx("div", {
35
- className: "extension-title"
39
+ className: "extension-title",
40
+ "data-testid": 'multiBodiedExtension-default-lozenge'
36
41
  }, jsx(EditorFileIcon, {
37
42
  label: title
38
43
  }), title);
@@ -45,7 +50,9 @@ const MultiBodiedExtensionWithWidth = ({
45
50
  editorView,
46
51
  eventDispatcher,
47
52
  widthState,
48
- editorAppearance
53
+ editorAppearance,
54
+ showMacroInteractionDesignUpdates,
55
+ isNodeSelected
49
56
  }) => {
50
57
  const {
51
58
  parameters,
@@ -98,13 +105,20 @@ const MultiBodiedExtensionWithWidth = ({
98
105
  });
99
106
  mbeWrapperStyles = breakoutStyles;
100
107
  }
101
- const wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block');
102
- return jsx("div", {
108
+ const wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block', {
109
+ 'remove-margin-top': showMacroInteractionDesignUpdates
110
+ });
111
+ return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
112
+ isNodeSelected: isNodeSelected,
113
+ node: node,
114
+ showMacroInteractionDesignUpdates: true,
115
+ customContainerStyles: mbeWrapperStyles
116
+ }), jsx("div", {
103
117
  className: wrapperClassNames,
104
118
  css: mbeExtensionWrapperCSS,
105
119
  "data-testid": "multiBodiedExtension--wrapper",
106
120
  style: mbeWrapperStyles
107
- }, getWrapperTitleContent(imageData, title), jsx("div", {
121
+ }, getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates), jsx("div", {
108
122
  className: "multiBodiedExtension--container",
109
123
  css: containerCssExtended,
110
124
  "data-testid": "multiBodiedExtension--container",
@@ -117,7 +131,7 @@ const MultiBodiedExtensionWithWidth = ({
117
131
  className: "multiBodiedExtension--frames",
118
132
  "data-testid": "multiBodiedExtension--frames",
119
133
  ref: articleRef
120
- })));
134
+ }))));
121
135
  };
122
136
  const MultiBodiedExtensionWithSharedState = props => {
123
137
  const {
@@ -2,18 +2,20 @@ import { css } from '@emotion/react';
2
2
  import { wrapperDefault } from '../Extension/styles';
3
3
 
4
4
  // Wrapper the extension title and extensionContainer
5
- export const mbeExtensionWrapperCSS = css`
6
- ${wrapperDefault};
7
- cursor: pointer;
8
- margin-top: ${"var(--ds-space-250, 24px)"};
9
- margin-bottom: ${"var(--ds-space-200, 16px)"};
10
- .extension-title {
11
- display: flex;
12
- align-items: center;
13
- line-height: 16px !important;
14
- margin-bottom: ${"var(--ds-space-100, 8px)"};
15
- margin-left: ${"var(--ds-space-050, 4px)"} !important;
16
- margin-right: ${"var(--ds-space-100, 8px)"};
17
- padding-top: ${"var(--ds-space-100, 8px)"} !important;
5
+ export const mbeExtensionWrapperCSS = css(wrapperDefault, {
6
+ '&.remove-margin-top': {
7
+ marginTop: 0
8
+ },
9
+ cursor: 'pointer',
10
+ marginTop: "var(--ds-space-250, 24px)",
11
+ marginBottom: "var(--ds-space-200, 16px)",
12
+ '.extension-title': {
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ lineHeight: '16px !important',
16
+ marginBottom: "var(--ds-space-100, 8px)",
17
+ marginLeft: `${"var(--ds-space-050, 4px)"} !important`,
18
+ marginRight: "var(--ds-space-100, 8px)",
19
+ paddingTop: `${"var(--ds-space-100, 8px)"} !important`
18
20
  }
19
- `;
21
+ });
@@ -28,7 +28,8 @@ export class ExtensionNode extends ReactNodeView {
28
28
  render(props, forwardRef) {
29
29
  var _props$extensionNodeV;
30
30
  return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
31
- nodeType: this.node.type.name
31
+ nodeType: this.node.type.name,
32
+ showMacroInteractionDesignUpdates: props.showMacroInteractionDesignUpdates
32
33
  }, /*#__PURE__*/React.createElement(Extension, {
33
34
  editorView: this.view,
34
35
  node: this.node,
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "78.9.4";
3
+ const packageVersion = "78.10.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "78.9.4";
10
+ const packageVersion = "78.10.1";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -6,7 +6,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
7
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8
8
  /** @jsx jsx */
9
- import React, { Component } from 'react';
9
+ import React, { Component, Fragment } from 'react';
10
10
  import { jsx } from '@emotion/react';
11
11
  import ExtensionLozenge from '../Lozenge';
12
12
  import { overlay } from '../styles';
@@ -28,7 +28,11 @@ var InlineExtension = /*#__PURE__*/function (_Component) {
28
28
  isNodeSelected = _this$props.isNodeSelected;
29
29
  var hasChildren = !!children;
30
30
  var className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
31
- return jsx("div", {
31
+ return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
32
+ node: node,
33
+ isNodeSelected: isNodeSelected,
34
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
35
+ }), jsx("div", {
32
36
  css: wrapperStyle,
33
37
  className: "extension-container inline ".concat(className)
34
38
  }, jsx("div", {
@@ -38,7 +42,7 @@ var InlineExtension = /*#__PURE__*/function (_Component) {
38
42
  node: node,
39
43
  isNodeSelected: isNodeSelected,
40
44
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
41
- }));
45
+ })));
42
46
  }
43
47
  }]);
44
48
  return InlineExtension;
@@ -198,7 +198,8 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
198
198
  eventDispatcher: eventDispatcher,
199
199
  pluginInjectionApi: pluginInjectionApi,
200
200
  editorAppearance: editorAppearance,
201
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
201
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
202
+ isNodeSelected: selectedNode === node
202
203
  });
203
204
  }
204
205
  var extensionHandlerResult = this.tryExtensionHandler(undefined);
@@ -1,7 +1,16 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { css, jsx } from '@emotion/react';
4
+ import classnames from 'classnames';
2
5
  import { ZERO_WIDTH_SPACE } from '../utils';
6
+ var styles = css({
7
+ '&.inline-extension': {
8
+ display: 'inline-block'
9
+ }
10
+ });
3
11
  /**
4
12
  * If inlineExtension, add zero width space to the end of the nodes and wrap with span;
13
+ * Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
5
14
  * else wrap with a div (for multi bodied extensions)
6
15
  *
7
16
  * @param param0
@@ -9,6 +18,13 @@ import { ZERO_WIDTH_SPACE } from '../utils';
9
18
  */
10
19
  export var ExtensionNodeWrapper = function ExtensionNodeWrapper(_ref) {
11
20
  var children = _ref.children,
12
- nodeType = _ref.nodeType;
13
- return /*#__PURE__*/React.createElement("span", null, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
21
+ nodeType = _ref.nodeType,
22
+ showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
23
+ var wrapperClassNames = classnames({
24
+ 'inline-extension': nodeType === 'inlineExtension' && showMacroInteractionDesignUpdates
25
+ });
26
+ return jsx("span", {
27
+ className: wrapperClassNames,
28
+ css: styles
29
+ }, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
14
30
  };
@@ -7,7 +7,7 @@ var _excluded = ["url"];
7
7
  /* eslint-disable @atlaskit/design-system/prefer-primitives */
8
8
  /** @jsx jsx */
9
9
 
10
- import React, { useState } from 'react';
10
+ import React, { Fragment, useState } from 'react';
11
11
  import { css, jsx } from '@emotion/react';
12
12
  import classnames from 'classnames';
13
13
  import EditorFileIcon from '@atlaskit/icon/glyph/editor/file';
@@ -15,10 +15,14 @@ import { useSharedPluginState } from '../../hooks';
15
15
  import { sharedMultiBodiedExtensionStyles } from '../../ui/MultiBodiedExtension';
16
16
  import { calculateBreakoutStyles, getExtensionLozengeData } from '../../utils';
17
17
  import { WithPluginState } from '../../with-plugin-state';
18
+ import ExtensionLozenge from '../Extension/Lozenge';
18
19
  import { useMultiBodiedExtensionActions } from './action-api';
19
20
  import { mbeExtensionWrapperCSS } from './styles';
20
21
  // Similar to the one in platform/packages/editor/editor-common/src/extensibility/Extension/Lozenge.tsx
21
- var getWrapperTitleContent = function getWrapperTitleContent(imageData, title) {
22
+ var getWrapperTitleContent = function getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates) {
23
+ if (showMacroInteractionDesignUpdates) {
24
+ return null;
25
+ }
22
26
  if (imageData) {
23
27
  var url = imageData.url,
24
28
  rest = _objectWithoutProperties(imageData, _excluded);
@@ -35,7 +39,8 @@ var getWrapperTitleContent = function getWrapperTitleContent(imageData, title) {
35
39
  })), title);
36
40
  }
37
41
  return jsx("div", {
38
- className: "extension-title"
42
+ className: "extension-title",
43
+ "data-testid": 'multiBodiedExtension-default-lozenge'
39
44
  }, jsx(EditorFileIcon, {
40
45
  label: title
41
46
  }), title);
@@ -48,7 +53,9 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
48
53
  editorView = _ref.editorView,
49
54
  eventDispatcher = _ref.eventDispatcher,
50
55
  widthState = _ref.widthState,
51
- editorAppearance = _ref.editorAppearance;
56
+ editorAppearance = _ref.editorAppearance,
57
+ showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates,
58
+ isNodeSelected = _ref.isNodeSelected;
52
59
  var _node$attrs = node.attrs,
53
60
  parameters = _node$attrs.parameters,
54
61
  extensionKey = _node$attrs.extensionKey;
@@ -99,13 +106,20 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
99
106
  breakoutStyles = _extends({}, (_objectDestructuringEmpty(_calculateBreakoutSty), _calculateBreakoutSty));
100
107
  mbeWrapperStyles = breakoutStyles;
101
108
  }
102
- var wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block');
103
- return jsx("div", {
109
+ var wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block', {
110
+ 'remove-margin-top': showMacroInteractionDesignUpdates
111
+ });
112
+ return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
113
+ isNodeSelected: isNodeSelected,
114
+ node: node,
115
+ showMacroInteractionDesignUpdates: true,
116
+ customContainerStyles: mbeWrapperStyles
117
+ }), jsx("div", {
104
118
  className: wrapperClassNames,
105
119
  css: mbeExtensionWrapperCSS,
106
120
  "data-testid": "multiBodiedExtension--wrapper",
107
121
  style: mbeWrapperStyles
108
- }, getWrapperTitleContent(imageData, title), jsx("div", {
122
+ }, getWrapperTitleContent(imageData, title, showMacroInteractionDesignUpdates), jsx("div", {
109
123
  className: "multiBodiedExtension--container",
110
124
  css: containerCssExtended,
111
125
  "data-testid": "multiBodiedExtension--container",
@@ -118,7 +132,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
118
132
  className: "multiBodiedExtension--frames",
119
133
  "data-testid": "multiBodiedExtension--frames",
120
134
  ref: articleRef
121
- })));
135
+ }))));
122
136
  };
123
137
  var MultiBodiedExtensionWithSharedState = function MultiBodiedExtensionWithSharedState(props) {
124
138
  var pluginInjectionApi = props.pluginInjectionApi;
@@ -1,7 +1,21 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
3
1
  import { css } from '@emotion/react';
4
2
  import { wrapperDefault } from '../Extension/styles';
5
3
 
6
4
  // Wrapper the extension title and extensionContainer
7
- export var mbeExtensionWrapperCSS = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n cursor: pointer;\n margin-top: ", ";\n margin-bottom: ", ";\n .extension-title {\n display: flex;\n align-items: center;\n line-height: 16px !important;\n margin-bottom: ", ";\n margin-left: ", " !important;\n margin-right: ", ";\n padding-top: ", " !important;\n }\n"])), wrapperDefault, "var(--ds-space-250, 24px)", "var(--ds-space-200, 16px)", "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)");
5
+ export var mbeExtensionWrapperCSS = css(wrapperDefault, {
6
+ '&.remove-margin-top': {
7
+ marginTop: 0
8
+ },
9
+ cursor: 'pointer',
10
+ marginTop: "var(--ds-space-250, 24px)",
11
+ marginBottom: "var(--ds-space-200, 16px)",
12
+ '.extension-title': {
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ lineHeight: '16px !important',
16
+ marginBottom: "var(--ds-space-100, 8px)",
17
+ marginLeft: "var(--ds-space-050, 4px)".concat(" !important"),
18
+ marginRight: "var(--ds-space-100, 8px)",
19
+ paddingTop: "var(--ds-space-100, 8px)".concat(" !important")
20
+ }
21
+ });
@@ -47,7 +47,8 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
47
47
  value: function render(props, forwardRef) {
48
48
  var _props$extensionNodeV;
49
49
  return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
50
- nodeType: this.node.type.name
50
+ nodeType: this.node.type.name,
51
+ showMacroInteractionDesignUpdates: props.showMacroInteractionDesignUpdates
51
52
  }, /*#__PURE__*/React.createElement(Extension, {
52
53
  editorView: this.view,
53
54
  node: this.node,