@atlaskit/editor-plugin-toolbar 0.0.4 → 0.0.6
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 +19 -0
- package/dist/cjs/ui/SelectionToolbar/index.js +4 -1
- package/dist/cjs/ui/toolbar-components.js +10 -1
- package/dist/es2019/ui/SelectionToolbar/index.js +4 -1
- package/dist/es2019/ui/toolbar-components.js +10 -1
- package/dist/esm/ui/SelectionToolbar/index.js +4 -1
- package/dist/esm/ui/toolbar-components.js +10 -1
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#197019](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/197019)
|
|
8
|
+
[`96717455eea97`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/96717455eea97) -
|
|
9
|
+
Add background colour to Toolbar component in editor-toolbar, add EditorToolbarProvider to the
|
|
10
|
+
selection Toolbar
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 0.0.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#195899](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195899)
|
|
18
|
+
[`345c0b6478f73`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/345c0b6478f73) -
|
|
19
|
+
[ED-28682] Register text-section toolbar component
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 0.0.4
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SelectionToolbar = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
10
|
+
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
11
12
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
12
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -42,6 +43,8 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
42
43
|
onPositionCalculated: function onPositionCalculated(position) {
|
|
43
44
|
return (0, _utils.calculateToolbarPositionTrackHead)(_consts.TOOLBAR_LABEL)(editorView, position);
|
|
44
45
|
}
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarProvider, {
|
|
47
|
+
editorView: editorView
|
|
45
48
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbarModel.ToolbarModelRenderer, {
|
|
46
49
|
toolbar: toolbar,
|
|
47
50
|
components: components,
|
|
@@ -50,7 +53,7 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
50
53
|
menuSection: _editorToolbar.ToolbarDropdownItemSection,
|
|
51
54
|
group: _editorToolbar.ToolbarButtonGroup
|
|
52
55
|
}
|
|
53
|
-
}));
|
|
56
|
+
})));
|
|
54
57
|
};
|
|
55
58
|
var getDomRefFromSelection = function getDomRefFromSelection(view
|
|
56
59
|
// dispatchAnalyticsEvent?: DispatchAnalyticsEvent,
|
|
@@ -6,17 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getToolbarComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
9
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
10
11
|
var _consts = require("./consts");
|
|
11
12
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents() {
|
|
12
13
|
return [{
|
|
13
14
|
type: 'toolbar',
|
|
14
|
-
key:
|
|
15
|
+
key: _toolbar.TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
15
16
|
component: function component(_ref) {
|
|
16
17
|
var children = _ref.children;
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.Toolbar, {
|
|
18
19
|
label: _consts.TOOLBAR_LABEL
|
|
19
20
|
}, children);
|
|
20
21
|
}
|
|
22
|
+
}, {
|
|
23
|
+
type: 'section',
|
|
24
|
+
key: 'text-section',
|
|
25
|
+
parents: [{
|
|
26
|
+
type: 'toolbar',
|
|
27
|
+
key: 'inline-text-toolbar',
|
|
28
|
+
rank: 200
|
|
29
|
+
}]
|
|
21
30
|
}];
|
|
22
31
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
|
+
import { EditorToolbarProvider } from '@atlaskit/editor-common/toolbar';
|
|
3
4
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
4
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
5
6
|
import { calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
|
|
@@ -32,6 +33,8 @@ export const SelectionToolbar = ({
|
|
|
32
33
|
offset: [0, 10],
|
|
33
34
|
target: getDomRefFromSelection(editorView),
|
|
34
35
|
onPositionCalculated: position => calculateToolbarPositionTrackHead(TOOLBAR_LABEL)(editorView, position)
|
|
36
|
+
}, /*#__PURE__*/React.createElement(EditorToolbarProvider, {
|
|
37
|
+
editorView: editorView
|
|
35
38
|
}, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
|
|
36
39
|
toolbar: toolbar,
|
|
37
40
|
components: components,
|
|
@@ -40,7 +43,7 @@ export const SelectionToolbar = ({
|
|
|
40
43
|
menuSection: ToolbarDropdownItemSection,
|
|
41
44
|
group: ToolbarButtonGroup
|
|
42
45
|
}
|
|
43
|
-
}));
|
|
46
|
+
})));
|
|
44
47
|
};
|
|
45
48
|
const getDomRefFromSelection = (view
|
|
46
49
|
// dispatchAnalyticsEvent?: DispatchAnalyticsEvent,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
2
3
|
import { Toolbar } from '@atlaskit/editor-toolbar';
|
|
3
4
|
import { TOOLBAR_LABEL } from './consts';
|
|
4
5
|
export const getToolbarComponents = () => {
|
|
5
6
|
return [{
|
|
6
7
|
type: 'toolbar',
|
|
7
|
-
key:
|
|
8
|
+
key: TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
8
9
|
component: ({
|
|
9
10
|
children
|
|
10
11
|
}) => {
|
|
@@ -12,5 +13,13 @@ export const getToolbarComponents = () => {
|
|
|
12
13
|
label: TOOLBAR_LABEL
|
|
13
14
|
}, children);
|
|
14
15
|
}
|
|
16
|
+
}, {
|
|
17
|
+
type: 'section',
|
|
18
|
+
key: 'text-section',
|
|
19
|
+
parents: [{
|
|
20
|
+
type: 'toolbar',
|
|
21
|
+
key: 'inline-text-toolbar',
|
|
22
|
+
rank: 200
|
|
23
|
+
}]
|
|
15
24
|
}];
|
|
16
25
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
|
+
import { EditorToolbarProvider } from '@atlaskit/editor-common/toolbar';
|
|
3
4
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
4
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
5
6
|
import { calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
|
|
@@ -35,6 +36,8 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
35
36
|
onPositionCalculated: function onPositionCalculated(position) {
|
|
36
37
|
return calculateToolbarPositionTrackHead(TOOLBAR_LABEL)(editorView, position);
|
|
37
38
|
}
|
|
39
|
+
}, /*#__PURE__*/React.createElement(EditorToolbarProvider, {
|
|
40
|
+
editorView: editorView
|
|
38
41
|
}, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
|
|
39
42
|
toolbar: toolbar,
|
|
40
43
|
components: components,
|
|
@@ -43,7 +46,7 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
43
46
|
menuSection: ToolbarDropdownItemSection,
|
|
44
47
|
group: ToolbarButtonGroup
|
|
45
48
|
}
|
|
46
|
-
}));
|
|
49
|
+
})));
|
|
47
50
|
};
|
|
48
51
|
var getDomRefFromSelection = function getDomRefFromSelection(view
|
|
49
52
|
// dispatchAnalyticsEvent?: DispatchAnalyticsEvent,
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
2
3
|
import { Toolbar } from '@atlaskit/editor-toolbar';
|
|
3
4
|
import { TOOLBAR_LABEL } from './consts';
|
|
4
5
|
export var getToolbarComponents = function getToolbarComponents() {
|
|
5
6
|
return [{
|
|
6
7
|
type: 'toolbar',
|
|
7
|
-
key:
|
|
8
|
+
key: TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
8
9
|
component: function component(_ref) {
|
|
9
10
|
var children = _ref.children;
|
|
10
11
|
return /*#__PURE__*/React.createElement(Toolbar, {
|
|
11
12
|
label: TOOLBAR_LABEL
|
|
12
13
|
}, children);
|
|
13
14
|
}
|
|
15
|
+
}, {
|
|
16
|
+
type: 'section',
|
|
17
|
+
key: 'text-section',
|
|
18
|
+
parents: [{
|
|
19
|
+
type: 'toolbar',
|
|
20
|
+
key: 'inline-text-toolbar',
|
|
21
|
+
rank: 200
|
|
22
|
+
}]
|
|
14
23
|
}];
|
|
15
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,17 +34,14 @@
|
|
|
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.
|
|
38
|
-
"@atlaskit/editor-toolbar-model": "^0.0.
|
|
37
|
+
"@atlaskit/editor-toolbar": "^0.0.10",
|
|
38
|
+
"@atlaskit/editor-toolbar-model": "^0.0.4",
|
|
39
39
|
"@babel/runtime": "^7.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/editor-common": "^107.
|
|
42
|
+
"@atlaskit/editor-common": "^107.18.0",
|
|
43
43
|
"react": "^18.2.0"
|
|
44
44
|
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"typescript": "~5.4.2"
|
|
47
|
-
},
|
|
48
45
|
"techstack": {
|
|
49
46
|
"@atlassian/frontend": {
|
|
50
47
|
"code-structure": [
|