@atlaskit/editor-plugin-toolbar 0.0.6 → 0.1.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 +12 -0
- package/dist/cjs/ui/OverflowMenu.js +25 -0
- package/dist/cjs/ui/toolbar-components.js +29 -0
- package/dist/es2019/ui/OverflowMenu.js +19 -0
- package/dist/es2019/ui/toolbar-components.js +31 -1
- package/dist/esm/ui/OverflowMenu.js +18 -0
- package/dist/esm/ui/toolbar-components.js +30 -1
- package/dist/types/ui/OverflowMenu.d.ts +4 -0
- package/dist/types-ts4.5/ui/OverflowMenu.d.ts +4 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#196043](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/196043)
|
|
8
|
+
[`c6cb0ed855827`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6cb0ed855827) -
|
|
9
|
+
Add new ShowMoreHorizontal Icon, add new ranks to support overflow menu, add pin as a menu item
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.0.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OverflowMenu = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
|
+
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
12
|
+
var OverflowMenu = exports.OverflowMenu = function OverflowMenu(_ref) {
|
|
13
|
+
var children = _ref.children;
|
|
14
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
15
|
+
var tooltipContent = intl.formatMessage(_messages.toolbarMessages.selectionToolbarOverflowMenuTooltip);
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
17
|
+
content: tooltipContent,
|
|
18
|
+
position: "top"
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
|
|
20
|
+
label: tooltipContent,
|
|
21
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.ShowMoreHorizontalIcon, {
|
|
22
|
+
label: ""
|
|
23
|
+
})
|
|
24
|
+
}, children));
|
|
25
|
+
};
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
11
|
var _consts = require("./consts");
|
|
12
|
+
var _OverflowMenu = require("./OverflowMenu");
|
|
12
13
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents() {
|
|
13
14
|
return [{
|
|
14
15
|
type: 'toolbar',
|
|
@@ -27,5 +28,33 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
27
28
|
key: 'inline-text-toolbar',
|
|
28
29
|
rank: 200
|
|
29
30
|
}]
|
|
31
|
+
}, {
|
|
32
|
+
type: _toolbar.OVERFLOW_SECTION.type,
|
|
33
|
+
key: _toolbar.OVERFLOW_SECTION.key,
|
|
34
|
+
parents: [{
|
|
35
|
+
type: 'toolbar',
|
|
36
|
+
key: _toolbar.TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
37
|
+
rank: _toolbar.TOOLBAR_RANK[_toolbar.OVERFLOW_SECTION.key]
|
|
38
|
+
}]
|
|
39
|
+
}, {
|
|
40
|
+
type: _toolbar.OVERFLOW_GROUP.type,
|
|
41
|
+
key: _toolbar.OVERFLOW_GROUP.key,
|
|
42
|
+
parents: [{
|
|
43
|
+
type: _toolbar.OVERFLOW_SECTION.type,
|
|
44
|
+
key: _toolbar.OVERFLOW_SECTION.key,
|
|
45
|
+
rank: _toolbar.OVERFLOW_SECTION_RANK[_toolbar.OVERFLOW_GROUP.key]
|
|
46
|
+
}]
|
|
47
|
+
}, {
|
|
48
|
+
type: _toolbar.OVERFLOW_MENU.type,
|
|
49
|
+
key: _toolbar.OVERFLOW_MENU.key,
|
|
50
|
+
parents: [{
|
|
51
|
+
type: _toolbar.OVERFLOW_GROUP.type,
|
|
52
|
+
key: _toolbar.OVERFLOW_GROUP.key,
|
|
53
|
+
rank: _toolbar.OVERFLOW_GROUP_RANK[_toolbar.OVERFLOW_MENU.key]
|
|
54
|
+
}],
|
|
55
|
+
component: function component(_ref2) {
|
|
56
|
+
var children = _ref2.children;
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_OverflowMenu.OverflowMenu, null, children);
|
|
58
|
+
}
|
|
30
59
|
}];
|
|
31
60
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { ShowMoreHorizontalIcon, ToolbarDropdownMenu, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
5
|
+
export const OverflowMenu = ({
|
|
6
|
+
children
|
|
7
|
+
}) => {
|
|
8
|
+
const intl = useIntl();
|
|
9
|
+
const tooltipContent = intl.formatMessage(toolbarMessages.selectionToolbarOverflowMenuTooltip);
|
|
10
|
+
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
11
|
+
content: tooltipContent,
|
|
12
|
+
position: "top"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
|
|
14
|
+
label: tooltipContent,
|
|
15
|
+
iconBefore: /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
|
|
16
|
+
label: ""
|
|
17
|
+
})
|
|
18
|
+
}, children));
|
|
19
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
2
|
+
import { OVERFLOW_GROUP, OVERFLOW_GROUP_RANK, OVERFLOW_MENU, OVERFLOW_SECTION, OVERFLOW_SECTION_RANK, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { Toolbar } from '@atlaskit/editor-toolbar';
|
|
4
4
|
import { TOOLBAR_LABEL } from './consts';
|
|
5
|
+
import { OverflowMenu } from './OverflowMenu';
|
|
5
6
|
export const getToolbarComponents = () => {
|
|
6
7
|
return [{
|
|
7
8
|
type: 'toolbar',
|
|
@@ -21,5 +22,34 @@ export const getToolbarComponents = () => {
|
|
|
21
22
|
key: 'inline-text-toolbar',
|
|
22
23
|
rank: 200
|
|
23
24
|
}]
|
|
25
|
+
}, {
|
|
26
|
+
type: OVERFLOW_SECTION.type,
|
|
27
|
+
key: OVERFLOW_SECTION.key,
|
|
28
|
+
parents: [{
|
|
29
|
+
type: 'toolbar',
|
|
30
|
+
key: TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
31
|
+
rank: TOOLBAR_RANK[OVERFLOW_SECTION.key]
|
|
32
|
+
}]
|
|
33
|
+
}, {
|
|
34
|
+
type: OVERFLOW_GROUP.type,
|
|
35
|
+
key: OVERFLOW_GROUP.key,
|
|
36
|
+
parents: [{
|
|
37
|
+
type: OVERFLOW_SECTION.type,
|
|
38
|
+
key: OVERFLOW_SECTION.key,
|
|
39
|
+
rank: OVERFLOW_SECTION_RANK[OVERFLOW_GROUP.key]
|
|
40
|
+
}]
|
|
41
|
+
}, {
|
|
42
|
+
type: OVERFLOW_MENU.type,
|
|
43
|
+
key: OVERFLOW_MENU.key,
|
|
44
|
+
parents: [{
|
|
45
|
+
type: OVERFLOW_GROUP.type,
|
|
46
|
+
key: OVERFLOW_GROUP.key,
|
|
47
|
+
rank: OVERFLOW_GROUP_RANK[OVERFLOW_MENU.key]
|
|
48
|
+
}],
|
|
49
|
+
component: ({
|
|
50
|
+
children
|
|
51
|
+
}) => {
|
|
52
|
+
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
53
|
+
}
|
|
24
54
|
}];
|
|
25
55
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { ShowMoreHorizontalIcon, ToolbarDropdownMenu, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
5
|
+
export var OverflowMenu = function OverflowMenu(_ref) {
|
|
6
|
+
var children = _ref.children;
|
|
7
|
+
var intl = useIntl();
|
|
8
|
+
var tooltipContent = intl.formatMessage(toolbarMessages.selectionToolbarOverflowMenuTooltip);
|
|
9
|
+
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
10
|
+
content: tooltipContent,
|
|
11
|
+
position: "top"
|
|
12
|
+
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
|
|
13
|
+
label: tooltipContent,
|
|
14
|
+
iconBefore: /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
|
|
15
|
+
label: ""
|
|
16
|
+
})
|
|
17
|
+
}, children));
|
|
18
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
2
|
+
import { OVERFLOW_GROUP, OVERFLOW_GROUP_RANK, OVERFLOW_MENU, OVERFLOW_SECTION, OVERFLOW_SECTION_RANK, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { Toolbar } from '@atlaskit/editor-toolbar';
|
|
4
4
|
import { TOOLBAR_LABEL } from './consts';
|
|
5
|
+
import { OverflowMenu } from './OverflowMenu';
|
|
5
6
|
export var getToolbarComponents = function getToolbarComponents() {
|
|
6
7
|
return [{
|
|
7
8
|
type: 'toolbar',
|
|
@@ -20,5 +21,33 @@ export var getToolbarComponents = function getToolbarComponents() {
|
|
|
20
21
|
key: 'inline-text-toolbar',
|
|
21
22
|
rank: 200
|
|
22
23
|
}]
|
|
24
|
+
}, {
|
|
25
|
+
type: OVERFLOW_SECTION.type,
|
|
26
|
+
key: OVERFLOW_SECTION.key,
|
|
27
|
+
parents: [{
|
|
28
|
+
type: 'toolbar',
|
|
29
|
+
key: TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
30
|
+
rank: TOOLBAR_RANK[OVERFLOW_SECTION.key]
|
|
31
|
+
}]
|
|
32
|
+
}, {
|
|
33
|
+
type: OVERFLOW_GROUP.type,
|
|
34
|
+
key: OVERFLOW_GROUP.key,
|
|
35
|
+
parents: [{
|
|
36
|
+
type: OVERFLOW_SECTION.type,
|
|
37
|
+
key: OVERFLOW_SECTION.key,
|
|
38
|
+
rank: OVERFLOW_SECTION_RANK[OVERFLOW_GROUP.key]
|
|
39
|
+
}]
|
|
40
|
+
}, {
|
|
41
|
+
type: OVERFLOW_MENU.type,
|
|
42
|
+
key: OVERFLOW_MENU.key,
|
|
43
|
+
parents: [{
|
|
44
|
+
type: OVERFLOW_GROUP.type,
|
|
45
|
+
key: OVERFLOW_GROUP.key,
|
|
46
|
+
rank: OVERFLOW_GROUP_RANK[OVERFLOW_MENU.key]
|
|
47
|
+
}],
|
|
48
|
+
component: function component(_ref2) {
|
|
49
|
+
var children = _ref2.children;
|
|
50
|
+
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
51
|
+
}
|
|
23
52
|
}];
|
|
24
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,12 +34,13 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-selection": "^3.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-user-intent": "^1.1.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
37
|
-
"@atlaskit/editor-toolbar": "^0.0
|
|
37
|
+
"@atlaskit/editor-toolbar": "^0.1.0",
|
|
38
38
|
"@atlaskit/editor-toolbar-model": "^0.0.4",
|
|
39
|
-
"@babel/runtime": "^7.0.0"
|
|
39
|
+
"@babel/runtime": "^7.0.0",
|
|
40
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/editor-common": "^107.
|
|
43
|
+
"@atlaskit/editor-common": "^107.19.0",
|
|
43
44
|
"react": "^18.2.0"
|
|
44
45
|
},
|
|
45
46
|
"techstack": {
|