@atlaskit/editor-common 82.2.2 → 82.3.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/extensibility/Extension/Extension/index.js +0 -1
  3. package/dist/cjs/extensibility/Extension/Extension/styles.js +4 -9
  4. package/dist/cjs/extensibility/Extension/InlineExtension/index.js +0 -1
  5. package/dist/cjs/extensibility/Extension/InlineExtension/styles.js +1 -4
  6. package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +2 -5
  7. package/dist/cjs/extensibility/MultiBodiedExtension/styles.js +2 -2
  8. package/dist/cjs/monitoring/error.js +1 -1
  9. package/dist/cjs/ui/DropList/index.js +1 -1
  10. package/dist/cjs/ui-color/ColorPalette/Color/index.js +57 -7
  11. package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +38 -2
  12. package/dist/cjs/ui-color/ColorPalette/index.js +4 -2
  13. package/dist/cjs/utils/annotation/index.js +24 -0
  14. package/dist/cjs/utils/index.js +6 -0
  15. package/dist/es2019/extensibility/Extension/Extension/index.js +0 -1
  16. package/dist/es2019/extensibility/Extension/Extension/styles.js +4 -9
  17. package/dist/es2019/extensibility/Extension/InlineExtension/index.js +0 -1
  18. package/dist/es2019/extensibility/Extension/InlineExtension/styles.js +1 -4
  19. package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +2 -5
  20. package/dist/es2019/extensibility/MultiBodiedExtension/styles.js +2 -2
  21. package/dist/es2019/monitoring/error.js +1 -1
  22. package/dist/es2019/ui/DropList/index.js +1 -1
  23. package/dist/es2019/ui-color/ColorPalette/Color/index.js +61 -1
  24. package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +36 -1
  25. package/dist/es2019/ui-color/ColorPalette/index.js +4 -2
  26. package/dist/es2019/utils/annotation/index.js +22 -0
  27. package/dist/es2019/utils/index.js +1 -1
  28. package/dist/esm/extensibility/Extension/Extension/index.js +0 -1
  29. package/dist/esm/extensibility/Extension/Extension/styles.js +4 -9
  30. package/dist/esm/extensibility/Extension/InlineExtension/index.js +0 -1
  31. package/dist/esm/extensibility/Extension/InlineExtension/styles.js +1 -4
  32. package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +2 -5
  33. package/dist/esm/extensibility/MultiBodiedExtension/styles.js +2 -2
  34. package/dist/esm/monitoring/error.js +1 -1
  35. package/dist/esm/ui/DropList/index.js +1 -1
  36. package/dist/esm/ui-color/ColorPalette/Color/index.js +57 -7
  37. package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +37 -1
  38. package/dist/esm/ui-color/ColorPalette/index.js +4 -2
  39. package/dist/esm/utils/annotation/index.js +22 -0
  40. package/dist/esm/utils/index.js +1 -1
  41. package/dist/types/analytics/types/inline-comment-events.d.ts +1 -0
  42. package/dist/types/types/feature-flags.d.ts +8 -0
  43. package/dist/types/ui-color/ColorPalette/Color/index.d.ts +5 -2
  44. package/dist/types/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +3 -0
  45. package/dist/types/ui-color/ColorPalette/Palettes/type.d.ts +2 -0
  46. package/dist/types/utils/annotation/index.d.ts +10 -0
  47. package/dist/types/utils/index.d.ts +1 -1
  48. package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +1 -0
  49. package/dist/types-ts4.5/types/feature-flags.d.ts +8 -0
  50. package/dist/types-ts4.5/ui-color/ColorPalette/Color/index.d.ts +5 -2
  51. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +3 -0
  52. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/type.d.ts +2 -0
  53. package/dist/types-ts4.5/utils/annotation/index.d.ts +10 -0
  54. package/dist/types-ts4.5/utils/index.d.ts +1 -1
  55. package/package.json +5 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 82.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#108458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108458)
