@atlaskit/editor-plugin-hyperlink 5.4.2 → 5.4.3

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,22 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 5.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3145f278b1f7a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3145f278b1f7a) -
8
+ [ux] [ED-28473] minor UI updates for editor-toolbar
9
+
10
+ - Use ADS ButtonGroup for ToolbarButtonGroup
11
+ - Remove groupLocation prop and use CSS instead
12
+ - Use DropdownItemGroup for ToolbarDropdownItemSection and expand props for section separator and
13
+ title
14
+ - Support ReactNode as content for ToolbarTooltip and add missing shortcuts in tooltips
15
+ - Center Icons for split buttons and make chevron icon 24px wide
16
+ - Align dropdown menu UI with current editor design
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 5.4.2
4
21
 
5
22
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.LinkButton = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
11
+ var _keymaps = require("@atlaskit/editor-common/keymaps");
11
12
  var _messages = require("@atlaskit/editor-common/messages");
12
13
  var _toolbar = require("@atlaskit/editor-common/toolbar");
13
14
  var _utils = require("@atlaskit/editor-common/utils");
@@ -27,18 +28,17 @@ var LinkButton = exports.LinkButton = function LinkButton(_ref) {
27
28
  api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.hyperlink.commands.showLinkToolbar(_analytics.INPUT_METHOD.FLOATING_TB));
28
29
  };
29
30
  var isEnabled = state !== null && state !== void 0 && state.selection ? (0, _utils.canLinkBeCreatedInRange)(state === null || state === void 0 ? void 0 : state.selection.from, state === null || state === void 0 ? void 0 : state.selection.to)(state) : false;
30
- return (
31
- /*#__PURE__*/
32
- // TODO: ED-28743 - add keyboard shortcut here
33
- _react.default.createElement(_editorToolbar.ToolbarTooltip, {
34
- content: formatMessage(_messages.toolbarInsertBlockMessages.link)
35
- }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButton, {
36
- iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.LinkIcon, {
37
- label: formatMessage(_messages.toolbarInsertBlockMessages.link)
38
- }),
39
- onClick: onClick,
40
- testId: 'editor-toolbar__link-button',
41
- isDisabled: !isEnabled
42
- }))
43
- );
31
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
32
+ content: /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
33
+ description: formatMessage(_messages.toolbarInsertBlockMessages.link),
34
+ keymap: _keymaps.addLink
35
+ })
36
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButton, {
37
+ iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.LinkIcon, {
38
+ label: formatMessage(_messages.toolbarInsertBlockMessages.link)
39
+ }),
40
+ onClick: onClick,
41
+ testId: 'editor-toolbar__link-button',
42
+ isDisabled: !isEnabled
43
+ }));
44
44
  };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
+ import { ToolTipContent, addLink } from '@atlaskit/editor-common/keymaps';
4
5
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
6
  import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
6
7
  import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
@@ -24,18 +25,17 @@ export const LinkButton = ({
24
25
  api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.hyperlink.commands.showLinkToolbar(INPUT_METHOD.FLOATING_TB));
25
26
  };
26
27
  const isEnabled = state !== null && state !== void 0 && state.selection ? canLinkBeCreatedInRange(state === null || state === void 0 ? void 0 : state.selection.from, state === null || state === void 0 ? void 0 : state.selection.to)(state) : false;
27
- return (
28
- /*#__PURE__*/
29
- // TODO: ED-28743 - add keyboard shortcut here
30
- React.createElement(ToolbarTooltip, {
31
- content: formatMessage(messages.link)
32
- }, /*#__PURE__*/React.createElement(ToolbarButton, {
33
- iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
34
- label: formatMessage(messages.link)
35
- }),
36
- onClick: onClick,
37
- testId: 'editor-toolbar__link-button',
38
- isDisabled: !isEnabled
39
- }))
40
- );
28
+ return /*#__PURE__*/React.createElement(ToolbarTooltip, {
29
+ content: /*#__PURE__*/React.createElement(ToolTipContent, {
30
+ description: formatMessage(messages.link),
31
+ keymap: addLink
32
+ })
33
+ }, /*#__PURE__*/React.createElement(ToolbarButton, {
34
+ iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
35
+ label: formatMessage(messages.link)
36
+ }),
37
+ onClick: onClick,
38
+ testId: 'editor-toolbar__link-button',
39
+ isDisabled: !isEnabled
40
+ }));
41
41
  };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
+ import { ToolTipContent, addLink } from '@atlaskit/editor-common/keymaps';
4
5
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
5
6
  import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
6
7
  import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
@@ -20,18 +21,17 @@ export var LinkButton = function LinkButton(_ref) {
20
21
  api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.hyperlink.commands.showLinkToolbar(INPUT_METHOD.FLOATING_TB));
21
22
  };
22
23
  var isEnabled = state !== null && state !== void 0 && state.selection ? canLinkBeCreatedInRange(state === null || state === void 0 ? void 0 : state.selection.from, state === null || state === void 0 ? void 0 : state.selection.to)(state) : false;
23
- return (
24
- /*#__PURE__*/
25
- // TODO: ED-28743 - add keyboard shortcut here
26
- React.createElement(ToolbarTooltip, {
27
- content: formatMessage(messages.link)
28
- }, /*#__PURE__*/React.createElement(ToolbarButton, {
29
- iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
30
- label: formatMessage(messages.link)
31
- }),
32
- onClick: onClick,
33
- testId: 'editor-toolbar__link-button',
34
- isDisabled: !isEnabled
35
- }))
36
- );
24
+ return /*#__PURE__*/React.createElement(ToolbarTooltip, {
25
+ content: /*#__PURE__*/React.createElement(ToolTipContent, {
26
+ description: formatMessage(messages.link),
27
+ keymap: addLink
28
+ })
29
+ }, /*#__PURE__*/React.createElement(ToolbarButton, {
30
+ iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
31
+ label: formatMessage(messages.link)
32
+ }),
33
+ onClick: onClick,
34
+ testId: 'editor-toolbar__link-button',
35
+ isDisabled: !isEnabled
36
+ }));
37
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "5.4.2",
3
+ "version": "5.4.3",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -47,13 +47,13 @@
47
47
  "@atlaskit/icon": "^27.12.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
49
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
50
- "@atlaskit/tmp-editor-statsig": "^9.28.0",
50
+ "@atlaskit/tmp-editor-statsig": "^9.29.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "@emotion/react": "^11.7.1",
53
53
  "uuid": "^3.1.0"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^107.23.0",
56
+ "@atlaskit/editor-common": "^107.24.0",
57
57
  "react": "^18.2.0",
58
58
  "react-dom": "^18.2.0",
59
59
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -61,7 +61,7 @@
61
61
  "devDependencies": {
62
62
  "@atlaskit/activity-provider": "^2.5.0",
63
63
  "@atlaskit/link-test-helpers": "^8.3.0",
64
- "@atlaskit/media-test-helpers": "^38.0.0",
64
+ "@atlaskit/media-test-helpers": "^39.0.0",
65
65
  "@atlaskit/ssr": "workspace:^",
66
66
  "@atlaskit/util-data-test": "^18.1.0",
67
67
  "@atlaskit/visual-regression": "workspace:^",