@atlaskit/editor-common 78.3.1 → 78.4.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,17 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#70153](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70153) [`3a34e7545f18`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3a34e7545f18) - ECA11Y-36: Flaoting toolbar group buttons into radiogroup buttons structure
8
+
9
+ ## 78.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#74684](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74684) [`077c9034fc89`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/077c9034fc89) - Pass fullName as ariaLabel to ProfileCardTrigger props'
14
+
3
15
  ## 78.3.1
4
16
 
5
17
  ### Patch Changes
@@ -60,5 +60,10 @@ var linkToolbarMessages = exports.linkToolbarMessages = (0, _reactIntlNext.defin
60
60
  id: 'fabric.editor.edit.datasource',
61
61
  defaultMessage: 'Edit search query',
62
62
  description: 'Datasource toolbar edit button'
63
+ },
64
+ searchInput: {
65
+ id: 'fabric.editor.edit.searchInput',
66
+ defaultMessage: 'Add a link',
67
+ description: 'Label for the search media input'
63
68
  }
64
69
  });
@@ -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.3.1";
19
+ var packageVersion = "78.4.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.3.1";
25
+ var packageVersion = "78.4.0";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
13
14
  var _styles = require("./styles");
14
15
  var _excluded = ["buttonStyles"];
@@ -39,10 +40,16 @@ var _default = exports.default = function _default(_ref) {
39
40
  ariaHasPopup = _ref.ariaHasPopup,
40
41
  tabIndex = _ref.tabIndex,
41
42
  areaControls = _ref.areaControls,
42
- ariaLabel = _ref.ariaLabel;
43
+ ariaLabel = _ref.ariaLabel,
44
+ isRadioButton = _ref.isRadioButton;
43
45
  // Check if there's only an icon and add additional styles
44
46
  var iconOnly = (icon || iconAfter) && !children;
45
47
  var customSpacing = iconOnly ? _styles.iconOnlySpacing : {};
48
+ var isButtonPressed = ariaHasPopup ? undefined : selected;
49
+ var ariaChecked = isRadioButton ? isButtonPressed : undefined;
50
+ var ariaCheckedWithFF = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-floating-toolbar-markup_vexmo') ? ariaChecked : undefined;
51
+ var ariaPressed = isRadioButton ? undefined : isButtonPressed;
52
+ var ariaPressedWithFF = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-floating-toolbar-markup_vexmo') ? ariaPressed : isButtonPressed;
46
53
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
47
54
  content: tooltipContent || title,
48
55
  hideTooltipOnClick: hideTooltipOnClick,
@@ -65,7 +72,9 @@ var _default = exports.default = function _default(_ref) {
65
72
  }, rest);
66
73
  },
67
74
  "aria-label": ariaLabel || title,
68
- "aria-pressed": !ariaHasPopup ? selected : undefined,
75
+ "aria-pressed": ariaPressedWithFF,
76
+ "aria-checked": ariaCheckedWithFF,
77
+ role: isRadioButton ? 'radio' : undefined,
69
78
  "aria-expanded": ariaHasPopup ? selected : undefined,
70
79
  "aria-controls": ariaHasPopup ? areaControls : undefined,
71
80
  spacing: 'compact',
@@ -31,7 +31,9 @@ function MentionWithProfileCard(_ref) {
31
31
  resourceClient: resourceClient,
32
32
  actions: actions,
33
33
  trigger: "click",
34
- position: "bottom-end"
34
+ position: "bottom-end",
35
+ testId: "mention-with-profilecard-trigger",
36
+ ariaLabel: text.replace(/^@/, '')
35
37
  }, /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
36
38
  id: id,
37
39
  text: text,
@@ -54,5 +54,10 @@ export const linkToolbarMessages = defineMessages({
54
54
  id: 'fabric.editor.edit.datasource',
55
55
  defaultMessage: 'Edit search query',
56
56
  description: 'Datasource toolbar edit button'
57
+ },
58
+ searchInput: {
59
+ id: 'fabric.editor.edit.searchInput',
60
+ defaultMessage: 'Add a link',
61
+ description: 'Label for the search media input'
57
62
  }
58
63
  });
@@ -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.3.1";
3
+ const packageVersion = "78.4.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.3.1";
10
+ const packageVersion = "78.4.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import Button from '@atlaskit/button/custom-theme-button';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import Tooltip from '@atlaskit/tooltip';
4
5
  import { getButtonStyles, iconOnlySpacing } from './styles';
