@atlaskit/editor-common 78.9.4 → 78.10.0

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,16 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ ### Patch Changes
10
+
11
+ - [#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
12
+ - Updated dependencies
13
+
3
14
  ## 78.9.4
4
15
 
5
16
  ### 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;
@@ -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
  };
@@ -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.0";
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.0";
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
  }
@@ -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
+ };
@@ -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.0";
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.0";
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;
@@ -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
  };
@@ -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,
@@ -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.9.4";
9
+ var packageVersion = "78.10.0";
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.9.4";
20
+ var packageVersion = "78.10.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,14 +1,18 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  type Props = {
3
5
  children: React.ReactNode;
4
6
  nodeType: string;
7
+ showMacroInteractionDesignUpdates?: boolean;
5
8
  };
6
9
  /**
7
10
  * If inlineExtension, add zero width space to the end of the nodes and wrap with span;
11
+ * Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
8
12
  * else wrap with a div (for multi bodied extensions)
9
13
  *
10
14
  * @param param0
11
15
  * @returns
12
16
  */
13
- export declare const ExtensionNodeWrapper: ({ children, nodeType }: Props) => JSX.Element;
17
+ export declare const ExtensionNodeWrapper: ({ children, nodeType, showMacroInteractionDesignUpdates, }: Props) => jsx.JSX.Element;
14
18
  export {};
@@ -1,14 +1,18 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  type Props = {
3
5
  children: React.ReactNode;
4
6
  nodeType: string;
7
+ showMacroInteractionDesignUpdates?: boolean;
5
8
  };
6
9
  /**
7
10
  * If inlineExtension, add zero width space to the end of the nodes and wrap with span;
11
+ * Also if showMacroInteractionDesignUpdates is true, then add the inline-block style to account for the lozenge.
8
12
  * else wrap with a div (for multi bodied extensions)
9
13
  *
10
14
  * @param param0
11
15
  * @returns
12
16
  */
13
- export declare const ExtensionNodeWrapper: ({ children, nodeType }: Props) => JSX.Element;
17
+ export declare const ExtensionNodeWrapper: ({ children, nodeType, showMacroInteractionDesignUpdates, }: Props) => jsx.JSX.Element;
14
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "78.9.4",
3
+ "version": "78.10.0",
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/"
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "@atlaskit/activity-provider": "^2.4.0",
96
- "@atlaskit/adf-schema": "^35.5.1",
96
+ "@atlaskit/adf-schema": "^35.5.2",
97
97
  "@atlaskit/adf-utils": "^19.0.0",
98
98
  "@atlaskit/analytics-listeners": "^8.9.0",
99
99
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
@@ -102,7 +102,7 @@
102
102
  "@atlaskit/button": "^17.6.0",
103
103
  "@atlaskit/code": "^15.1.0",
104
104
  "@atlaskit/codemod-utils": "^4.2.0",
105
- "@atlaskit/custom-steps": "^0.0.13",
105
+ "@atlaskit/custom-steps": "^0.0.14",
106
106
  "@atlaskit/editor-json-transformer": "^8.10.0",
107
107
  "@atlaskit/editor-palette": "1.5.2",
108
108
  "@atlaskit/editor-prosemirror": "3.0.0",