@atlaskit/editor-toolbar 1.5.0 → 1.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-toolbar
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6aa28179246c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6aa28179246c9) -
8
+ Support data-extension-item-key to identify the selection extension menu items.
9
+ - Updated dependencies
10
+
3
11
  ## 1.5.0
4
12
 
5
13
  ### Minor Changes
@@ -15,6 +15,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
15
15
  var _react = _interopRequireWildcard(require("react"));
16
16
  var _css = require("@atlaskit/css");
17
17
  var _dropdownMenu = require("@atlaskit/dropdown-menu");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _compiled = require("@atlaskit/primitives/compiled");
19
20
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
21
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
@@ -41,7 +42,8 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
41
42
  ariaKeyshortcuts = _ref['aria-keyshortcuts'],
42
43
  onClick = _ref.onClick,
43
44
  tabIndex = _ref.tabIndex,
44
- title = _ref.title;
45
+ title = _ref.title,
46
+ dataExtensionItemKey = _ref['data-extension-item-key'];
45
47
  return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
46
48
  role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
47
49
  testId: testId,
@@ -57,7 +59,8 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
57
59
  "aria-keyshortcuts": ariaKeyshortcuts,
58
60
  "data-toolbar-component": (0, _experiments.editorExperiment)('platform_synced_block', true) ? 'menu-item' : undefined,
59
61
  ref: ref,
60
- title: (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
62
+ title: (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined,
63
+ "data-extension-item-key": (0, _platformFeatureFlags.fg)('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
61
64
  }, children);
62
65
  });
63
66
  var CustomDropdownMenuItemAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
