@atlaskit/editor-plugin-hyperlink 5.4.8 → 5.4.10

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,24 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 5.4.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 5.4.9
10
+
11
+ ### Patch Changes
12
+
13
+ - [`286abb4d35eba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/286abb4d35eba) -
14
+ [ux] [ED-28960] Finish full page primary toolbar migration
15
+
16
+ - Align with design update (separator, gap, height, icon size)
17
+ - Add keyboard shortcut to focus toolbar and arrow key navigation
18
+ - Address accessibility
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 5.4.8
4
23
 
5
24
  ### Patch Changes
@@ -35,7 +35,8 @@ var LinkButton = exports.LinkButton = function LinkButton(_ref) {
35
35
  })
36
36
  }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButton, {
37
37
  iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.LinkIcon, {
38
- label: formatMessage(_messages.toolbarInsertBlockMessages.link)
38
+ label: formatMessage(_messages.toolbarInsertBlockMessages.link),
39
+ size: "small"
39
40
  }),
40
41
  onClick: onClick,
41
42
  testId: 'editor-toolbar__link-button',
@@ -8,29 +8,8 @@ exports.getToolbarComponents = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _toolbar = require("@atlaskit/editor-common/toolbar");
10
10
  var _LinkButton = require("./toolbar/LinkButton");
11
- var _LinkSection = require("./toolbar/LinkSection");
12
11
  var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api) {
13
12
  var toolbarComponents = [{
14
- type: _toolbar.LINKING_SECTION.type,
15
- key: _toolbar.LINKING_SECTION.key,
16
- parents: [{
17
- type: 'toolbar',
18
- key: _toolbar.TOOLBARS.INLINE_TEXT_TOOLBAR,
19
- rank: _toolbar.TOOLBAR_RANK[_toolbar.LINKING_SECTION.key]
20
- }, {
21
- type: 'toolbar',
22
- key: _toolbar.TOOLBARS.PRIMARY_TOOLBAR,
23
- rank: _toolbar.TOOLBAR_RANK[_toolbar.LINKING_SECTION.key]
24
- }],
25
- component: function component(_ref) {
26
- var children = _ref.children,
27
- parents = _ref.parents;
28
- return /*#__PURE__*/_react.default.createElement(_LinkSection.LinkSection, {
29
- parents: parents,
30
- api: api
31
- }, children);
32
- }
33
- }, {
34
13
  type: _toolbar.LINKING_GROUP.type,
35
14
  key: _toolbar.LINKING_GROUP.key,
36
15
  parents: [{
@@ -32,7 +32,8 @@ export const LinkButton = ({
32
32
  })
33
33
  }, /*#__PURE__*/React.createElement(ToolbarButton, {
34
34
  iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
35
- label: formatMessage(messages.link)
35
+ label: formatMessage(messages.link),
36
+ size: "small"
36
37
  }),
37
38
  onClick: onClick,
38
39
  testId: 'editor-toolbar__link-button',
@@ -1,30 +1,8 @@
1
1
  import React from 'react';
2
- import { LINKING_BUTTON, LINKING_GROUP, LINKING_GROUP_RANK, LINKING_SECTION, LINKING_SECTION_RANK, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
2
+ import { LINKING_BUTTON, LINKING_GROUP, LINKING_GROUP_RANK, LINKING_SECTION, LINKING_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
3
3
  import { LinkButton } from './toolbar/LinkButton';
4
- import { LinkSection } from './toolbar/LinkSection';
5
4
  export const getToolbarComponents = api => {
6
5
  const toolbarComponents = [{
7
- type: LINKING_SECTION.type,
8
- key: LINKING_SECTION.key,
9
- parents: [{
10
- type: 'toolbar',
11
- key: TOOLBARS.INLINE_TEXT_TOOLBAR,
12
- rank: TOOLBAR_RANK[LINKING_SECTION.key]
13
- }, {
14
- type: 'toolbar',
15
- key: TOOLBARS.PRIMARY_TOOLBAR,
16
- rank: TOOLBAR_RANK[LINKING_SECTION.key]
17
- }],
18
- component: ({
19
- children,
20
- parents
21
- }) => {
22
- return /*#__PURE__*/React.createElement(LinkSection, {
23
- parents: parents,
24
- api: api
25
- }, children);
26
- }
27
- }, {
28
6
  type: LINKING_GROUP.type,
29
7
  key: LINKING_GROUP.key,
30
8
  parents: [{
@@ -28,7 +28,8 @@ export var LinkButton = function LinkButton(_ref) {
28
28
  })
29
29
  }, /*#__PURE__*/React.createElement(ToolbarButton, {
30
30
  iconBefore: /*#__PURE__*/React.createElement(LinkIcon, {
31
- label: formatMessage(messages.link)
31
+ label: formatMessage(messages.link),
32
+ size: "small"
32
33
  }),
33
34
  onClick: onClick,
34
35
  testId: 'editor-toolbar__link-button',
@@ -1,29 +1,8 @@
1
1
  import React from 'react';
2
- import { LINKING_BUTTON, LINKING_GROUP, LINKING_GROUP_RANK, LINKING_SECTION, LINKING_SECTION_RANK, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
2
+ import { LINKING_BUTTON, LINKING_GROUP, LINKING_GROUP_RANK, LINKING_SECTION, LINKING_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
3
3
  import { LinkButton } from './toolbar/LinkButton';
4
- import { LinkSection } from './toolbar/LinkSection';
5
4
  export var getToolbarComponents = function getToolbarComponents(api) {
6
5
  var toolbarComponents = [{
7
- type: LINKING_SECTION.type,
8
- key: LINKING_SECTION.key,
9
- parents: [{
10
- type: 'toolbar',
11
- key: TOOLBARS.INLINE_TEXT_TOOLBAR,
12
- rank: TOOLBAR_RANK[LINKING_SECTION.key]
13
- }, {
14
- type: 'toolbar',
15
- key: TOOLBARS.PRIMARY_TOOLBAR,
16
- rank: TOOLBAR_RANK[LINKING_SECTION.key]
17
- }],
18
- component: function component(_ref) {
19
- var children = _ref.children,
20
- parents = _ref.parents;
21
- return /*#__PURE__*/React.createElement(LinkSection, {
22
- parents: parents,
23
- api: api
24
- }, children);
25
- }
26
- }, {
27
6
  type: LINKING_GROUP.type,
28
7
  key: LINKING_GROUP.key,
29
8
  parents: [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "5.4.8",
3
+ "version": "5.4.10",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -40,20 +40,20 @@
40
40
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
41
41
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
42
42
  "@atlaskit/editor-plugin-selection-toolbar": "^4.3.0",
43
- "@atlaskit/editor-plugin-toolbar": "^0.3.0",
43
+ "@atlaskit/editor-plugin-toolbar": "^0.4.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
45
45
  "@atlaskit/editor-toolbar": "^0.3.0",
46
46
  "@atlaskit/editor-toolbar-model": "^0.1.0",
47
47
  "@atlaskit/icon": "^28.0.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
49
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
50
- "@atlaskit/tmp-editor-statsig": "^11.3.0",
50
+ "@atlaskit/tmp-editor-statsig": "^11.5.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.26.0",
56
+ "@atlaskit/editor-common": "^107.28.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"
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.LinkSection = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _toolbar = require("@atlaskit/editor-common/toolbar");
10
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
11
- var _editorToolbar = require("@atlaskit/editor-toolbar");
12
- var shouldShowLinkSection = function shouldShowLinkSection(editMode, toolbar, toolbarDocking) {
13
- if (editMode === 'view') {
14
- return false;
15
- }
16
- if ((toolbar === null || toolbar === void 0 ? void 0 : toolbar.key) === _toolbar.TOOLBARS.INLINE_TEXT_TOOLBAR && toolbarDocking !== 'top') {
17
- return true;
18
- }
19
- if ((toolbar === null || toolbar === void 0 ? void 0 : toolbar.key) === _toolbar.TOOLBARS.PRIMARY_TOOLBAR && toolbarDocking !== 'none') {
20
- return true;
21
- }
22
- return false;
23
- };
24
- var LinkSection = exports.LinkSection = function LinkSection(_ref) {
25
- var children = _ref.children,
26
- parents = _ref.parents,
27
- api = _ref.api;
28
- var editMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
29
- var toolbarDocking = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'userPreferences.preferences.toolbarDockingPosition');
30
- var toolbar = parents.find(function (parent) {
31
- return parent.type === 'toolbar';
32
- });
33
- if (!shouldShowLinkSection(editMode, toolbar, toolbarDocking)) {
34
- return null;
35
- }
36
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarSection, null, children);
37
- };
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
3
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
4
- import { ToolbarSection } from '@atlaskit/editor-toolbar';
5
- const shouldShowLinkSection = (editMode, toolbar, toolbarDocking) => {
6
- if (editMode === 'view') {
7
- return false;
8
- }
9
- if ((toolbar === null || toolbar === void 0 ? void 0 : toolbar.key) === TOOLBARS.INLINE_TEXT_TOOLBAR && toolbarDocking !== 'top') {
10
- return true;
11
- }
12
- if ((toolbar === null || toolbar === void 0 ? void 0 : toolbar.key) === TOOLBARS.PRIMARY_TOOLBAR && toolbarDocking !== 'none') {
13
- return true;
14
- }
15
- return false;
16
- };
17
- export const LinkSection = ({
18
- children,
19
- parents,
20
- api
21
- }) => {
22
- const editMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
23
- const toolbarDocking = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
24
- const toolbar = parents.find(parent => parent.type === 'toolbar');
25
- if (!shouldShowLinkSection(editMode, toolbar, toolbarDocking)) {
26
- return null;
27
- }
28
- return /*#__PURE__*/React.createElement(ToolbarSection, null, children);
29
- };
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
3
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
4
- import { ToolbarSection } from '@atlaskit/editor-toolbar';
5
- var shouldShowLinkSection = function shouldShowLinkSection(editMode, toolbar, toolbarDocking) {
6
- if (editMode === 'view') {
7
- return false;
8
- }
9
- if ((toolbar === null || toolbar === void 0 ? void 0 : toolbar.key) === TOOLBARS.INLINE_TEXT_TOOLBAR && toolbarDocking !== 'top') {
10
- return true;
11
- }
12
- if ((toolbar === null || toolbar === void 0 ? void 0 : toolbar.key) === TOOLBARS.PRIMARY_TOOLBAR && toolbarDocking !== 'none') {
13
- return true;
14
- }
15
- return false;
16
- };
17
- export var LinkSection = function LinkSection(_ref) {
18
- var children = _ref.children,
19
- parents = _ref.parents,
20
- api = _ref.api;
21
- var editMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
22
- var toolbarDocking = useSharedPluginStateSelector(api, 'userPreferences.preferences.toolbarDockingPosition');
23
- var toolbar = parents.find(function (parent) {
24
- return parent.type === 'toolbar';
25
- });
26
- if (!shouldShowLinkSection(editMode, toolbar, toolbarDocking)) {
27
- return null;
28
- }
29
- return /*#__PURE__*/React.createElement(ToolbarSection, null, children);
30
- };
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model';
4
- import type { HyperlinkPlugin } from '../../hyperlinkPluginType';
5
- type LinkSectionProps = {
6
- children: React.ReactNode;
7
- parents: ToolbarComponentTypes;
8
- api?: ExtractInjectionAPI<HyperlinkPlugin>;
9
- };
10
- export declare const LinkSection: ({ children, parents, api }: LinkSectionProps) => React.JSX.Element | null;
11
- export {};
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model';
4
- import type { HyperlinkPlugin } from '../../hyperlinkPluginType';
5
- type LinkSectionProps = {
6
- children: React.ReactNode;
7
- parents: ToolbarComponentTypes;
8
- api?: ExtractInjectionAPI<HyperlinkPlugin>;
9
- };
10
- export declare const LinkSection: ({ children, parents, api }: LinkSectionProps) => React.JSX.Element | null;
11
- export {};