@atlaskit/editor-common 78.23.2 → 78.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.23.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#87738](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87738) [`40f32c84fb24`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40f32c84fb24) - [ux] Fix nesting styles of block macros
8
+
3
9
  ## 78.23.2
4
10
 
5
11
  ### Patch Changes
@@ -40,6 +40,7 @@ function ExtensionWithPluginState(props) {
40
40
  showMacroInteractionDesignUpdates = props.showMacroInteractionDesignUpdates,
41
41
  isNodeSelected = props.isNodeSelected,
42
42
  isNodeHovered = props.isNodeHovered,
43
+ isNodeNested = props.isNodeNested,
43
44
  setIsNodeHovered = props.setIsNodeHovered;
44
45
  var hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
45
46
  var isMobile = editorAppearance === 'mobile';
@@ -62,14 +63,14 @@ function ExtensionWithPluginState(props) {
62
63
  var classNames = (0, _classnames2.default)('extension-container', 'block', shadowClassNames, (0, _defineProperty2.default)({
63
64
  'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
64
65
  'with-border': showMacroInteractionDesignUpdates,
65
- 'with-margin-styles': showMacroInteractionDesignUpdates,
66
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
66
67
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
67
68
  'with-danger-overlay': showMacroInteractionDesignUpdates,
68
69
  'without-frame': removeBorder
69
70
  }, _styles2.widerLayoutClassName, shouldBreakout));
70
71
  var overflowClassNames = (0, _classnames2.default)('extension-overflow-wrapper', {
71
72
  'with-body': hasBody,
72
- 'with-margin-styles': showMacroInteractionDesignUpdates
73
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested
73
74
  });
74
75
  var headerClassNames = (0, _classnames2.default)({
75
76
  'with-children': hasChildren,
@@ -203,6 +203,9 @@ var ExtensionComponent = exports.ExtensionComponent = /*#__PURE__*/function (_Co
203
203
  showMacroInteractionDesignUpdates = _this$props2.showMacroInteractionDesignUpdates;
204
204
  var selection = editorView.state.selection;
205
205
  var selectedNode = selection instanceof _state.NodeSelection && selection.node;
206
+ var position = typeof getPos === 'function' && getPos();
207
+ var resolvedPosition = position && editorView.state.doc.resolve(position);
208
+ var isNodeNested = !!(resolvedPosition && resolvedPosition.depth > 0);
206
209
  if (node.type.name === 'multiBodiedExtension') {
207
210
  return /*#__PURE__*/_react.default.createElement(_MultiBodiedExtension.default, {
208
211
  node: node,
@@ -215,6 +218,7 @@ var ExtensionComponent = exports.ExtensionComponent = /*#__PURE__*/function (_Co
215
218
  editorAppearance: editorAppearance,
216
219
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
217
220
  isNodeSelected: selectedNode === node,
221
+ isNodeNested: isNodeNested,
218
222
  isNodeHovered: this.state.isNodeHovered,
219
223
  setIsNodeHovered: this.setIsNodeHovered
220
224
  });
@@ -236,6 +240,7 @@ var ExtensionComponent = exports.ExtensionComponent = /*#__PURE__*/function (_Co
236
240
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
237
241
  isNodeSelected: selectedNode === node,
238
242
  isNodeHovered: this.state.isNodeHovered,
243
+ isNodeNested: isNodeNested,
239
244
  setIsNodeHovered: this.setIsNodeHovered
240
245
  }, extensionHandlerResult);
241
246
  case 'inlineExtension':
@@ -70,6 +70,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
70
70
  showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates,
71
71
  isNodeSelected = _ref.isNodeSelected,
72
72
  isNodeHovered = _ref.isNodeHovered,
73
+ isNodeNested = _ref.isNodeNested,
73
74
  setIsNodeHovered = _ref.setIsNodeHovered;
74
75
  var _node$attrs = node.attrs,
75
76
  parameters = _node$attrs.parameters,
@@ -121,7 +122,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
121
122
  mbeWrapperStyles = breakoutStyles;
122
123
  }
123
124
  var wrapperClassNames = (0, _classnames.default)('multiBodiedExtension--wrapper', 'extension-container', 'block', {
124
- 'with-margin-styles': showMacroInteractionDesignUpdates,
125
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
125
126
  'with-border': showMacroInteractionDesignUpdates,
126
127
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
127
128
  'with-danger-overlay': showMacroInteractionDesignUpdates
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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.23.2";
19
+ var packageVersion = "78.23.3";
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() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "78.23.2";
25
+ var packageVersion = "78.23.3";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -26,6 +26,7 @@ function ExtensionWithPluginState(props) {
26
26
  showMacroInteractionDesignUpdates,
27
27
  isNodeSelected,
28
28
  isNodeHovered,
29
+ isNodeNested,
29
30
  setIsNodeHovered
30
31
  } = props;
31
32
  const hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
@@ -51,7 +52,7 @@ function ExtensionWithPluginState(props) {
51
52
  const classNames = classnames('extension-container', 'block', shadowClassNames, {
52
53
  'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
53
54
  'with-border': showMacroInteractionDesignUpdates,
54
- 'with-margin-styles': showMacroInteractionDesignUpdates,
55
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
55
56
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
56
57
  'with-danger-overlay': showMacroInteractionDesignUpdates,
57
58
  'without-frame': removeBorder,
@@ -59,7 +60,7 @@ function ExtensionWithPluginState(props) {
59
60
  });
60
61
  const overflowClassNames = classnames('extension-overflow-wrapper', {
61
62
  'with-body': hasBody,
62
- 'with-margin-styles': showMacroInteractionDesignUpdates
63
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested
63
64
  });
64
65
  const headerClassNames = classnames({
65
66
  'with-children': hasChildren,
@@ -158,6 +158,9 @@ export class ExtensionComponent extends Component {
158
158
  selection
159
159
  } = editorView.state;
160
160
  const selectedNode = selection instanceof NodeSelection && selection.node;
161
+ const position = typeof getPos === 'function' && getPos();
162
+ const resolvedPosition = position && editorView.state.doc.resolve(position);
163
+ const isNodeNested = !!(resolvedPosition && resolvedPosition.depth > 0);
161
164
  if (node.type.name === 'multiBodiedExtension') {
162
165
  return /*#__PURE__*/React.createElement(MultiBodiedExtension, {
163
166
  node: node,
@@ -170,6 +173,7 @@ export class ExtensionComponent extends Component {
170
173
  editorAppearance: editorAppearance,
171
174
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
172
175
  isNodeSelected: selectedNode === node,
176
+ isNodeNested: isNodeNested,
173
177
  isNodeHovered: this.state.isNodeHovered,
174
178
  setIsNodeHovered: this.setIsNodeHovered
175
179
  });
@@ -191,6 +195,7 @@ export class ExtensionComponent extends Component {
191
195
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
192
196
  isNodeSelected: selectedNode === node,
193
197
  isNodeHovered: this.state.isNodeHovered,
198
+ isNodeNested: isNodeNested,
194
199
  setIsNodeHovered: this.setIsNodeHovered
195
200
  }, extensionHandlerResult);
196
201
  case 'inlineExtension':
@@ -58,6 +58,7 @@ const MultiBodiedExtensionWithWidth = ({
58
58
  showMacroInteractionDesignUpdates,
59
59
  isNodeSelected,
60
60
  isNodeHovered,
61
+ isNodeNested,
61
62
  setIsNodeHovered
62
63
  }) => {
63
64
  const {
@@ -109,7 +110,7 @@ const MultiBodiedExtensionWithWidth = ({
109
110
  mbeWrapperStyles = breakoutStyles;
110
111
  }
111
112
  const wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block', {
112
- 'with-margin-styles': showMacroInteractionDesignUpdates,
113
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
113
114
  'with-border': showMacroInteractionDesignUpdates,
114
115
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
115
116
  'with-danger-overlay': showMacroInteractionDesignUpdates
@@ -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.23.2";
3
+ const packageVersion = "78.23.3";
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.23.2";
10
+ const packageVersion = "78.23.3";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -31,6 +31,7 @@ function ExtensionWithPluginState(props) {
31
31
  showMacroInteractionDesignUpdates = props.showMacroInteractionDesignUpdates,
32
32
  isNodeSelected = props.isNodeSelected,
33
33
  isNodeHovered = props.isNodeHovered,
34
+ isNodeNested = props.isNodeNested,
34
35
  setIsNodeHovered = props.setIsNodeHovered;
35
36
  var hasBody = ['bodiedExtension', 'multiBodiedExtension'].includes(node.type.name);
36
37
  var isMobile = editorAppearance === 'mobile';
@@ -53,14 +54,14 @@ function ExtensionWithPluginState(props) {
53
54
  var classNames = classnames('extension-container', 'block', shadowClassNames, _defineProperty({
54
55
  'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
55
56
  'with-border': showMacroInteractionDesignUpdates,
56
- 'with-margin-styles': showMacroInteractionDesignUpdates,
57
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
57
58
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
58
59
  'with-danger-overlay': showMacroInteractionDesignUpdates,
59
60
  'without-frame': removeBorder
60
61
  }, widerLayoutClassName, shouldBreakout));
61
62
  var overflowClassNames = classnames('extension-overflow-wrapper', {
62
63
  'with-body': hasBody,
63
- 'with-margin-styles': showMacroInteractionDesignUpdates
64
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested
64
65
  });
65
66
  var headerClassNames = classnames({
66
67
  'with-children': hasChildren,
@@ -193,6 +193,9 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
193
193
  showMacroInteractionDesignUpdates = _this$props2.showMacroInteractionDesignUpdates;
194
194
  var selection = editorView.state.selection;
195
195
  var selectedNode = selection instanceof NodeSelection && selection.node;
196
+ var position = typeof getPos === 'function' && getPos();
197
+ var resolvedPosition = position && editorView.state.doc.resolve(position);
198
+ var isNodeNested = !!(resolvedPosition && resolvedPosition.depth > 0);
196
199
  if (node.type.name === 'multiBodiedExtension') {
197
200
  return /*#__PURE__*/React.createElement(MultiBodiedExtension, {
198
201
  node: node,
@@ -205,6 +208,7 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
205
208
  editorAppearance: editorAppearance,
206
209
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
207
210
  isNodeSelected: selectedNode === node,
211
+ isNodeNested: isNodeNested,
208
212
  isNodeHovered: this.state.isNodeHovered,
209
213
  setIsNodeHovered: this.setIsNodeHovered
210
214
  });
@@ -226,6 +230,7 @@ export var ExtensionComponent = /*#__PURE__*/function (_Component) {
226
230
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
227
231
  isNodeSelected: selectedNode === node,
228
232
  isNodeHovered: this.state.isNodeHovered,
233
+ isNodeNested: isNodeNested,
229
234
  setIsNodeHovered: this.setIsNodeHovered
230
235
  }, extensionHandlerResult);
231
236
  case 'inlineExtension':
@@ -61,6 +61,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
61
61
  showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates,
62
62
  isNodeSelected = _ref.isNodeSelected,
63
63
  isNodeHovered = _ref.isNodeHovered,
64
+ isNodeNested = _ref.isNodeNested,
64
65
  setIsNodeHovered = _ref.setIsNodeHovered;
65
66
  var _node$attrs = node.attrs,
66
67
  parameters = _node$attrs.parameters,
@@ -112,7 +113,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
112
113
  mbeWrapperStyles = breakoutStyles;
113
114
  }
114
115
  var wrapperClassNames = classnames('multiBodiedExtension--wrapper', 'extension-container', 'block', {
115
- 'with-margin-styles': showMacroInteractionDesignUpdates,
116
+ 'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
116
117
  'with-border': showMacroInteractionDesignUpdates,
117
118
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
118
119
  'with-danger-overlay': showMacroInteractionDesignUpdates
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  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; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "78.23.2";
9
+ var packageVersion = "78.23.3";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
17
17
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
18
18
  import Layer from '../Layer';
19
19
  var packageName = "@atlaskit/editor-common";
20
- var packageVersion = "78.23.2";
20
+ var packageVersion = "78.23.3";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -19,6 +19,7 @@ export interface Props {
19
19
  showMacroInteractionDesignUpdates?: boolean;
20
20
  isNodeSelected?: boolean;
21
21
  isNodeHovered?: boolean;
22
+ isNodeNested?: boolean;
22
23
  setIsNodeHovered?: (isHovered: boolean) => void;
23
24
  }
24
25
  /**
@@ -21,6 +21,7 @@ type Props = {
21
21
  showMacroInteractionDesignUpdates?: boolean;
22
22
  isNodeSelected?: boolean;
23
23
  isNodeHovered?: boolean;
24
+ isNodeNested?: boolean;
24
25
  setIsNodeHovered?: (isHovered: boolean) => void;
25
26
  };
26
27
  declare const MultiBodiedExtension: (props: Props & OverflowShadowProps) => jsx.JSX.Element;
@@ -19,6 +19,7 @@ export interface Props {
19
19
  showMacroInteractionDesignUpdates?: boolean;
20
20
  isNodeSelected?: boolean;
21
21
  isNodeHovered?: boolean;
22
+ isNodeNested?: boolean;
22
23
  setIsNodeHovered?: (isHovered: boolean) => void;
23
24
  }
24
25
  /**
@@ -21,6 +21,7 @@ type Props = {
21
21
  showMacroInteractionDesignUpdates?: boolean;
22
22
  isNodeSelected?: boolean;
23
23
  isNodeHovered?: boolean;
24
+ isNodeNested?: boolean;
24
25
  setIsNodeHovered?: (isHovered: boolean) => void;
25
26
  };
26
27
  declare const MultiBodiedExtension: (props: Props & OverflowShadowProps) => jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "78.23.2",
3
+ "version": "78.23.3",
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/"