@atlaskit/editor-plugin-toolbar 3.4.15 → 3.4.16
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 +9 -0
- package/dist/cjs/ui/OverflowMenuSection.js +21 -0
- package/dist/cjs/ui/toolbar-components.js +11 -1
- package/dist/es2019/ui/OverflowMenuSection.js +16 -0
- package/dist/es2019/ui/toolbar-components.js +12 -2
- package/dist/esm/ui/OverflowMenuSection.js +14 -0
- package/dist/esm/ui/toolbar-components.js +12 -2
- package/dist/types/ui/OverflowMenuSection.d.ts +6 -0
- package/dist/types-ts4.5/ui/OverflowMenuSection.d.ts +6 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.4.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5baa955ebe237`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5baa955ebe237) -
|
|
8
|
+
Add new menu section for all extensions (inc. loom and 1p, 3p extensions), add logic to hide menu
|
|
9
|
+
button completely when there are no menu-sections with no menu-items associated with it
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.4.15
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OverflowMenuSection = 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 OverflowMenuSection = exports.OverflowMenuSection = function OverflowMenuSection(_ref) {
|
|
12
|
+
var children = _ref.children;
|
|
13
|
+
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
14
|
+
editorViewMode = _useEditorToolbar.editorViewMode;
|
|
15
|
+
var isEdit = editorViewMode === 'edit';
|
|
16
|
+
|
|
17
|
+
// only show separator in edit mode, when the pinned toolbar option is available
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
|
|
19
|
+
hasSeparator: isEdit
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
|
@@ -14,6 +14,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
15
|
var _consts = require("./consts");
|
|
16
16
|
var _OverflowMenu = require("./OverflowMenu");
|
|
17
|
+
var _OverflowMenuSection = require("./OverflowMenuSection");
|
|
17
18
|
var _OverflowSection = require("./OverflowSection");
|
|
18
19
|
var _PrimaryToolbar = require("./PrimaryToolbar");
|
|
19
20
|
var _Section = require("./Section");
|
|
@@ -217,7 +218,16 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
217
218
|
var children = _ref9.children;
|
|
218
219
|
return /*#__PURE__*/_react.default.createElement(_OverflowMenu.OverflowMenu, null, children);
|
|
219
220
|
}
|
|
220
|
-
}, {
|
|
221
|
+
}], (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_overflow_menu_update') ? [{
|
|
222
|
+
type: _toolbar.OVERFLOW_EXTENSIONS_MENU_SECTION.type,
|
|
223
|
+
key: _toolbar.OVERFLOW_EXTENSIONS_MENU_SECTION.key,
|
|
224
|
+
parents: [{
|
|
225
|
+
type: _toolbar.OVERFLOW_MENU.type,
|
|
226
|
+
key: _toolbar.OVERFLOW_MENU.key,
|
|
227
|
+
rank: _toolbar.OVERFLOW_MENU_RANK[_toolbar.OVERFLOW_EXTENSIONS_MENU_SECTION.key]
|
|
228
|
+
}],
|
|
229
|
+
component: _OverflowMenuSection.OverflowMenuSection
|
|
230
|
+
}] : []), [{
|
|
221
231
|
type: _toolbar.PIN_SECTION.type,
|
|
222
232
|
key: _toolbar.PIN_SECTION.key,
|
|
223
233
|
parents: [{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
export const OverflowMenuSection = ({
|
|
5
|
+
children
|
|
6
|
+
}) => {
|
|
7
|
+
const {
|
|
8
|
+
editorViewMode
|
|
9
|
+
} = useEditorToolbar();
|
|
10
|
+
const isEdit = editorViewMode === 'edit';
|
|
11
|
+
|
|
12
|
+
// only show separator in edit mode, when the pinned toolbar option is available
|
|
13
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
14
|
+
hasSeparator: isEdit
|
|
15
|
+
}, children);
|
|
16
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
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_COLLAPSED_GROUP, TEXT_SECTION, TEXT_SECTION_PRIMARY_TOOLBAR, TEXT_SECTION_COLLAPSED, TEXT_COLLAPSED_MENU, TOOLBAR_RANK, TOOLBARS, TRACK_CHANGES_SECTION } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
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_COLLAPSED_GROUP, TEXT_SECTION, TEXT_SECTION_PRIMARY_TOOLBAR, TEXT_SECTION_COLLAPSED, TEXT_COLLAPSED_MENU, TOOLBAR_RANK, TOOLBARS, TRACK_CHANGES_SECTION, OVERFLOW_EXTENSIONS_MENU_SECTION, OVERFLOW_MENU_RANK } from '@atlaskit/editor-common/toolbar';
|
|
4
4
|
import { PrimaryToolbar as PrimaryToolbarBase, Show, Toolbar } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
import { SELECTION_TOOLBAR_LABEL } from './consts';
|
|
8
8
|
import { OverflowMenu } from './OverflowMenu';
|
|
9
|
+
import { OverflowMenuSection } from './OverflowMenuSection';
|
|
9
10
|
import { OverflowSection } from './OverflowSection';
|
|
10
11
|
import { PrimaryToolbar } from './PrimaryToolbar';
|
|
11
12
|
import { Section } from './Section';
|
|
@@ -210,7 +211,16 @@ export const getToolbarComponents = (contextualFormattingEnabled, api, disableSe
|
|
|
210
211
|
}) => {
|
|
211
212
|
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
212
213
|
}
|
|
213
|
-
}, {
|
|
214
|
+
}, ...(fg('platform_editor_toolbar_aifc_overflow_menu_update') ? [{
|
|
215
|
+
type: OVERFLOW_EXTENSIONS_MENU_SECTION.type,
|
|
216
|
+
key: OVERFLOW_EXTENSIONS_MENU_SECTION.key,
|
|
217
|
+
parents: [{
|
|
218
|
+
type: OVERFLOW_MENU.type,
|
|
219
|
+
key: OVERFLOW_MENU.key,
|
|
220
|
+
rank: OVERFLOW_MENU_RANK[OVERFLOW_EXTENSIONS_MENU_SECTION.key]
|
|
221
|
+
}],
|
|
222
|
+
component: OverflowMenuSection
|
|
223
|
+
}] : []), {
|
|
214
224
|
type: PIN_SECTION.type,
|
|
215
225
|
key: PIN_SECTION.key,
|
|
216
226
|
parents: [{
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
export var OverflowMenuSection = function OverflowMenuSection(_ref) {
|
|
5
|
+
var children = _ref.children;
|
|
6
|
+
var _useEditorToolbar = useEditorToolbar(),
|
|
7
|
+
editorViewMode = _useEditorToolbar.editorViewMode;
|
|
8
|
+
var isEdit = editorViewMode === 'edit';
|
|
9
|
+
|
|
10
|
+
// only show separator in edit mode, when the pinned toolbar option is available
|
|
11
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
12
|
+
hasSeparator: isEdit
|
|
13
|
+
}, children);
|
|
14
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
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_COLLAPSED_GROUP, TEXT_SECTION, TEXT_SECTION_PRIMARY_TOOLBAR, TEXT_SECTION_COLLAPSED, TEXT_COLLAPSED_MENU, TOOLBAR_RANK, TOOLBARS, TRACK_CHANGES_SECTION } from '@atlaskit/editor-common/toolbar';
|
|
4
|
+
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_COLLAPSED_GROUP, TEXT_SECTION, TEXT_SECTION_PRIMARY_TOOLBAR, TEXT_SECTION_COLLAPSED, TEXT_COLLAPSED_MENU, TOOLBAR_RANK, TOOLBARS, TRACK_CHANGES_SECTION, OVERFLOW_EXTENSIONS_MENU_SECTION, OVERFLOW_MENU_RANK } from '@atlaskit/editor-common/toolbar';
|
|
5
5
|
import { PrimaryToolbar as PrimaryToolbarBase, Show, Toolbar } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
8
|
import { SELECTION_TOOLBAR_LABEL } from './consts';
|
|
9
9
|
import { OverflowMenu } from './OverflowMenu';
|
|
10
|
+
import { OverflowMenuSection } from './OverflowMenuSection';
|
|
10
11
|
import { OverflowSection } from './OverflowSection';
|
|
11
12
|
import { PrimaryToolbar } from './PrimaryToolbar';
|
|
12
13
|
import { Section } from './Section';
|
|
@@ -210,7 +211,16 @@ export var getToolbarComponents = function getToolbarComponents(contextualFormat
|
|
|
210
211
|
var children = _ref9.children;
|
|
211
212
|
return /*#__PURE__*/React.createElement(OverflowMenu, null, children);
|
|
212
213
|
}
|
|
213
|
-
}, {
|
|
214
|
+
}], _toConsumableArray(fg('platform_editor_toolbar_aifc_overflow_menu_update') ? [{
|
|
215
|
+
type: OVERFLOW_EXTENSIONS_MENU_SECTION.type,
|
|
216
|
+
key: OVERFLOW_EXTENSIONS_MENU_SECTION.key,
|
|
217
|
+
parents: [{
|
|
218
|
+
type: OVERFLOW_MENU.type,
|
|
219
|
+
key: OVERFLOW_MENU.key,
|
|
220
|
+
rank: OVERFLOW_MENU_RANK[OVERFLOW_EXTENSIONS_MENU_SECTION.key]
|
|
221
|
+
}],
|
|
222
|
+
component: OverflowMenuSection
|
|
223
|
+
}] : []), [{
|
|
214
224
|
type: PIN_SECTION.type,
|
|
215
225
|
key: PIN_SECTION.key,
|
|
216
226
|
parents: [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.16",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
43
|
-
"@atlaskit/tmp-editor-statsig": "^14.
|
|
43
|
+
"@atlaskit/tmp-editor-statsig": "^14.8.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"bind-event-listener": "^3.0.0",
|
|
46
46
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^110.
|
|
49
|
+
"@atlaskit/editor-common": "^110.40.0",
|
|
50
50
|
"react": "^18.2.0"
|
|
51
51
|
},
|
|
52
52
|
"platform-feature-flags": {
|
|
@@ -64,6 +64,9 @@
|
|
|
64
64
|
},
|
|
65
65
|
"platform_editor_toolbar_aifc_undo_redo_confluence": {
|
|
66
66
|
"type": "boolean"
|
|
67
|
+
},
|
|
68
|
+
"platform_editor_toolbar_aifc_overflow_menu_update": {
|
|
69
|
+
"type": "boolean"
|
|
67
70
|
}
|
|
68
71
|
},
|
|
69
72
|
"techstack": {
|