5
6
  export default (({
@@ -25,11 +26,17 @@ export default (({
25
26
  ariaHasPopup,
26
27
  tabIndex,
27
28
  areaControls,
28
- ariaLabel
29
+ ariaLabel,
30
+ isRadioButton
29
31
  }) => {
30
32
  // Check if there's only an icon and add additional styles
31
33
  const iconOnly = (icon || iconAfter) && !children;
32
34
  const customSpacing = iconOnly ? iconOnlySpacing : {};
35
+ const isButtonPressed = ariaHasPopup ? undefined : selected;
36
+ const ariaChecked = isRadioButton ? isButtonPressed : undefined;
37
+ const ariaCheckedWithFF = getBooleanFF('platform.editor.a11y-floating-toolbar-markup_vexmo') ? ariaChecked : undefined;
38
+ const ariaPressed = isRadioButton ? undefined : isButtonPressed;
39
+ const ariaPressedWithFF = getBooleanFF('platform.editor.a11y-floating-toolbar-markup_vexmo') ? ariaPressed : isButtonPressed;
33
40
  return /*#__PURE__*/React.createElement(Tooltip, {
34
41
  content: tooltipContent || title,
35
42
  hideTooltipOnClick: hideTooltipOnClick,
@@ -58,7 +65,9 @@ export default (({
58
65
  };
59
66
  },
60
67
  "aria-label": ariaLabel || title,
61
- "aria-pressed": !ariaHasPopup ? selected : undefined,
68
+ "aria-pressed": ariaPressedWithFF,
69
+ "aria-checked": ariaCheckedWithFF,
70
+ role: isRadioButton ? 'radio' : undefined,
62
71
  "aria-expanded": ariaHasPopup ? selected : undefined,
63
72
  "aria-controls": ariaHasPopup ? areaControls : undefined,
64
73
  spacing: 'compact',
@@ -22,7 +22,9 @@ export default function MentionWithProfileCard({
22
22
  resourceClient: resourceClient,
23
23
  actions: actions,
24
24
  trigger: "click",
25
- position: "bottom-end"
25
+ position: "bottom-end",
26
+ testId: "mention-with-profilecard-trigger",
27
+ ariaLabel: text.replace(/^@/, '')
26
28
  }, /*#__PURE__*/React.createElement(ResourcedMention, {
27
29
  id: id,
28
30
  text: text,
@@ -54,5 +54,10 @@ export var linkToolbarMessages = defineMessages({
54
54
  id: 'fabric.editor.edit.datasource',
55
55
  defaultMessage: 'Edit search query',
56
56
  description: 'Datasource toolbar edit button'
57
+ },
58
+ searchInput: {
59
+ id: 'fabric.editor.edit.searchInput',
60
+ defaultMessage: 'Add a link',
61
+ description: 'Label for the search media input'
57
62
  }
58
63
  });
@@ -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.3.1";
9
+ var packageVersion = "78.4.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.3.1";
20
+ var packageVersion = "78.4.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -5,6 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
5
5
  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; }
6
6
  import React from 'react';
7
7
  import Button from '@atlaskit/button/custom-theme-button';
8
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
9
  import Tooltip from '@atlaskit/tooltip';
9
10
  import { getButtonStyles, iconOnlySpacing } from './styles';
10
11
  export default (function (_ref) {
@@ -32,10 +33,16 @@ export default (function (_ref) {
32
33
  ariaHasPopup = _ref.ariaHasPopup,
33
34
  tabIndex = _ref.tabIndex,
34
35
  areaControls = _ref.areaControls,
35
- ariaLabel = _ref.ariaLabel;
36
+ ariaLabel = _ref.ariaLabel,
37
+ isRadioButton = _ref.isRadioButton;
36
38
  // Check if there's only an icon and add additional styles
37
39
  var iconOnly = (icon || iconAfter) && !children;
38
40
  var customSpacing = iconOnly ? iconOnlySpacing : {};
41
+ var isButtonPressed = ariaHasPopup ? undefined : selected;
42
+ var ariaChecked = isRadioButton ? isButtonPressed : undefined;
43
+ var ariaCheckedWithFF = getBooleanFF('platform.editor.a11y-floating-toolbar-markup_vexmo') ? ariaChecked : undefined;
44
+ var ariaPressed = isRadioButton ? undefined : isButtonPressed;
45
+ var ariaPressedWithFF = getBooleanFF('platform.editor.a11y-floating-toolbar-markup_vexmo') ? ariaPressed : isButtonPressed;
39
46
  return /*#__PURE__*/React.createElement(Tooltip, {
40
47
  content: tooltipContent || title,
41
48
  hideTooltipOnClick: hideTooltipOnClick,
@@ -58,7 +65,9 @@ export default (function (_ref) {
58
65
  }, rest);
59
66
  },
60
67
  "aria-label": ariaLabel || title,
61
- "aria-pressed": !ariaHasPopup ? selected : undefined,
68
+ "aria-pressed": ariaPressedWithFF,
69
+ "aria-checked": ariaCheckedWithFF,
70
+ role: isRadioButton ? 'radio' : undefined,
62
71
  "aria-expanded": ariaHasPopup ? selected : undefined,
63
72
  "aria-controls": ariaHasPopup ? areaControls : undefined,
64
73
  spacing: 'compact',
@@ -21,7 +21,9 @@ export default function MentionWithProfileCard(_ref) {
21
21
  resourceClient: resourceClient,
22
22
  actions: actions,
23
23
  trigger: "click",
24
- position: "bottom-end"
24
+ position: "bottom-end",
25
+ testId: "mention-with-profilecard-trigger",
26
+ ariaLabel: text.replace(/^@/, '')
25
27
  }, /*#__PURE__*/React.createElement(ResourcedMention, {
26
28
  id: id,
27
29
  text: text,
@@ -54,4 +54,9 @@ export declare const linkToolbarMessages: {
54
54
  defaultMessage: string;
55
55
  description: string;
56
56
  };
57
+ searchInput: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
57
62
  };
@@ -92,6 +92,7 @@ export type FloatingToolbarCopyButton = {
92
92
  export type FloatingToolbarButton<T extends {}> = {
93
93
  id?: string;
94
94
  type: 'button';
95
+ isRadioButton?: boolean;
95
96
  title: string;
96
97
  onClick: T;
97
98
  showTitle?: boolean;
@@ -25,6 +25,7 @@ export interface Props {
25
25
  hideTooltipOnClick?: boolean;
26
26
  tabIndex?: number | null | undefined;
27
27
  areaControls?: string;
28
+ isRadioButton?: boolean;
28
29
  }
29
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, }: Props) => JSX.Element;
30
+ declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
30
31
  export default _default;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { MentionProvider } from '@atlaskit/mention';
3
- import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
- import { MentionEventHandler } from '../EventHandlers';
2
+ import type { MentionProvider } from '@atlaskit/mention';
3
+ import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
+ import type { MentionEventHandler } from '../EventHandlers';
5
5
  export interface Props {
6
6
  id: string;
7
7
  text: string;
@@ -54,4 +54,9 @@ export declare const linkToolbarMessages: {
54
54
  defaultMessage: string;
55
55
  description: string;
56
56
  };
57
+ searchInput: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
57
62
  };
@@ -92,6 +92,7 @@ export type FloatingToolbarCopyButton = {
92
92
  export type FloatingToolbarButton<T extends {}> = {
93
93
  id?: string;
94
94
  type: 'button';
95
+ isRadioButton?: boolean;
95
96
  title: string;
96
97
  onClick: T;
97
98
  showTitle?: boolean;
@@ -25,6 +25,7 @@ export interface Props {
25
25
  hideTooltipOnClick?: boolean;
26
26
  tabIndex?: number | null | undefined;
27
27
  areaControls?: string;
28
+ isRadioButton?: boolean;
28
29
  }
29
- declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, }: Props) => JSX.Element;
30
+ declare const _default: ({ title, icon, iconAfter, onClick, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onBlur, selected, disabled, href, target, appearance, children, className, tooltipContent, testId, hideTooltipOnClick, ariaHasPopup, tabIndex, areaControls, ariaLabel, isRadioButton, }: Props) => JSX.Element;
30
31
  export default _default;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { MentionProvider } from '@atlaskit/mention';
3
- import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
- import { MentionEventHandler } from '../EventHandlers';
2
+ import type { MentionProvider } from '@atlaskit/mention';
3
+ import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
+ import type { MentionEventHandler } from '../EventHandlers';
5
5
  export interface Props {
6
6
  id: string;
7
7
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "78.3.1",
3
+ "version": "78.4.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/"
@@ -108,7 +108,7 @@
108
108
  "@atlaskit/editor-shared-styles": "^2.9.0",
109
109
  "@atlaskit/editor-tables": "^2.5.0",
110
110
  "@atlaskit/emoji": "^67.6.0",
111
- "@atlaskit/icon": "^22.0.0",
111
+ "@atlaskit/icon": "^22.1.0",
112
112
  "@atlaskit/icon-object": "^6.3.0",
113
113
  "@atlaskit/in-product-testing": "^0.2.0",
114
114
  "@atlaskit/link-datasource": "^1.22.0",
@@ -225,6 +225,9 @@
225
225
  },
226
226
  "platform.editor.ordered-list-auto-join-improvements_mrlv5": {
227
227
  "type": "boolean"
228
+ },
229
+ "platform.editor.a11y-floating-toolbar-markup_vexmo": {
230
+ "type": "boolean"
228
231
  }
229
232
  }
230
233
  }