@@ -13,6 +13,7 @@ var React = _interopRequireWildcard(require("react"));
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _react2 = require("@compiled/react");
15
15
  var _dropdownMenu = _interopRequireDefault(require("@atlaskit/dropdown-menu"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _compiled = require("@atlaskit/primitives/compiled");
17
18
  var _ToolbarDropdownItem = require("./ToolbarDropdownItem");
18
19
  var _ToolbarTooltip = require("./ToolbarTooltip");
@@ -35,7 +36,8 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
35
36
  _ref$shouldFitContain = _ref.shouldFitContainer,
36
37
  shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
37
38
  shouldTitleWrap = _ref.shouldTitleWrap,
38
- tooltipContent = _ref.tooltipContent;
39
+ tooltipContent = _ref.tooltipContent,
40
+ dataExtensionItemKey = _ref['data-extension-item-key'];
39
41
  return /*#__PURE__*/React.createElement(_dropdownMenu.default, {
40
42
  shouldFitContainer: shouldFitContainer,
41
43
  placement: "right-start",
@@ -57,7 +59,8 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
57
59
  triggerRef: triggerProps.triggerRef,
58
60
  hasNestedDropdownMenu: true,
59
61
  isDisabled: isDisabled,
60
- shouldTitleWrap: shouldTitleWrap
62
+ shouldTitleWrap: shouldTitleWrap,
63
+ "data-extension-item-key": (0, _platformFeatureFlags.fg)('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
61
64
  }, text, elemAfterText);
62
65
  if (tooltipContent) {
63
66
  return /*#__PURE__*/React.createElement(_ToolbarTooltip.ToolbarTooltip, {
@@ -5,6 +5,7 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { forwardRef, isValidElement, cloneElement } from 'react';
6
6
  import { cx } from '@atlaskit/css';
7
7
  import { DropdownItem } from '@atlaskit/dropdown-menu';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { Anchor, Box, Pressable } from '@atlaskit/primitives/compiled';
9
10
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -26,7 +27,8 @@ const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
26
27
  'aria-keyshortcuts': ariaKeyshortcuts,
27
28
  onClick,
28
29
  tabIndex,
29
- title
30
+ title,
31
+ 'data-extension-item-key': dataExtensionItemKey
30
32
  }, ref) => /*#__PURE__*/React.createElement(Pressable, {
31
33
  role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
32
34
  testId: testId,
@@ -42,7 +44,8 @@ const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
42
44
  "aria-keyshortcuts": ariaKeyshortcuts,
43
45
  "data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
44
46
  ref: ref,
45
- title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
47
+ title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined,
48
+ "data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
46
49
  }, children));
47
50
  const CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(({
48
51
  children,
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { cx } from '@compiled/react';
7
7
  import DropdownMenu from '@atlaskit/dropdown-menu';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { Box } from '@atlaskit/primitives/compiled';
9
10
  import { ToolbarDropdownItem } from './ToolbarDropdownItem';
10
11
  import { ToolbarTooltip } from './ToolbarTooltip';
@@ -24,7 +25,8 @@ export const ToolbarNestedDropdownMenu = ({
24
25
  onClick,
25
26
  shouldFitContainer = false,
26
27
  shouldTitleWrap,
27
- tooltipContent
28
+ tooltipContent,
29
+ 'data-extension-item-key': dataExtensionItemKey
28
30
  }) => {
29
31
  return /*#__PURE__*/React.createElement(DropdownMenu, {
30
32
  shouldFitContainer: shouldFitContainer,
@@ -47,7 +49,8 @@ export const ToolbarNestedDropdownMenu = ({
47
49
  triggerRef: triggerProps.triggerRef,
48
50
  hasNestedDropdownMenu: true,
49
51
  isDisabled: isDisabled,
50
- shouldTitleWrap: shouldTitleWrap
52
+ shouldTitleWrap: shouldTitleWrap,
53
+ "data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
51
54
  }, text, elemAfterText);
52
55
  if (tooltipContent) {
53
56
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
@@ -11,6 +11,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
11
11
  import React, { forwardRef, isValidElement, cloneElement } from 'react';
12
12
  import { cx } from '@atlaskit/css';
13
13
  import { DropdownItem } from '@atlaskit/dropdown-menu';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { Anchor, Box, Pressable } from '@atlaskit/primitives/compiled';
15
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
17
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -32,7 +33,8 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
32
33
  ariaKeyshortcuts = _ref['aria-keyshortcuts'],
33
34
  onClick = _ref.onClick,
34
35
  tabIndex = _ref.tabIndex,
35
- title = _ref.title;
36
+ title = _ref.title,
37
+ dataExtensionItemKey = _ref['data-extension-item-key'];
36
38
  return /*#__PURE__*/React.createElement(Pressable, {
37
39
  role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
38
40
  testId: testId,
@@ -48,7 +50,8 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
48
50
  "aria-keyshortcuts": ariaKeyshortcuts,
49
51
  "data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
50
52
  ref: ref,
51
- title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
53
+ title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined,
54
+ "data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
52
55
  }, children);
53
56
  });
54
57
  var CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { cx } from '@compiled/react';
7
7
  import DropdownMenu from '@atlaskit/dropdown-menu';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { Box } from '@atlaskit/primitives/compiled';
9
10
  import { ToolbarDropdownItem } from './ToolbarDropdownItem';
10
11
  import { ToolbarTooltip } from './ToolbarTooltip';
@@ -26,7 +27,8 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
26
27
  _ref$shouldFitContain = _ref.shouldFitContainer,
27
28
  shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
28
29
  shouldTitleWrap = _ref.shouldTitleWrap,
29
- tooltipContent = _ref.tooltipContent;
30
+ tooltipContent = _ref.tooltipContent,
31
+ dataExtensionItemKey = _ref['data-extension-item-key'];
30
32
  return /*#__PURE__*/React.createElement(DropdownMenu, {
31
33
  shouldFitContainer: shouldFitContainer,
32
34
  placement: "right-start",
@@ -48,7 +50,8 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
48
50
  triggerRef: triggerProps.triggerRef,
49
51
  hasNestedDropdownMenu: true,
50
52
  isDisabled: isDisabled,
51
- shouldTitleWrap: shouldTitleWrap
53
+ shouldTitleWrap: shouldTitleWrap,
54
+ "data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
52
55
  }, text, elemAfterText);
53
56
  if (tooltipContent) {
54
57
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
@@ -8,6 +8,7 @@ export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
8
8
  'aria-haspopup'?: boolean;
9
9
  'aria-keyshortcuts'?: string;
10
10
  'aria-pressed'?: boolean;
11
+ 'data-extension-item-key'?: string;
11
12
  title?: string;
12
13
  };
13
14
  type ToolbarDropdownItemProps = {
@@ -5,6 +5,7 @@
5
5
  import type { ReactNode } from 'react';
6
6
  type ToolbarNestedDropdownMenuProps = {
7
7
  children?: ReactNode;
8
+ 'data-extension-item-key'?: string;
8
9
  dropdownTestId?: string;
9
10
  elemAfter: ReactNode;
10
11
  elemAfterText?: ReactNode;
@@ -21,5 +22,5 @@ type ToolbarNestedDropdownMenuProps = {
21
22
  text?: string;
22
23
  tooltipContent?: ReactNode;
23
24
  };
24
- export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
25
+ export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, "data-extension-item-key": dataExtensionItemKey, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
25
26
  export {};
@@ -8,6 +8,7 @@ export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
8
8
  'aria-haspopup'?: boolean;
9
9
  'aria-keyshortcuts'?: string;
10
10
  'aria-pressed'?: boolean;
11
+ 'data-extension-item-key'?: string;
11
12
  title?: string;
12
13
  };
13
14
  type ToolbarDropdownItemProps = {
@@ -5,6 +5,7 @@
5
5
  import type { ReactNode } from 'react';
6
6
  type ToolbarNestedDropdownMenuProps = {
7
7
  children?: ReactNode;
8
+ 'data-extension-item-key'?: string;
8
9
  dropdownTestId?: string;
9
10
  elemAfter: ReactNode;
10
11
  elemAfterText?: ReactNode;
@@ -21,5 +22,5 @@ type ToolbarNestedDropdownMenuProps = {
21
22
  text?: string;
22
23
  tooltipContent?: ReactNode;
23
24
  };
24
- export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
25
+ export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, "data-extension-item-key": dataExtensionItemKey, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
25
26
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "1.5.0",
6
+ "version": "1.5.1",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "react-compiler": {
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/browser-apis": "^0.0.1",
33
33
  "@atlaskit/css": "^0.19.0",
34
34
  "@atlaskit/dropdown-menu": "^16.8.0",
35
- "@atlaskit/icon": "^34.5.0",
35
+ "@atlaskit/icon": "^34.6.0",
36
36
  "@atlaskit/icon-lab": "^6.9.0",
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/popup": "^4.19.0",
@@ -92,6 +92,9 @@
92
92
  "platform-feature-flags": {
93
93
  "platform_editor_fix_t_at_is_not_a_function": {
94
94
  "type": "boolean"
95
+ },
96
+ "cc_blocks_changeboarding": {
97
+ "type": "boolean"
95
98
  }
96
99
  }
97
100
  }