@atlaskit/editor-plugin-toolbar 0.4.3 → 0.4.5
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 +14 -0
- package/dist/cjs/ui/OverflowSection.js +24 -0
- package/dist/cjs/ui/toolbar-components.js +39 -1
- package/dist/es2019/ui/OverflowSection.js +19 -0
- package/dist/es2019/ui/toolbar-components.js +42 -2
- package/dist/esm/ui/OverflowSection.js +17 -0
- package/dist/esm/ui/toolbar-components.js +40 -2
- package/dist/types/ui/OverflowSection.d.ts +6 -0
- package/dist/types/ui/SelectionToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/OverflowSection.d.ts +6 -0
- package/dist/types-ts4.5/ui/SelectionToolbar/index.d.ts +1 -1
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4ef462fecb522`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4ef462fecb522) -
|
|
8
|
+
[ux] [ED-29003] Register loom component as a dropdown menu item in overflow menu
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.4.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 0.4.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OverflowSection = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
|
+
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
|
+
var OverflowSection = exports.OverflowSection = function OverflowSection(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
hasSeparator = _ref.hasSeparator,
|
|
14
|
+
testId = _ref.testId;
|
|
15
|
+
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
16
|
+
editorAppearance = _useEditorToolbar.editorAppearance;
|
|
17
|
+
if (editorAppearance === 'full-page') {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarSection, {
|
|
21
|
+
hasSeparator: hasSeparator,
|
|
22
|
+
testId: testId
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
@@ -8,11 +8,13 @@ exports.getToolbarComponents = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
12
|
var _consts = require("./consts");
|
|
12
13
|
var _OverflowMenu = require("./OverflowMenu");
|
|
14
|
+
var _OverflowSection = require("./OverflowSection");
|
|
13
15
|
var _Section = require("./Section");
|
|
14
16
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api, disableSelectionToolbar) {
|
|
15
|
-
|
|
17
|
+
var components = [{
|
|
16
18
|
type: 'toolbar',
|
|
17
19
|
key: _toolbar.TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
18
20
|
component: function component(_ref) {
|
|
@@ -130,4 +132,40 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
130
132
|
rank: _toolbar.TOOLBAR_RANK[_toolbar.PIN_SECTION.key]
|
|
131
133
|
}]
|
|
132
134
|
}];
|
|
135
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_migrate_loom', 'isEnabled', true)) {
|
|
136
|
+
components.push({
|
|
137
|
+
type: _toolbar.OVERFLOW_SECTION_PRIMARY_TOOLBAR.type,
|
|
138
|
+
key: _toolbar.OVERFLOW_SECTION_PRIMARY_TOOLBAR.key,
|
|
139
|
+
parents: [{
|
|
140
|
+
type: 'toolbar',
|
|
141
|
+
key: _toolbar.TOOLBARS.PRIMARY_TOOLBAR,
|
|
142
|
+
rank: _toolbar.TOOLBAR_RANK[_toolbar.OVERFLOW_SECTION_PRIMARY_TOOLBAR.key]
|
|
143
|
+
}],
|
|
144
|
+
component: function component(_ref7) {
|
|
145
|
+
var children = _ref7.children;
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(_OverflowSection.OverflowSection, null, children);
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
type: _toolbar.OVERFLOW_GROUP_PRIMARY_TOOLBAR.type,
|
|
150
|
+
key: _toolbar.OVERFLOW_GROUP_PRIMARY_TOOLBAR.key,
|
|
151
|
+
parents: [{
|
|
152
|
+
type: _toolbar.OVERFLOW_SECTION_PRIMARY_TOOLBAR.type,
|
|
153
|
+
key: _toolbar.OVERFLOW_SECTION_PRIMARY_TOOLBAR.key,
|
|
154
|
+
rank: _toolbar.OVERFLOW_SECTION_PRIMARY_TOOLBAR_RANK[_toolbar.OVERFLOW_GROUP_PRIMARY_TOOLBAR.key]
|
|
155
|
+
}]
|
|
156
|
+
}, {
|
|
157
|
+
type: _toolbar.OVERFLOW_MENU_PRIMARY_TOOLBAR.type,
|
|
158
|
+
key: _toolbar.OVERFLOW_MENU_PRIMARY_TOOLBAR.key,
|
|
159
|
+
parents: [{
|
|
160
|
+
type: _toolbar.OVERFLOW_GROUP_PRIMARY_TOOLBAR.type,
|
|
161
|
+
key: _toolbar.OVERFLOW_GROUP_PRIMARY_TOOLBAR.key,
|
|
162
|
+
rank: _toolbar.OVERFLOW_GROUP_PRIMARY_TOOLBAR_RANK[_toolbar.OVERFLOW_MENU_PRIMARY_TOOLBAR.key]
|
|
163
|
+
}],
|
|
164
|
+
component: function component(_ref8) {
|
|
165
|
+
var children = _ref8.children;
|
|
166
|
+
return /*#__PURE__*/_react.default.createElement(_OverflowMenu.OverflowMenu, null, children);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return components;
|
|
133
171
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
export const OverflowSection = ({
|
|
5
|
+
children,
|
|
6
|
+
hasSeparator,
|
|
7
|
+
testId
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
editorAppearance
|
|
11
|
+
} = useEditorToolbar();
|
|
12
|
+
if (editorAppearance === 'full-page') {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return /*#__PURE__*/React.createElement(ToolbarSection, {
|
|
16
|
+
hasSeparator: hasSeparator,
|
|
17
|
+
testId: testId
|
|
18
|
+
}, children);
|
|
19
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { INSERT_BLOCK_SECTION, LINKING_SECTION, OVERFLOW_GROUP, OVERFLOW_GROUP_RANK, OVERFLOW_MENU, OVERFLOW_SECTION, OVERFLOW_SECTION_RANK, PIN_SECTION, TEXT_SECTION, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
2
|
+
import { INSERT_BLOCK_SECTION, LINKING_SECTION, OVERFLOW_GROUP, OVERFLOW_GROUP_PRIMARY_TOOLBAR, OVERFLOW_GROUP_PRIMARY_TOOLBAR_RANK, OVERFLOW_GROUP_RANK, OVERFLOW_MENU, OVERFLOW_MENU_PRIMARY_TOOLBAR, OVERFLOW_SECTION, OVERFLOW_SECTION_PRIMARY_TOOLBAR, OVERFLOW_SECTION_PRIMARY_TOOLBAR_RANK, OVERFLOW_SECTION_RANK, PIN_SECTION, TEXT_SECTION, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { PrimaryToolbar, Toolbar } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
import { SELECTION_TOOLBAR_LABEL } from './consts';
|
|
5
6
|
import { OverflowMenu } from './OverflowMenu';
|
|
7
|
+
import { OverflowSection } from './OverflowSection';
|
|
6
8
|
import { Section } from './Section';
|
|
7
9
|
export const getToolbarComponents = (api, disableSelectionToolbar) => {
|
|
8
|
-
|
|
10
|
+
const components = [{
|
|
9
11
|
type: 'toolbar',
|
|
10
12
|
key: TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
11
13
|
component: ({
|
|
@@ -123,4 +125,42 @@ export const getToolbarComponents = (api, disableSelectionToolbar) => {
|
|
|
123
125
|
rank: TOOLBAR_RANK[PIN_SECTION.key]
|
|
124
126
|
}]
|
|
125
127
|
}];
|
|
128
|
+
if (expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true)) {
|
|
129
|
+
components.push({
|
|
130
|
+
type: OVERFLOW_SECTION_PRIMARY_TOOLBAR.type,
|
|
131
|
+
key: OVERFLOW_SECTION_PRIMARY_TOOLBAR.key,
|
|
132
|
+
parents: [{
|
|
133
|
+
type: 'toolbar',
|
|
134
|
+
key: TOOLBARS.PRIMARY_TOOLBAR,
|
|
135
|
+
rank: TOOLBAR_RANK[OVERFLOW_SECTION_PRIMARY_TOOLBAR.key]
|
|
136
|
+
}],
|
|
137
|
+
component: ({
|
|
138
|
+
children
|
|
139
|
+
}) => {
|
|
140
|
+
return /*#__PURE__*/React.createElement(OverflowSection, null, children);
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
type: OVERFLOW_GROUP_PRIMARY_TOOLBAR.type,
|
|
144
|
+
key: OVERFLOW_GROUP_PRIMARY_TOOLBAR.key,
|
|
145
|
+
parents: [{
|
|
146
|
+
type: OVERFLOW_SECTION_PRIMARY_TOOLBAR.type,
|
|
147
|
+
key: OVERFLOW_SECTION_PRIMARY_TOOLBAR.key,
|
|
148
|
+
rank: OVERFLOW_SECTION_PRIMARY_TOOLBAR_RANK[OVERFLOW_GROUP_PRIMARY_TOOLBAR.key]
|
|
149
|
+
}]
|
|
150
|
+
}, {
|
|
151
|
+
type: OVERFLOW_MENU_PRIMARY_TOOLBAR.type,
|
|
152
|
+
key: OVERFLOW_MENU_PRIMARY_TOOLBAR.key,
|
|
153
|
+
parents: [{
|
|
154
|
+
type: OVERFLOW_GROUP_PRIMARY_TOOLBAR.type,
|
|
155
|
+
key: OVERFLOW_GROUP_PRIMARY_TOOLBAR.key,
|
|
156
|
+
rank: OVERFLOW_GROUP_PRIMARY_TOOLBAR_RANK[OVERFLOW_MENU_PRIMARY_TOOLBAR.key]
|
|
157
|
+
}],
|
|
158
|
+
component: ({
|
|
159
|
+
children
|
|
160
|
+
}) => {
|
|
161
|
+
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return components;
|
|
126
166
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
export var OverflowSection = function OverflowSection(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
hasSeparator = _ref.hasSeparator,
|
|
7
|
+
testId = _ref.testId;
|
|
8
|
+
var _useEditorToolbar = useEditorToolbar(),
|
|
9
|
+
editorAppearance = _useEditorToolbar.editorAppearance;
|
|
10
|
+
if (editorAppearance === 'full-page') {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/React.createElement(ToolbarSection, {
|
|
14
|
+
hasSeparator: hasSeparator,
|
|
15
|
+
testId: testId
|
|
16
|
+
}, children);
|
|
17
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { INSERT_BLOCK_SECTION, LINKING_SECTION, OVERFLOW_GROUP, OVERFLOW_GROUP_RANK, OVERFLOW_MENU, OVERFLOW_SECTION, OVERFLOW_SECTION_RANK, PIN_SECTION, TEXT_SECTION, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
2
|
+
import { INSERT_BLOCK_SECTION, LINKING_SECTION, OVERFLOW_GROUP, OVERFLOW_GROUP_PRIMARY_TOOLBAR, OVERFLOW_GROUP_PRIMARY_TOOLBAR_RANK, OVERFLOW_GROUP_RANK, OVERFLOW_MENU, OVERFLOW_MENU_PRIMARY_TOOLBAR, OVERFLOW_SECTION, OVERFLOW_SECTION_PRIMARY_TOOLBAR, OVERFLOW_SECTION_PRIMARY_TOOLBAR_RANK, OVERFLOW_SECTION_RANK, PIN_SECTION, TEXT_SECTION, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { PrimaryToolbar, Toolbar } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
import { SELECTION_TOOLBAR_LABEL } from './consts';
|
|
5
6
|
import { OverflowMenu } from './OverflowMenu';
|
|
7
|
+
import { OverflowSection } from './OverflowSection';
|
|
6
8
|
import { Section } from './Section';
|
|
7
9
|
export var getToolbarComponents = function getToolbarComponents(api, disableSelectionToolbar) {
|
|
8
|
-
|
|
10
|
+
var components = [{
|
|
9
11
|
type: 'toolbar',
|
|
10
12
|
key: TOOLBARS.INLINE_TEXT_TOOLBAR,
|
|
11
13
|
component: function component(_ref) {
|
|
@@ -123,4 +125,40 @@ export var getToolbarComponents = function getToolbarComponents(api, disableSele
|
|
|
123
125
|
rank: TOOLBAR_RANK[PIN_SECTION.key]
|
|
124
126
|
}]
|
|
125
127
|
}];
|
|
128
|
+
if (expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true)) {
|
|
129
|
+
components.push({
|
|
130
|
+
type: OVERFLOW_SECTION_PRIMARY_TOOLBAR.type,
|
|
131
|
+
key: OVERFLOW_SECTION_PRIMARY_TOOLBAR.key,
|
|
132
|
+
parents: [{
|
|
133
|
+
type: 'toolbar',
|
|
134
|
+
key: TOOLBARS.PRIMARY_TOOLBAR,
|
|
135
|
+
rank: TOOLBAR_RANK[OVERFLOW_SECTION_PRIMARY_TOOLBAR.key]
|
|
136
|
+
}],
|
|
137
|
+
component: function component(_ref7) {
|
|
138
|
+
var children = _ref7.children;
|
|
139
|
+
return /*#__PURE__*/React.createElement(OverflowSection, null, children);
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
type: OVERFLOW_GROUP_PRIMARY_TOOLBAR.type,
|
|
143
|
+
key: OVERFLOW_GROUP_PRIMARY_TOOLBAR.key,
|
|
144
|
+
parents: [{
|
|
145
|
+
type: OVERFLOW_SECTION_PRIMARY_TOOLBAR.type,
|
|
146
|
+
key: OVERFLOW_SECTION_PRIMARY_TOOLBAR.key,
|
|
147
|
+
rank: OVERFLOW_SECTION_PRIMARY_TOOLBAR_RANK[OVERFLOW_GROUP_PRIMARY_TOOLBAR.key]
|
|
148
|
+
}]
|
|
149
|
+
}, {
|
|
150
|
+
type: OVERFLOW_MENU_PRIMARY_TOOLBAR.type,
|
|
151
|
+
key: OVERFLOW_MENU_PRIMARY_TOOLBAR.key,
|
|
152
|
+
parents: [{
|
|
153
|
+
type: OVERFLOW_GROUP_PRIMARY_TOOLBAR.type,
|
|
154
|
+
key: OVERFLOW_GROUP_PRIMARY_TOOLBAR.key,
|
|
155
|
+
rank: OVERFLOW_GROUP_PRIMARY_TOOLBAR_RANK[OVERFLOW_MENU_PRIMARY_TOOLBAR.key]
|
|
156
|
+
}],
|
|
157
|
+
component: function component(_ref8) {
|
|
158
|
+
var children = _ref8.children;
|
|
159
|
+
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return components;
|
|
126
164
|
};
|
|
@@ -8,5 +8,5 @@ type SelectionToolbarProps = {
|
|
|
8
8
|
mountPoint: HTMLElement | undefined;
|
|
9
9
|
disableSelectionToolbarWhenPinned: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const SelectionToolbar: ({ api, editorView, mountPoint, disableSelectionToolbarWhenPinned }: SelectionToolbarProps) => React.JSX.Element | null;
|
|
11
|
+
export declare const SelectionToolbar: ({ api, editorView, mountPoint, disableSelectionToolbarWhenPinned, }: SelectionToolbarProps) => React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -8,5 +8,5 @@ type SelectionToolbarProps = {
|
|
|
8
8
|
mountPoint: HTMLElement | undefined;
|
|
9
9
|
disableSelectionToolbarWhenPinned: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const SelectionToolbar: ({ api, editorView, mountPoint, disableSelectionToolbarWhenPinned }: SelectionToolbarProps) => React.JSX.Element | null;
|
|
11
|
+
export declare const SelectionToolbar: ({ api, editorView, mountPoint, disableSelectionToolbarWhenPinned, }: SelectionToolbarProps) => React.JSX.Element | null;
|
|
12
12
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,9 +27,6 @@
|
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
|
-
"af:exports": {
|
|
31
|
-
".": "./src/index.ts"
|
|
32
|
-
},
|
|
33
30
|
"dependencies": {
|
|
34
31
|
"@atlaskit/editor-plugin-connectivity": "^3.1.0",
|
|
35
32
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
@@ -37,15 +34,15 @@
|
|
|
37
34
|
"@atlaskit/editor-plugin-user-intent": "^1.1.0",
|
|
38
35
|
"@atlaskit/editor-plugin-user-preferences": "^1.2.0",
|
|
39
36
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
40
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
37
|
+
"@atlaskit/editor-toolbar": "^0.5.0",
|
|
41
38
|
"@atlaskit/editor-toolbar-model": "^0.1.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^11.9.0",
|
|
43
40
|
"@babel/runtime": "^7.0.0",
|
|
44
41
|
"bind-event-listener": "^3.0.0",
|
|
45
42
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
46
43
|
},
|
|
47
44
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^107.
|
|
45
|
+
"@atlaskit/editor-common": "^107.33.0",
|
|
49
46
|
"react": "^18.2.0"
|
|
50
47
|
},
|
|
51
48
|
"techstack": {
|