@atlaskit/editor-toolbar 0.19.24 → 0.19.25

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
+ ## 0.19.25
4
+
5
+ ### Patch Changes
6
+
7
+ - [`25ad5c762c280`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25ad5c762c280) -
8
+ [ux] Add truncation on the extention label in block menu
9
+ - Updated dependencies
10
+
3
11
  ## 0.19.24
4
12
 
5
13
  ### Patch Changes
@@ -13,8 +13,10 @@ 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");
19
+ var _ToolbarTooltip = require("./ToolbarTooltip");
18
20
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
21
  var styles = {
20
22
  scrollContainer: "_c71lnklw _18m91wug"
@@ -31,13 +33,15 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
31
33
  enableMaxHeight = _ref$enableMaxHeight === void 0 ? false : _ref$enableMaxHeight,
32
34
  _onClick = _ref.onClick,
33
35
  _ref$shouldFitContain = _ref.shouldFitContainer,
34
- shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain;
36
+ shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
37
+ shouldTitleWrap = _ref.shouldTitleWrap,
38
+ tooltipContent = _ref.tooltipContent;
35
39
  return /*#__PURE__*/React.createElement(_dropdownMenu.default, {
36
40
  shouldFitContainer: shouldFitContainer,
37
41
  placement: "right-start",
38
42
  testId: dropdownTestId,
39
43
  trigger: function trigger(triggerProps) {
40
- return /*#__PURE__*/React.createElement(_ToolbarDropdownItem.ToolbarDropdownItem, {
44
+ var item = /*#__PURE__*/React.createElement(_ToolbarDropdownItem.ToolbarDropdownItem, {
41
45
  elemBefore: elemBefore,
42
46
  elemAfter: elemAfter,
43
47
  isSelected: triggerProps.isSelected,
@@ -48,8 +52,16 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
48
52
  testId: testId,
49
53
  triggerRef: triggerProps.triggerRef,
50
54
  hasNestedDropdownMenu: true,
51
- isDisabled: isDisabled
55
+ isDisabled: isDisabled,
56
+ shouldTitleWrap: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_2') ? shouldTitleWrap : undefined
52
57
  }, text);
58
+ if (tooltipContent && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_2')) {
59
+ return /*#__PURE__*/React.createElement(_ToolbarTooltip.ToolbarTooltip, {
60
+ content: tooltipContent,
61
+ position: "top"
62
+ }, item);
63
+ }
64
+ return item;
53
65
  }
54
66
  }, /*#__PURE__*/React.createElement(_compiled.Box, {
55
67
  xcss: (0, _react2.cx)(enableMaxHeight && styles.scrollContainer),
@@ -5,8 +5,10 @@ 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';
11
+ import { ToolbarTooltip } from './ToolbarTooltip';
10
12
  const styles = {
11
13
  scrollContainer: "_c71lnklw _18m91wug"
12
14
  };
@@ -20,25 +22,37 @@ export const ToolbarNestedDropdownMenu = ({
20
22
  dropdownTestId,
21
23
  enableMaxHeight = false,
22
24
  onClick,
23
- shouldFitContainer = false
25
+ shouldFitContainer = false,
26
+ shouldTitleWrap,
27
+ tooltipContent
24
28
  }) => {
25
29
  return /*#__PURE__*/React.createElement(DropdownMenu, {
26
30
  shouldFitContainer: shouldFitContainer,
27
31
  placement: "right-start",
28
32
  testId: dropdownTestId,
29
- trigger: triggerProps => /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
30
- elemBefore: elemBefore,
31
- elemAfter: elemAfter,
32
- isSelected: triggerProps.isSelected,
33
- onClick: e => {
34
- onClick && onClick(e);
35
- triggerProps.onClick && triggerProps.onClick(e);
36
- },
37
- testId: testId,
38
- triggerRef: triggerProps.triggerRef,
39
- hasNestedDropdownMenu: true,
40
- isDisabled: isDisabled
41
- }, text)
33
+ trigger: triggerProps => {
34
+ const item = /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
35
+ elemBefore: elemBefore,
36
+ elemAfter: elemAfter,
37
+ isSelected: triggerProps.isSelected,
38
+ onClick: e => {
39
+ onClick && onClick(e);
40
+ triggerProps.onClick && triggerProps.onClick(e);
41
+ },
42
+ testId: testId,
43
+ triggerRef: triggerProps.triggerRef,
44
+ hasNestedDropdownMenu: true,
45
+ isDisabled: isDisabled,
46
+ shouldTitleWrap: fg('platform_editor_block_menu_v2_patch_2') ? shouldTitleWrap : undefined
47
+ }, text);
48
+ if (tooltipContent && fg('platform_editor_block_menu_v2_patch_2')) {
49
+ return /*#__PURE__*/React.createElement(ToolbarTooltip, {
50
+ content: tooltipContent,
51
+ position: "top"
52
+ }, item);
53
+ }
54
+ return item;
55
+ }
42
56
  }, /*#__PURE__*/React.createElement(Box, {
43
57
  xcss: cx(enableMaxHeight && styles.scrollContainer),
44
58
  "data-toolbar-nested-dropdown-menu": true
@@ -5,8 +5,10 @@ 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';
11
+ import { ToolbarTooltip } from './ToolbarTooltip';
10
12
  var styles = {
11
13
  scrollContainer: "_c71lnklw _18m91wug"
12
14
  };
@@ -22,13 +24,15 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
22
24
  enableMaxHeight = _ref$enableMaxHeight === void 0 ? false : _ref$enableMaxHeight,
23
25
  _onClick = _ref.onClick,
24
26
  _ref$shouldFitContain = _ref.shouldFitContainer,
25
- shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain;
27
+ shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
28
+ shouldTitleWrap = _ref.shouldTitleWrap,
29
+ tooltipContent = _ref.tooltipContent;
26
30
  return /*#__PURE__*/React.createElement(DropdownMenu, {
27
31
  shouldFitContainer: shouldFitContainer,
28
32
  placement: "right-start",
29
33
  testId: dropdownTestId,
30
34
  trigger: function trigger(triggerProps) {
31
- return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
35
+ var item = /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
32
36
  elemBefore: elemBefore,
33
37
  elemAfter: elemAfter,
34
38
  isSelected: triggerProps.isSelected,
@@ -39,8 +43,16 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
39
43
  testId: testId,
40
44
  triggerRef: triggerProps.triggerRef,
41
45
  hasNestedDropdownMenu: true,
42
- isDisabled: isDisabled
46
+ isDisabled: isDisabled,
47
+ shouldTitleWrap: fg('platform_editor_block_menu_v2_patch_2') ? shouldTitleWrap : undefined
43
48
  }, text);
49
+ if (tooltipContent && fg('platform_editor_block_menu_v2_patch_2')) {
50
+ return /*#__PURE__*/React.createElement(ToolbarTooltip, {
51
+ content: tooltipContent,
52
+ position: "top"
53
+ }, item);
54
+ }
55
+ return item;
44
56
  }
45
57
  }, /*#__PURE__*/React.createElement(Box, {
46
58
  xcss: cx(enableMaxHeight && styles.scrollContainer),
@@ -15,8 +15,10 @@ type ToolbarNestedDropdownMenuProps = {
15
15
  isDisabled?: boolean;
16
16
  onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
17
17
  shouldFitContainer?: boolean;
18
+ shouldTitleWrap?: boolean;
18
19
  testId?: string;
19
20
  text?: string;
21
+ tooltipContent?: ReactNode;
20
22
  };
21
- export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
23
+ export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
22
24
  export {};
@@ -15,8 +15,10 @@ type ToolbarNestedDropdownMenuProps = {
15
15
  isDisabled?: boolean;
16
16
  onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
17
17
  shouldFitContainer?: boolean;
18
+ shouldTitleWrap?: boolean;
18
19
  testId?: string;
19
20
  text?: string;
21
+ tooltipContent?: ReactNode;
20
22
  };
21
- export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
23
+ export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
22
24
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "0.19.24",
6
+ "version": "0.19.25",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "team": "Editor: Jenga",
@@ -25,12 +25,12 @@
25
25
  "@atlaskit/browser-apis": "^0.0.1",
26
26
  "@atlaskit/css": "^0.19.0",
27
27
  "@atlaskit/dropdown-menu": "^16.4.0",
28
- "@atlaskit/icon": "^30.0.0",
29
- "@atlaskit/icon-lab": "^5.15.0",
28
+ "@atlaskit/icon": "^31.0.0",
29
+ "@atlaskit/icon-lab": "^5.16.0",
30
30
  "@atlaskit/platform-feature-flags": "^1.1.0",
31
31
  "@atlaskit/popup": "^4.13.0",
32
32
  "@atlaskit/primitives": "^18.0.0",
33
- "@atlaskit/tmp-editor-statsig": "^24.0.0",
33
+ "@atlaskit/tmp-editor-statsig": "^24.1.0",
34
34
  "@atlaskit/tokens": "^11.0.0",
35
35
  "@atlaskit/tooltip": "^20.14.0",
36
36
  "@babel/runtime": "^7.0.0",
@@ -83,6 +83,9 @@
83
83
  "platform-feature-flags": {
84
84
  "platform_editor_toolbar_highlight_bug_fix": {
85
85
  "type": "boolean"
86
+ },
87
+ "platform_editor_block_menu_v2_patch_2": {
88
+ "type": "boolean"
86
89
  }
87
90
  }
88
91
  }