8
+ [`07ff840152c4a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07ff840152c4a) -
9
+ [ED-23469] Add elementDragAndDrop key for platform_editor_element_drag_and_drop feature gate
10
+ - [#107856](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107856)
11
+ [`7ba2db81f78ac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7ba2db81f78ac) -
12
+ [ux] [ED-23348] Make transparent option in highlight color palette more obvious with a diagonal
13
+ line.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#109540](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109540)
18
+ [`2267be0c78aea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2267be0c78aea) -
19
+ [ux] Fix hover and remove interactions with new macro UX updates and update vr test snapshots
20
+ - [#109969](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109969)
21
+ [`52590a0b562ef`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52590a0b562ef) -
22
+ ED-23690 Adds an attribute to annotation analytic events with the name of nodes inside the
23
+ annotation range
24
+ - Updated dependencies
25
+
3
26
  ## 82.2.2
4
27
 
5
28
  ### Patch Changes
@@ -62,7 +62,6 @@ function ExtensionWithPluginState(props) {
62
62
  editorAppearance !== 'full-width';
63
63
  var classNames = (0, _classnames2.default)('extension-container', 'block', shadowClassNames, (0, _defineProperty2.default)({
64
64
  'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
65
- 'with-border': showMacroInteractionDesignUpdates,
66
65
  'with-bodied-border': showMacroInteractionDesignUpdates && hasBody,
67
66
  'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
68
67
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
@@ -17,19 +17,15 @@ var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_styles.wrapperDefault
17
17
  '.extension-overflow-wrapper:not(.with-body)': {
18
18
  overflowX: 'auto'
19
19
  },
20
- '&.with-border': {
21
- border: "1px solid transparent" // adding this so macro doesn't jump when hover border is shown
22
- },
23
20
  '&.with-bodied-border': {
24
- border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
21
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
25
22
  },
26
23
  '&.with-hover-border': {
27
- border: "1px solid ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
24
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
28
25
  },
29
26
  '&.with-margin-styles': {
30
27
  margin: "0 ".concat("var(--ds-space-negative-150, -12px)"),
31
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
32
- padding: '0 10px' // need exact number here to match editor elements' width
28
+ padding: "0 ".concat("var(--ds-space-150, 12px)")
33
29
  }
34
30
  });
35
31
  var header = exports.header = (0, _react.css)({
@@ -63,7 +59,6 @@ var contentWrapper = exports.contentWrapper = (0, _react.css)({
63
59
  });
64
60
  var overflowWrapperStyles = exports.overflowWrapperStyles = (0, _react.css)({
65
61
  '&.with-margin-styles': {
66
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
67
- margin: "0 -10px" // need exact number here to match editor elements' width
62
+ margin: "0 ".concat("var(--ds-space-negative-150, -12px)")
68
63
  }
69
64
  });
@@ -35,7 +35,6 @@ var InlineExtension = function InlineExtension(props) {
35
35
  'with-overlay': !showMacroInteractionDesignUpdates,
36
36
  'with-children': hasChildren,
37
37
  'with-danger-overlay': showMacroInteractionDesignUpdates,
38
- 'with-border': showMacroInteractionDesignUpdates,
39
38
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered
40
39
  });
41
40
  var rendererContainerWidth = widthState ? widthState.width - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 : 0;
@@ -24,11 +24,8 @@ var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_styles.wrapperDefault
24
24
  padding: 0,
25
25
  background: "var(--ds-background-neutral-subtle, white)"
26
26
  },
27
- '&.with-border': {
28
- border: "1px solid transparent" // adding this so macro doesn't jump when hover border is shown
29
- },
30
27
  '&.with-hover-border': {
31
- border: "1px solid ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
28
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
32
29
  }
33
30
  });
34
31
  var inlineWrapperStyles = exports.inlineWrapperStyles = (0, _react.css)({
@@ -42,11 +42,8 @@ var labelStyles = (0, _react2.css)({
42
42
  background: "var(--ds-surface, ".concat(_colors.N0, ")")
43
43
  },
44
44
  '&.bodied-border': {
45
- border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
46
- },
47
- // to account for bodied having borders now - adding this to help with less conditional styling
48
- border: '1px solid transparent',
49
- borderBottom: 'none'
45
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
46
+ }
50
47
  });
51
48
  var textStyles = (0, _react2.css)({
52
49
  fontSize: '14px',
@@ -27,10 +27,10 @@ var mbeExtensionWrapperCSSStyles = exports.mbeExtensionWrapperCSSStyles = (0, _r
27
27
  paddingTop: "var(--ds-space-100, 8px)".concat(" !important")
28
28
  },
29
29
  '&.with-border': {
30
- border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
30
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
31
31
  },
32
32
  '&.with-hover-border': {
33
- border: "1px solid ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
33
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
34
34
  },
35
35
  '&.with-padding-background-styles': {
36
36
  padding: "var(--ds-space-100, 8px)",
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  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; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "82.2.2";
20
+ var packageVersion = "82.3.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  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); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "82.2.2";
23
+ var packageVersion = "82.3.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -16,6 +16,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _react2 = require("@emotion/react");
18
18
  var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
20
  var _colors = require("@atlaskit/theme/colors");
20
21
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
21
22
  var _styles = require("./styles");
@@ -23,12 +24,60 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
23
24
  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; }
24
25
  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); }; }
25
26
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
26
- var Color = /*#__PURE__*/function (_PureComponent) {
27
- (0, _inherits2.default)(Color, _PureComponent);
28
- var _super = _createSuper(Color);
29
- function Color() {
27
+ function FunctionalComponentColor(props) {
28
+ var autoFocus = props.autoFocus,
29
+ tabIndex = props.tabIndex,
30
+ value = props.value,
31
+ label = props.label,
32
+ isSelected = props.isSelected,
33
+ borderColor = props.borderColor,
34
+ _props$checkMarkColor = props.checkMarkColor,
35
+ checkMarkColor = _props$checkMarkColor === void 0 ? _colors.N0 : _props$checkMarkColor,
36
+ hexToPaletteColor = props.hexToPaletteColor,
37
+ decorator = props.decorator;
38
+ var colorStyle = hexToPaletteColor ? hexToPaletteColor(value) : value;
39
+ var onMouseDown = function onMouseDown(e) {
40
+ e.preventDefault();
41
+ };
42
+ var onClick = function onClick(e) {
43
+ var onClick = props.onClick,
44
+ value = props.value,
45
+ label = props.label;
46
+ e.preventDefault();
47
+ onClick(value, label);
48
+ };
49
+ return (0, _react2.jsx)(_tooltip.default, {
50
+ content: label
51
+ }, (0, _react2.jsx)("span", {
52
+ css: _styles.buttonWrapperStyle
53
+ }, (0, _react2.jsx)("button", {
54
+ type: "button",
55
+ css: _styles.buttonStyle,
56
+ "aria-label": label,
57
+ role: "radio",
58
+ "aria-checked": isSelected,
59
+ onClick: onClick,
60
+ onMouseDown: onMouseDown,
61
+ tabIndex: tabIndex
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
63
+ ,
64
+ className: "".concat(isSelected ? 'selected' : ''),
65
+ style: {
66
+ backgroundColor: colorStyle || 'transparent',
67
+ border: "1px solid ".concat(borderColor)
68
+ },
69
+ autoFocus: autoFocus
70
+ }, isSelected && (0, _react2.jsx)(_done.default, {
71
+ primaryColor: checkMarkColor,
72
+ label: ""
73
+ }), decorator)));
74
+ }
75
+ var ClassComponentColor = /*#__PURE__*/function (_PureComponent) {
76
+ (0, _inherits2.default)(ClassComponentColor, _PureComponent);
77
+ var _super = _createSuper(ClassComponentColor);
78
+ function ClassComponentColor() {
30
79
  var _this;
31
- (0, _classCallCheck2.default)(this, Color);
80
+ (0, _classCallCheck2.default)(this, ClassComponentColor);
32
81
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
82
  args[_key] = arguments[_key];
34
83
  }
@@ -46,7 +95,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
46
95
  });
47
96
  return _this;
48
97
  }
49
- (0, _createClass2.default)(Color, [{
98
+ (0, _createClass2.default)(ClassComponentColor, [{
50
99
  key: "render",
51
100
  value: function render() {
52
101
  var _this$props2 = this.props,
@@ -87,6 +136,7 @@ var Color = /*#__PURE__*/function (_PureComponent) {
87
136
  }))));
88
137
  }
89
138
  }]);
90
- return Color;
139
+ return ClassComponentColor;
91
140
  }(_react.PureComponent);
141
+ var Color = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.transparent-diagonal-decorator') ? FunctionalComponentColor : ClassComponentColor;
92
142
  var _default = exports.default = Color;
@@ -4,19 +4,55 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = void 0;
7
+ exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
8
+ var _react = require("@emotion/react");
8
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
+ var _icon = _interopRequireDefault(require("@atlaskit/icon"));
11
+ var _tokens = require("@atlaskit/tokens");
9
12
  var _common = require("./common");
10
13
  var _getColorMessage = _interopRequireDefault(require("./getColorMessage"));
11
14
  var _paletteMessages = _interopRequireDefault(require("./paletteMessages"));
12
15
  var _textColorPalette = require("./textColorPalette");
16
+ /** @jsx jsx */
17
+
13
18
  var REMOVE_HIGHLIGHT_COLOR = exports.REMOVE_HIGHLIGHT_COLOR = '#00000000';
19
+ var DiagonalLineGlyph = function DiagonalLineGlyph() {
20
+ return (0, _react.jsx)("svg", {
21
+ width: "24",
22
+ height: "24",
23
+ viewBox: "0 0 24 24",
24
+ fill: "none",
25
+ xmlns: "http://www.w3.org/2000/svg"
26
+ }, (0, _react.jsx)("rect", {
27
+ width: "24",
28
+ height: "24",
29
+ fill: "white",
30
+ fillOpacity: "0.01"
31
+ }), (0, _react.jsx)("path", {
32
+ fillRule: "evenodd",
33
+ clipRule: "evenodd",
34
+ d: "M17.2038 7.70388C17.5955 8.09565 17.5941 8.73128 17.2005 9.12127L9.1213 17.1277C8.73027 17.5152 8.09958 17.5138 7.71031 17.1245C7.31854 16.7328 7.31997 16.0971 7.71351 15.7071L15.7928 7.70069C16.1838 7.31318 16.8145 7.31461 17.2038 7.70388Z",
35
+ fill: "currentColor",
36
+ fillOpacity: "0.5"
37
+ }));
38
+ };
39
+ var EditorDiagonalLineIcon = exports.EditorDiagonalLineIcon = function EditorDiagonalLineIcon() {
40
+ var _useThemeObserver = (0, _tokens.useThemeObserver)(),
41
+ colorMode = _useThemeObserver.colorMode;
42
+ var primaryColor = colorMode === 'dark' ? "var(--ds-background-accent-gray-bolder, #626F86)" : "var(--ds-background-accent-gray-subtle, #8590A2)";
43
+ return (0, _react.jsx)(_icon.default, {
44
+ glyph: DiagonalLineGlyph,
45
+ label: "",
46
+ primaryColor: primaryColor
47
+ });
48
+ };
14
49
  var highlightColorPalette = exports.highlightColorPalette = [{
15
50
  value: REMOVE_HIGHLIGHT_COLOR,
16
51
  label: 'No color',
17
52
  // Mostly informative, only used for analytics
18
53
  border: _common.DEFAULT_BORDER_COLOR,
19
- message: (0, _getColorMessage.default)(_paletteMessages.default, 'no-color')
54
+ message: (0, _getColorMessage.default)(_paletteMessages.default, 'no-color'),
55
+ decorator: (0, _react.jsx)(EditorDiagonalLineIcon, null)
20
56
  }];
21
57
  _adfSchema.backgroundColorPalette.forEach(function (label, color) {
22
58
  highlightColorPalette.push((0, _textColorPalette.mapPaletteColor)(label, color));
@@ -72,7 +72,8 @@ var ColorPalette = function ColorPalette(props) {
72
72
  var value = _ref.value,
73
73
  label = _ref.label,
74
74
  border = _ref.border,
75
- message = _ref.message;
75
+ message = _ref.message,
76
+ decorator = _ref.decorator;
76
77
  if (paletteColorTooltipMessages) {
77
78
  if (tokenTheme === 'dark') {
78
79
  message = (0, _getColorMessage.default)(paletteColorTooltipMessages.dark, value.toUpperCase());
@@ -89,7 +90,8 @@ var ColorPalette = function ColorPalette(props) {
89
90
  onClick: onClick,
90
91
  isSelected: value === selectedColor,
91
92
  checkMarkColor: getCheckMarkColor(value, useIconToken),
92
- hexToPaletteColor: hexToPaletteColor
93
+ hexToPaletteColor: hexToPaletteColor,
94
+ decorator: decorator
93
95
  });
94
96
  }));
95
97
  }));
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.canApplyAnnotationOnRange = void 0;
7
8
  exports.containsAnyAnnotations = containsAnyAnnotations;
8
9
  exports.getAnnotationIdsFromRange = void 0;
10
+ exports.getRangeInlineNodeNames = getRangeInlineNodeNames;
9
11
  exports.hasAnnotationMark = hasAnnotationMark;
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
14
  var canApplyAnnotationOnRange = exports.canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelection, doc, schema) {
12
15
  var from = rangeSelection.from,
@@ -98,4 +101,25 @@ function containsAnyAnnotations(slice, state) {
98
101
  });
99
102
  });
100
103
  return hasAnnotation;
104
+ }
105
+
106
+ /**
107
+ * This returns a list of node names that are inline nodes in the range.
108
+ */
109
+ function getRangeInlineNodeNames(_ref) {
110
+ var doc = _ref.doc,
111
+ pos = _ref.pos;
112
+ if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
113
+ return undefined;
114
+ }
115
+ var nodeNames = new Set();
116
+ doc.nodesBetween(pos.from, pos.to, function (node) {
117
+ if (node.isInline) {
118
+ nodeNames.add(node.type.name);
119
+ }
120
+ });
121
+
122
+ // We sort the list alphabetically to make human consumption of the list easier (in tools like the analytics extension)
123
+ var sortedNames = (0, _toConsumableArray2.default)(nodeNames).sort();
124
+ return sortedNames;
101
125
  }
@@ -498,6 +498,12 @@ Object.defineProperty(exports, "getPropsDifference", {
498
498
  return _compareProps.getPropsDifference;
499
499
  }
500
500
  });
501
+ Object.defineProperty(exports, "getRangeInlineNodeNames", {
502
+ enumerable: true,
503
+ get: function get() {
504
+ return _annotation.getRangeInlineNodeNames;
505
+ }
506
+ });
501
507
  Object.defineProperty(exports, "getResponseEndTime", {
502
508
  enumerable: true,
503
509
  get: function get() {
@@ -51,7 +51,6 @@ function ExtensionWithPluginState(props) {
51
51
  editorAppearance !== 'full-width';
52
52
  const classNames = classnames('extension-container', 'block', shadowClassNames, {
53
53
  'with-overlay': !hasBody && !showMacroInteractionDesignUpdates,
54
- 'with-border': showMacroInteractionDesignUpdates,
55
54
  'with-bodied-border': showMacroInteractionDesignUpdates && hasBody,
56
55
  'with-margin-styles': showMacroInteractionDesignUpdates && !isNodeNested,
57
56
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered,
@@ -11,19 +11,15 @@ export const wrapperStyle = css(wrapperDefault, {
11
11
  '.extension-overflow-wrapper:not(.with-body)': {
12
12
  overflowX: 'auto'
13
13
  },
14
- '&.with-border': {
15
- border: `1px solid transparent` // adding this so macro doesn't jump when hover border is shown
16
- },
17
14
  '&.with-bodied-border': {
18
- border: `1px solid ${`var(--ds-border, ${N30})`}`
15
+ boxShadow: `0 0 0 1px ${`var(--ds-border, ${N30})`}`
19
16
  },
20
17
  '&.with-hover-border': {
21
- border: `1px solid ${`var(--ds-border-input, ${N500})`}`
18
+ boxShadow: `0 0 0 1px ${`var(--ds-border-input, ${N500})`}`
22
19
  },
23
20
  '&.with-margin-styles': {
24
21
  margin: `0 ${"var(--ds-space-negative-150, -12px)"}`,
25
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
26
- padding: '0 10px' // need exact number here to match editor elements' width
22
+ padding: `0 ${"var(--ds-space-150, 12px)"}`
27
23
  }
28
24
  });
29
25
  export const header = css({
@@ -57,7 +53,6 @@ export const contentWrapper = css({
57
53
  });
58
54
  export const overflowWrapperStyles = css({
59
55
  '&.with-margin-styles': {
60
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
61
- margin: `0 -10px` // need exact number here to match editor elements' width
56
+ margin: `0 ${"var(--ds-space-negative-150, -12px)"}`
62
57
  }
63
58
  });
@@ -27,7 +27,6 @@ const InlineExtension = props => {
27
27
  'with-overlay': !showMacroInteractionDesignUpdates,
28
28
  'with-children': hasChildren,
29
29
  'with-danger-overlay': showMacroInteractionDesignUpdates,
30
- 'with-border': showMacroInteractionDesignUpdates,
31
30
  'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered
32
31
  });
33
32
  const rendererContainerWidth = widthState ? widthState.width - akEditorGutterPaddingDynamic() * 2 : 0;
@@ -18,11 +18,8 @@ export const wrapperStyle = css(wrapperDefault, {
18
18
  padding: 0,
19
19
  background: "var(--ds-background-neutral-subtle, white)"
20
20
  },
21
- '&.with-border': {
22
- border: `1px solid transparent` // adding this so macro doesn't jump when hover border is shown
23
- },
24
21
  '&.with-hover-border': {
25
- border: `1px solid ${`var(--ds-border-input, ${N500})`}`
22
+ boxShadow: `0 0 0 1px ${`var(--ds-border-input, ${N500})`}`
26
23
  }
27
24
  });
28
25
  export const inlineWrapperStyles = css({
@@ -34,11 +34,8 @@ const labelStyles = css({
34
34
  background: `var(--ds-surface, ${N0})`
35
35
  },
36
36
  '&.bodied-border': {
37
- border: `1px solid ${`var(--ds-border, ${N30})`}`
38
- },
39
- // to account for bodied having borders now - adding this to help with less conditional styling
40
- border: '1px solid transparent',
41
- borderBottom: 'none'
37
+ boxShadow: `0 0 0 1px ${`var(--ds-border, ${N30})`}`
38
+ }
42
39
  });
43
40
  const textStyles = css({
44
41
  fontSize: '14px',
@@ -22,10 +22,10 @@ export const mbeExtensionWrapperCSSStyles = css(wrapperDefault, {
22
22
  paddingTop: `${"var(--ds-space-100, 8px)"} !important`
23
23
  },
24
24
  '&.with-border': {
25
- border: `1px solid ${`var(--ds-border, ${N30})`}`
25
+ boxShadow: `0 0 0 1px ${`var(--ds-border, ${N30})`}`
26
26
  },
27
27
  '&.with-hover-border': {
28
- border: `1px solid ${`var(--ds-border-input, ${N500})`}`
28
+ boxShadow: `0 0 0 1px ${`var(--ds-border-input, ${N500})`}`
29
29
  },
30
30
  '&.with-padding-background-styles': {
31
31
  padding: "var(--ds-space-100, 8px)",
@@ -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 = "82.2.2";
4
+ const packageVersion = "82.3.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // 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 = "82.2.2";
10
+ const packageVersion = "82.3.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -3,10 +3,69 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React, { PureComponent } from 'react';
4
4
  import { jsx } from '@emotion/react';
5
5
  import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
7
  import { N0 } from '@atlaskit/theme/colors';
7
8
  import Tooltip from '@atlaskit/tooltip';
8
9
  import { buttonStyle, buttonWrapperStyle } from './styles';
9
- class Color extends PureComponent {
10
+ function FunctionalComponentColor(props) {
11
+ const {
12
+ autoFocus,
13
+ tabIndex,
14
+ value,
15
+ label,
16
+ isSelected,
17
+ borderColor,
18
+ /** this is not new usage - old code extracted from editor-core */
19
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
20
+ checkMarkColor = N0,
21
+ /**
22
+ * When hexToPaletteColor prop is set,
23
+ * it will be used to get background color style based on
24
+ * value (which will be hexcode) prop
25
+ */
26
+ hexToPaletteColor,
27
+ decorator
28
+ } = props;
29
+ const colorStyle = hexToPaletteColor ? hexToPaletteColor(value) : value;
30
+ const onMouseDown = e => {
31
+ e.preventDefault();
32
+ };
33
+ const onClick = e => {
34
+ const {
35
+ onClick,
36
+ value,
37
+ label
38
+ } = props;
39
+ e.preventDefault();
40
+ onClick(value, label);
41
+ };
42
+ return jsx(Tooltip, {
43
+ content: label
44
+ }, jsx("span", {
45
+ css: buttonWrapperStyle
46
+ }, jsx("button", {
47
+ type: "button",
48
+ css: buttonStyle,
49
+ "aria-label": label,
50
+ role: "radio",
51
+ "aria-checked": isSelected,
52
+ onClick: onClick,
53
+ onMouseDown: onMouseDown,
54
+ tabIndex: tabIndex
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
56
+ ,
57
+ className: `${isSelected ? 'selected' : ''}`,
58
+ style: {
59
+ backgroundColor: colorStyle || 'transparent',
60
+ border: `1px solid ${borderColor}`
61
+ },
62
+ autoFocus: autoFocus
63
+ }, isSelected && jsx(EditorDoneIcon, {
64
+ primaryColor: checkMarkColor,
65
+ label: ""
66
+ }), decorator)));
67
+ }
68
+ class ClassComponentColor extends PureComponent {
10
69
  constructor(...args) {
11
70
  super(...args);
12
71
  _defineProperty(this, "onMouseDown", e => {
@@ -68,4 +127,5 @@ class Color extends PureComponent {
68
127
  }))));
69
128
  }
70
129
  }
130
+ const Color = getBooleanFF('platform.editor.transparent-diagonal-decorator') ? FunctionalComponentColor : ClassComponentColor;
71
131
  export default Color;
@@ -1,15 +1,50 @@
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
1
4
  import { backgroundColorPalette } from '@atlaskit/adf-schema';
5
+ import Icon from '@atlaskit/icon';
6
+ import { useThemeObserver } from '@atlaskit/tokens';
2
7
  import { DEFAULT_BORDER_COLOR } from './common';
3
8
  import getColorMessage from './getColorMessage';
4
9
  import paletteMessages from './paletteMessages';
5
10
  import { mapPaletteColor } from './textColorPalette';
6
11
  export const REMOVE_HIGHLIGHT_COLOR = '#00000000';
12
+ const DiagonalLineGlyph = () => jsx("svg", {
13
+ width: "24",
14
+ height: "24",
15
+ viewBox: "0 0 24 24",
16
+ fill: "none",
17
+ xmlns: "http://www.w3.org/2000/svg"
18
+ }, jsx("rect", {
19
+ width: "24",
20
+ height: "24",
21
+ fill: "white",
22
+ fillOpacity: "0.01"
23
+ }), jsx("path", {
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd",
26
+ d: "M17.2038 7.70388C17.5955 8.09565 17.5941 8.73128 17.2005 9.12127L9.1213 17.1277C8.73027 17.5152 8.09958 17.5138 7.71031 17.1245C7.31854 16.7328 7.31997 16.0971 7.71351 15.7071L15.7928 7.70069C16.1838 7.31318 16.8145 7.31461 17.2038 7.70388Z",
27
+ fill: "currentColor",
28
+ fillOpacity: "0.5"
29
+ }));
30
+ export const EditorDiagonalLineIcon = () => {
31
+ const {
32
+ colorMode
33
+ } = useThemeObserver();
34
+ const primaryColor = colorMode === 'dark' ? "var(--ds-background-accent-gray-bolder, #626F86)" : "var(--ds-background-accent-gray-subtle, #8590A2)";
35
+ return jsx(Icon, {
36
+ glyph: DiagonalLineGlyph,
37
+ label: "",
38
+ primaryColor: primaryColor
39
+ });
40
+ };
7
41
  export const highlightColorPalette = [{
8
42
  value: REMOVE_HIGHLIGHT_COLOR,
9
43
  label: 'No color',
10
44
  // Mostly informative, only used for analytics
11
45
  border: DEFAULT_BORDER_COLOR,
12
- message: getColorMessage(paletteMessages, 'no-color')
46
+ message: getColorMessage(paletteMessages, 'no-color'),
47
+ decorator: jsx(EditorDiagonalLineIcon, null)
13
48
  }];
14
49
  backgroundColorPalette.forEach((label, color) => {
15
50
  highlightColorPalette.push(mapPaletteColor(label, color));
@@ -67,7 +67,8 @@ const ColorPalette = props => {
67
67
  value,
68
68
  label,
69
69
  border,
70
- message
70
+ message,
71
+ decorator
71
72
  }) => {
72
73
  if (paletteColorTooltipMessages) {
73
74
  if (tokenTheme === 'dark') {
@@ -85,7 +86,8 @@ const ColorPalette = props => {
85
86
  onClick: onClick,
86
87
  isSelected: value === selectedColor,
87
88
  checkMarkColor: getCheckMarkColor(value, useIconToken),
88
- hexToPaletteColor: hexToPaletteColor
89
+ hexToPaletteColor: hexToPaletteColor,
90
+ decorator: decorator
89
91
  });
90
92
  }))));
91
93
  };