@atlaskit/editor-plugin-selection-toolbar 5.0.5 → 5.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 +8 -0
- package/dist/cjs/ui/MenuSection.js +20 -0
- package/dist/cjs/ui/toolbar-components.js +9 -1
- package/dist/es2019/ui/MenuSection.js +14 -0
- package/dist/es2019/ui/toolbar-components.js +10 -1
- package/dist/esm/ui/MenuSection.js +13 -0
- package/dist/esm/ui/toolbar-components.js +9 -1
- package/dist/types/ui/MenuSection.d.ts +9 -0
- package/dist/types-ts4.5/ui/MenuSection.d.ts +9 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-toolbar
|
|
2
2
|
|
|
3
|
+
## 5.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0812ff5bd7bd1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0812ff5bd7bd1) -
|
|
8
|
+
Dont render menu sections in live view
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 5.0.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.MenuSection = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
10
|
+
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
|
+
var MenuSection = exports.MenuSection = function MenuSection(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
api = _ref.api;
|
|
14
|
+
var viewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorViewMode.mode');
|
|
15
|
+
var isEdit = viewMode === 'edit';
|
|
16
|
+
if (!isEdit) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, null, children);
|
|
20
|
+
};
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getToolbarComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
+
var _MenuSection = require("./MenuSection");
|
|
10
12
|
var _PinButton = require("./PinButton");
|
|
11
13
|
var _PinMenuItem = require("./PinMenuItem");
|
|
12
14
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api, contextualFormattingEnabled) {
|
|
@@ -17,7 +19,13 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
17
19
|
type: _toolbar.OVERFLOW_MENU.type,
|
|
18
20
|
key: _toolbar.OVERFLOW_MENU.key,
|
|
19
21
|
rank: _toolbar.OVERFLOW_MENU_RANK[_toolbar.PIN_MENU_SECTION.key]
|
|
20
|
-
}]
|
|
22
|
+
}],
|
|
23
|
+
component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) ? function (_ref) {
|
|
24
|
+
var children = _ref.children;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_MenuSection.MenuSection, {
|
|
26
|
+
api: api
|
|
27
|
+
}, children);
|
|
28
|
+
} : undefined
|
|
21
29
|
}, {
|
|
22
30
|
type: _toolbar.PIN_MENU_ITEM.type,
|
|
23
31
|
key: _toolbar.PIN_MENU_ITEM.key,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
3
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
export const MenuSection = ({
|
|
5
|
+
children,
|
|
6
|
+
api
|
|
7
|
+
}) => {
|
|
8
|
+
const viewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
9
|
+
const isEdit = viewMode === 'edit';
|
|
10
|
+
if (!isEdit) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, children);
|
|
14
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OVERFLOW_MENU, OVERFLOW_MENU_RANK, PIN_BUTTON, PIN_GROUP, PIN_MENU_ITEM, PIN_MENU_SECTION, PIN_MENU_SECTION_RANK, PIN_GROUP_RANK, PIN_SECTION, PIN_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { MenuSection } from './MenuSection';
|
|
3
5
|
import { PinButton } from './PinButton';
|
|
4
6
|
import { PinMenuItem } from './PinMenuItem';
|
|
5
7
|
export const getToolbarComponents = (api, contextualFormattingEnabled) => {
|
|
@@ -10,7 +12,14 @@ export const getToolbarComponents = (api, contextualFormattingEnabled) => {
|
|
|
10
12
|
type: OVERFLOW_MENU.type,
|
|
11
13
|
key: OVERFLOW_MENU.key,
|
|
12
14
|
rank: OVERFLOW_MENU_RANK[PIN_MENU_SECTION.key]
|
|
13
|
-
}]
|
|
15
|
+
}],
|
|
16
|
+
component: expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) ? ({
|
|
17
|
+
children
|
|
18
|
+
}) => {
|
|
19
|
+
return /*#__PURE__*/React.createElement(MenuSection, {
|
|
20
|
+
api: api
|
|
21
|
+
}, children);
|
|
22
|
+
} : undefined
|
|
14
23
|
}, {
|
|
15
24
|
type: PIN_MENU_ITEM.type,
|
|
16
25
|
key: PIN_MENU_ITEM.key,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
3
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
export var MenuSection = function MenuSection(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
api = _ref.api;
|
|
7
|
+
var viewMode = useSharedPluginStateSelector(api, 'editorViewMode.mode');
|
|
8
|
+
var isEdit = viewMode === 'edit';
|
|
9
|
+
if (!isEdit) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, children);
|
|
13
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OVERFLOW_MENU, OVERFLOW_MENU_RANK, PIN_BUTTON, PIN_GROUP, PIN_MENU_ITEM, PIN_MENU_SECTION, PIN_MENU_SECTION_RANK, PIN_GROUP_RANK, PIN_SECTION, PIN_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { MenuSection } from './MenuSection';
|
|
3
5
|
import { PinButton } from './PinButton';
|
|
4
6
|
import { PinMenuItem } from './PinMenuItem';
|
|
5
7
|
export var getToolbarComponents = function getToolbarComponents(api, contextualFormattingEnabled) {
|
|
@@ -10,7 +12,13 @@ export var getToolbarComponents = function getToolbarComponents(api, contextualF
|
|
|
10
12
|
type: OVERFLOW_MENU.type,
|
|
11
13
|
key: OVERFLOW_MENU.key,
|
|
12
14
|
rank: OVERFLOW_MENU_RANK[PIN_MENU_SECTION.key]
|
|
13
|
-
}]
|
|
15
|
+
}],
|
|
16
|
+
component: expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) ? function (_ref) {
|
|
17
|
+
var children = _ref.children;
|
|
18
|
+
return /*#__PURE__*/React.createElement(MenuSection, {
|
|
19
|
+
api: api
|
|
20
|
+
}, children);
|
|
21
|
+
} : undefined
|
|
14
22
|
}, {
|
|
15
23
|
type: PIN_MENU_ITEM.type,
|
|
16
24
|
key: PIN_MENU_ITEM.key,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
|
|
4
|
+
type MenuSectionProps = {
|
|
5
|
+
api: ExtractInjectionAPI<SelectionToolbarPlugin> | undefined;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
|
|
4
|
+
type MenuSectionProps = {
|
|
5
|
+
api: ExtractInjectionAPI<SelectionToolbarPlugin> | undefined;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const MenuSection: ({ children, api }: MenuSectionProps) => React.JSX.Element | null;
|
|
9
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-toolbar",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"@atlaskit/icon-lab": "^5.7.0",
|
|
46
46
|
"@atlaskit/menu": "^8.4.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^12.7.0",
|
|
49
49
|
"@atlaskit/tokens": "^6.3.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"bind-event-listener": "^3.0.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^108.
|
|
54
|
+
"@atlaskit/editor-common": "^108.6.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-dom": "^18.2.0",
|
|
57
57
|
"react-intl-next": "npm:react-intl@^5.18.1"
|