@atlaskit/editor-plugin-toolbar 3.0.5 → 3.1.1
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 +20 -0
- package/dist/cjs/ui/Section.js +2 -1
- package/dist/cjs/ui/SelectionToolbar/index.js +4 -1
- package/dist/cjs/ui/toolbar-components.js +2 -1
- package/dist/es2019/ui/Section.js +3 -2
- package/dist/es2019/ui/SelectionToolbar/index.js +6 -2
- package/dist/es2019/ui/toolbar-components.js +2 -1
- package/dist/esm/ui/Section.js +3 -2
- package/dist/esm/ui/SelectionToolbar/index.js +5 -2
- package/dist/esm/ui/toolbar-components.js +2 -1
- package/dist/types/ui/OverflowSection.d.ts +2 -1
- package/dist/types-ts4.5/ui/OverflowSection.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`351022ab9c347`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/351022ab9c347) -
|
|
14
|
+
[ux] [ED-29060] add toolbar separators after the AI sections in the inline toolbars behind
|
|
15
|
+
platform_editor_toolbar_aifc_patch_6
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`6331abb3b4a0e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6331abb3b4a0e) -
|
|
20
|
+
ED-29470 Fix toolbar disabled state for offline mode
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 3.0.5
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cjs/ui/Section.js
CHANGED
|
@@ -69,8 +69,9 @@ var Section = exports.Section = function Section(_ref) {
|
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
var isFullPage = editorAppearance === 'full-page';
|
|
72
|
+
var hasSeparator = showSeparatorInFullPagePrimaryToolbar && isFullPage;
|
|
72
73
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarSection, {
|
|
73
74
|
testId: testId,
|
|
74
|
-
hasSeparator:
|
|
75
|
+
hasSeparator: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && hasSeparator ? _editorToolbar.SeparatorPosition.START : hasSeparator
|
|
75
76
|
}, children);
|
|
76
77
|
};
|
|
@@ -88,6 +88,9 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
88
88
|
var keyboardNavigation = (0, _react.useMemo)(function () {
|
|
89
89
|
return getKeyboardNavigationConfig(editorView, intl, api);
|
|
90
90
|
}, [editorView, intl, api]);
|
|
91
|
+
var _useToolbarUI = (0, _editorToolbar.useToolbarUI)(),
|
|
92
|
+
isDisabled = _useToolbarUI.isDisabled;
|
|
93
|
+
var patch6Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
91
94
|
var isOffline = connectivityStateMode === 'offline';
|
|
92
95
|
var isTextSelection = !editorView.state.selection.empty && editorView.state.selection instanceof _state.TextSelection;
|
|
93
96
|
var isAllSelection = !editorView.state.selection.empty && editorView.state.selection instanceof _state.AllSelection;
|
|
@@ -120,7 +123,7 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
120
123
|
editorViewMode: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_4', 'isEnabled', true) ? editorViewMode !== null && editorViewMode !== void 0 ? editorViewMode : 'edit' : editorViewMode
|
|
121
124
|
}, /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarUIProvider, {
|
|
122
125
|
api: api,
|
|
123
|
-
isDisabled: isOffline
|
|
126
|
+
isDisabled: patch6Enabled ? isDisabled : isOffline
|
|
124
127
|
// supress type checks for now
|
|
125
128
|
,
|
|
126
129
|
fireAnalyticsEvent: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? function (payload) {
|
|
@@ -35,7 +35,8 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
35
35
|
component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? _PrimaryToolbar.PrimaryToolbar : function (_ref2) {
|
|
36
36
|
var children = _ref2.children;
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.PrimaryToolbar, {
|
|
38
|
-
label: "Primary Toolbar"
|
|
38
|
+
label: "Primary Toolbar",
|
|
39
|
+
testId: "primary-toolbar"
|
|
39
40
|
}, children);
|
|
40
41
|
}
|
|
41
42
|
}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TOOLBARS, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
import { ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { ToolbarSection, SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
const shouldShowSection = (editMode, toolbar, toolbarDocking, disableSelectionToolbar) => {
|
|
@@ -61,8 +61,9 @@ export const Section = ({
|
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
63
|
const isFullPage = editorAppearance === 'full-page';
|
|
64
|
+
const hasSeparator = showSeparatorInFullPagePrimaryToolbar && isFullPage;
|
|
64
65
|
return /*#__PURE__*/React.createElement(ToolbarSection, {
|
|
65
66
|
testId: testId,
|
|
66
|
-
hasSeparator:
|
|
67
|
+
hasSeparator: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && hasSeparator ? SeparatorPosition.START : hasSeparator
|
|
67
68
|
}, children);
|
|
68
69
|
};
|
|
@@ -10,7 +10,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
10
10
|
import { calculateToolbarPositionTrackHead, calculateToolbarPositionOnCellSelection } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { AllSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
13
|
-
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
13
|
+
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
14
14
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
15
15
|
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
16
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -80,6 +80,10 @@ export const SelectionToolbar = ({
|
|
|
80
80
|
const keyboardNavigation = useMemo(() => {
|
|
81
81
|
return getKeyboardNavigationConfig(editorView, intl, api);
|
|
82
82
|
}, [editorView, intl, api]);
|
|
83
|
+
const {
|
|
84
|
+
isDisabled
|
|
85
|
+
} = useToolbarUI();
|
|
86
|
+
const patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
83
87
|
const isOffline = connectivityStateMode === 'offline';
|
|
84
88
|
const isTextSelection = !editorView.state.selection.empty && editorView.state.selection instanceof TextSelection;
|
|
85
89
|
const isAllSelection = !editorView.state.selection.empty && editorView.state.selection instanceof AllSelection;
|
|
@@ -112,7 +116,7 @@ export const SelectionToolbar = ({
|
|
|
112
116
|
editorViewMode: expValEquals('platform_editor_toolbar_aifc_patch_4', 'isEnabled', true) ? editorViewMode !== null && editorViewMode !== void 0 ? editorViewMode : 'edit' : editorViewMode
|
|
113
117
|
}, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
|
|
114
118
|
api: api,
|
|
115
|
-
isDisabled: isOffline
|
|
119
|
+
isDisabled: patch6Enabled ? isDisabled : isOffline
|
|
116
120
|
// supress type checks for now
|
|
117
121
|
,
|
|
118
122
|
fireAnalyticsEvent: expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? payload => {
|
|
@@ -28,7 +28,8 @@ export const getToolbarComponents = (api, disableSelectionToolbar) => {
|
|
|
28
28
|
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? PrimaryToolbar : ({
|
|
29
29
|
children
|
|
30
30
|
}) => /*#__PURE__*/React.createElement(PrimaryToolbarBase, {
|
|
31
|
-
label: "Primary Toolbar"
|
|
31
|
+
label: "Primary Toolbar",
|
|
32
|
+
testId: "primary-toolbar"
|
|
32
33
|
}, children)
|
|
33
34
|
}, {
|
|
34
35
|
type: TEXT_SECTION.type,
|
package/dist/esm/ui/Section.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TOOLBARS, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
import { ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { ToolbarSection, SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
var shouldShowSection = function shouldShowSection(editMode, toolbar, toolbarDocking, disableSelectionToolbar) {
|
|
@@ -62,8 +62,9 @@ export var Section = function Section(_ref) {
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
var isFullPage = editorAppearance === 'full-page';
|
|
65
|
+
var hasSeparator = showSeparatorInFullPagePrimaryToolbar && isFullPage;
|
|
65
66
|
return /*#__PURE__*/React.createElement(ToolbarSection, {
|
|
66
67
|
testId: testId,
|
|
67
|
-
hasSeparator:
|
|
68
|
+
hasSeparator: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && hasSeparator ? SeparatorPosition.START : hasSeparator
|
|
68
69
|
}, children);
|
|
69
70
|
};
|
|
@@ -10,7 +10,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
10
10
|
import { calculateToolbarPositionTrackHead, calculateToolbarPositionOnCellSelection } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { AllSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
13
|
-
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
13
|
+
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
14
14
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
15
15
|
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
|
|
16
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -80,6 +80,9 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
80
80
|
var keyboardNavigation = useMemo(function () {
|
|
81
81
|
return getKeyboardNavigationConfig(editorView, intl, api);
|
|
82
82
|
}, [editorView, intl, api]);
|
|
83
|
+
var _useToolbarUI = useToolbarUI(),
|
|
84
|
+
isDisabled = _useToolbarUI.isDisabled;
|
|
85
|
+
var patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
83
86
|
var isOffline = connectivityStateMode === 'offline';
|
|
84
87
|
var isTextSelection = !editorView.state.selection.empty && editorView.state.selection instanceof TextSelection;
|
|
85
88
|
var isAllSelection = !editorView.state.selection.empty && editorView.state.selection instanceof AllSelection;
|
|
@@ -112,7 +115,7 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
112
115
|
editorViewMode: expValEquals('platform_editor_toolbar_aifc_patch_4', 'isEnabled', true) ? editorViewMode !== null && editorViewMode !== void 0 ? editorViewMode : 'edit' : editorViewMode
|
|
113
116
|
}, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
|
|
114
117
|
api: api,
|
|
115
|
-
isDisabled: isOffline
|
|
118
|
+
isDisabled: patch6Enabled ? isDisabled : isOffline
|
|
116
119
|
// supress type checks for now
|
|
117
120
|
,
|
|
118
121
|
fireAnalyticsEvent: expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? function (payload) {
|
|
@@ -28,7 +28,8 @@ export var getToolbarComponents = function getToolbarComponents(api, disableSele
|
|
|
28
28
|
component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? PrimaryToolbar : function (_ref2) {
|
|
29
29
|
var children = _ref2.children;
|
|
30
30
|
return /*#__PURE__*/React.createElement(PrimaryToolbarBase, {
|
|
31
|
-
label: "Primary Toolbar"
|
|
31
|
+
label: "Primary Toolbar",
|
|
32
|
+
testId: "primary-toolbar"
|
|
32
33
|
}, children);
|
|
33
34
|
}
|
|
34
35
|
}, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
2
3
|
export declare const OverflowSection: ({ children, hasSeparator, testId, }: {
|
|
3
4
|
children: React.ReactNode;
|
|
4
|
-
hasSeparator?: boolean;
|
|
5
|
+
hasSeparator?: boolean | SeparatorPosition;
|
|
5
6
|
testId?: string;
|
|
6
7
|
}) => React.JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { SeparatorPosition } from '@atlaskit/editor-toolbar';
|
|
2
3
|
export declare const OverflowSection: ({ children, hasSeparator, testId, }: {
|
|
3
4
|
children: React.ReactNode;
|
|
4
|
-
hasSeparator?: boolean;
|
|
5
|
+
hasSeparator?: boolean | SeparatorPosition;
|
|
5
6
|
testId?: string;
|
|
6
7
|
}) => React.JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-user-intent": "^4.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-user-preferences": "^4.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
39
|
+
"@atlaskit/editor-toolbar": "^0.14.0",
|
|
40
40
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
42
42
|
"@atlaskit/tmp-editor-statsig": "^13.2.0",
|