@atlaskit/editor-plugin-primary-toolbar 3.1.1 → 3.1.2
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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-primary-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#137151](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137151)
|
|
8
|
+
[`724daf91c62db`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/724daf91c62db) -
|
|
9
|
+
[ux] Put move of the redo/undo/find behind its own FG. Fix double Find & Replace popup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.1.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.getToolbarComponents = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
10
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
8
11
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(_ref) {
|
|
9
12
|
var componentRegistry = _ref.componentRegistry,
|
|
10
13
|
editorState = _ref.editorState,
|
|
11
14
|
contextualFormattingEnabled = _ref.contextualFormattingEnabled;
|
|
12
|
-
var configuration
|
|
15
|
+
var configuration;
|
|
16
|
+
if (contextualFormattingEnabled && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
13
17
|
exposure: true
|
|
14
|
-
})
|
|
18
|
+
})) {
|
|
19
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_controls_move_actions')) {
|
|
20
|
+
configuration = toolbarConfigurationV2;
|
|
21
|
+
} else {
|
|
22
|
+
configuration = toolbarConfigurationV2WithUndoRedoAndFindReplace;
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
configuration = toolbarConfiguration;
|
|
26
|
+
}
|
|
15
27
|
return configuration.filter(function (toolbarElement) {
|
|
16
28
|
return typeof toolbarElement.enabled === 'undefined' || toolbarElement.enabled(componentRegistry, editorState);
|
|
17
29
|
}).reduce(function (acc, toolbarElement) {
|
|
@@ -107,9 +119,13 @@ var others = [{
|
|
|
107
119
|
}, {
|
|
108
120
|
name: 'loom'
|
|
109
121
|
}];
|
|
122
|
+
var findGroup = [{
|
|
123
|
+
name: 'findReplace'
|
|
124
|
+
}];
|
|
110
125
|
var toolbarConfiguration = [].concat(undoRedoGroup, spellCheckGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormattingGroup, insertBlockGroup, others);
|
|
111
126
|
var toolbarConfigurationV2 = [].concat(blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, [{
|
|
112
127
|
name: 'overflowMenu'
|
|
113
128
|
}, {
|
|
114
129
|
name: 'beforePrimaryToolbar'
|
|
115
|
-
}]);
|
|
130
|
+
}]);
|
|
131
|
+
var toolbarConfigurationV2WithUndoRedoAndFindReplace = [].concat(undoRedoGroup, (0, _toConsumableArray2.default)(toolbarConfigurationV2), findGroup);
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
3
|
export const getToolbarComponents = ({
|
|
3
4
|
componentRegistry,
|
|
4
5
|
editorState,
|
|
5
6
|
contextualFormattingEnabled
|
|
6
7
|
}) => {
|
|
7
|
-
|
|
8
|
+
let configuration;
|
|
9
|
+
if (contextualFormattingEnabled && editorExperiment('platform_editor_controls', 'variant1', {
|
|
8
10
|
exposure: true
|
|
9
|
-
})
|
|
11
|
+
})) {
|
|
12
|
+
if (fg('platform_editor_controls_move_actions')) {
|
|
13
|
+
configuration = toolbarConfigurationV2;
|
|
14
|
+
} else {
|
|
15
|
+
configuration = toolbarConfigurationV2WithUndoRedoAndFindReplace;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
configuration = toolbarConfiguration;
|
|
19
|
+
}
|
|
10
20
|
return configuration.filter(toolbarElement => typeof toolbarElement.enabled === 'undefined' || toolbarElement.enabled(componentRegistry, editorState)).reduce((acc, toolbarElement) => {
|
|
11
21
|
if (componentRegistry.has(toolbarElement.name)) {
|
|
12
22
|
const component = componentRegistry.get(toolbarElement.name);
|
|
@@ -84,9 +94,13 @@ const others = [{
|
|
|
84
94
|
}, {
|
|
85
95
|
name: 'loom'
|
|
86
96
|
}];
|
|
97
|
+
const findGroup = [{
|
|
98
|
+
name: 'findReplace'
|
|
99
|
+
}];
|
|
87
100
|
const toolbarConfiguration = [...undoRedoGroup, ...spellCheckGroup, ...blockTypeGroup, ...textFormattingGroup, ...alignmentGroup, ...textColorGroup, ...listFormattingGroup, ...insertBlockGroup, ...others];
|
|
88
101
|
const toolbarConfigurationV2 = [...blockTypeGroup, ...textFormattingGroup, ...textColorGroup, ...alignmentGroup, ...listFormattingGroup, ...hyperlinkGroup, {
|
|
89
102
|
name: 'overflowMenu'
|
|
90
103
|
}, {
|
|
91
104
|
name: 'beforePrimaryToolbar'
|
|
92
|
-
}];
|
|
105
|
+
}];
|
|
106
|
+
const toolbarConfigurationV2WithUndoRedoAndFindReplace = [...undoRedoGroup, ...toolbarConfigurationV2, ...findGroup];
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
4
|
export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
3
5
|
var componentRegistry = _ref.componentRegistry,
|
|
4
6
|
editorState = _ref.editorState,
|
|
5
7
|
contextualFormattingEnabled = _ref.contextualFormattingEnabled;
|
|
6
|
-
var configuration
|
|
8
|
+
var configuration;
|
|
9
|
+
if (contextualFormattingEnabled && editorExperiment('platform_editor_controls', 'variant1', {
|
|
7
10
|
exposure: true
|
|
8
|
-
})
|
|
11
|
+
})) {
|
|
12
|
+
if (fg('platform_editor_controls_move_actions')) {
|
|
13
|
+
configuration = toolbarConfigurationV2;
|
|
14
|
+
} else {
|
|
15
|
+
configuration = toolbarConfigurationV2WithUndoRedoAndFindReplace;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
configuration = toolbarConfiguration;
|
|
19
|
+
}
|
|
9
20
|
return configuration.filter(function (toolbarElement) {
|
|
10
21
|
return typeof toolbarElement.enabled === 'undefined' || toolbarElement.enabled(componentRegistry, editorState);
|
|
11
22
|
}).reduce(function (acc, toolbarElement) {
|
|
@@ -101,9 +112,13 @@ var others = [{
|
|
|
101
112
|
}, {
|
|
102
113
|
name: 'loom'
|
|
103
114
|
}];
|
|
115
|
+
var findGroup = [{
|
|
116
|
+
name: 'findReplace'
|
|
117
|
+
}];
|
|
104
118
|
var toolbarConfiguration = [].concat(undoRedoGroup, spellCheckGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormattingGroup, insertBlockGroup, others);
|
|
105
119
|
var toolbarConfigurationV2 = [].concat(blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, [{
|
|
106
120
|
name: 'overflowMenu'
|
|
107
121
|
}, {
|
|
108
122
|
name: 'beforePrimaryToolbar'
|
|
109
|
-
}]);
|
|
123
|
+
}]);
|
|
124
|
+
var toolbarConfigurationV2WithUndoRedoAndFindReplace = [].concat(undoRedoGroup, _toConsumableArray(toolbarConfigurationV2), findGroup);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-primary-toolbar",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Primary toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
".": "./src/index.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@atlaskit/editor-common": "^103.
|
|
39
|
+
"@atlaskit/editor-common": "^103.1.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
42
|
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
42
43
|
"@babel/runtime": "^7.0.0",
|
|
43
44
|
"@emotion/react": "^11.7.1"
|
|
@@ -82,5 +83,10 @@
|
|
|
82
83
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
83
84
|
]
|
|
84
85
|
}
|
|
86
|
+
},
|
|
87
|
+
"platform-feature-flags": {
|
|
88
|
+
"platform_editor_controls_move_actions": {
|
|
89
|
+
"type": "boolean"
|
|
90
|
+
}
|
|
85
91
|
}
|
|
86
92
|
}
|