@atlaskit/editor-plugin-primary-toolbar 4.1.1 → 4.1.3
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 +17 -0
- package/dist/cjs/pm-plugins/toolbar-configuration.js +6 -2
- package/dist/es2019/pm-plugins/toolbar-configuration.js +6 -2
- package/dist/esm/pm-plugins/toolbar-configuration.js +6 -2
- package/dist/types/primaryToolbarPluginType.d.ts +1 -1
- package/dist/types-ts4.5/primaryToolbarPluginType.d.ts +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-primary-toolbar
|
|
2
2
|
|
|
3
|
+
## 4.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#195513](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195513)
|
|
8
|
+
[`98c0ba1c91086`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/98c0ba1c91086) -
|
|
9
|
+
[EDITOR-1073] Adding a FG to gate Jira as well as Confluence for Undo/ Redo/ Show Diff buttons in
|
|
10
|
+
the primary toolbar
|
|
11
|
+
|
|
12
|
+
## 4.1.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#192343](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192343)
|
|
17
|
+
[`9cb0878241016`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9cb0878241016) -
|
|
18
|
+
ED-28736 more extensible selection extensions API
|
|
19
|
+
|
|
3
20
|
## 4.1.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -20,7 +20,9 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
20
20
|
configuration = toolbarConfigurationV2(true, shouldShowUndoRedoGroup);
|
|
21
21
|
} else {
|
|
22
22
|
var shouldShowFindGroup = !!contextualFormattingEnabled;
|
|
23
|
-
|
|
23
|
+
// platform_editor_ai_in_document_streaming is the feature flag for Confluence
|
|
24
|
+
// editor-jira-undo-redo-show-diff-buttons is the feature flag for Jira
|
|
25
|
+
if (((0, _platformFeatureFlags.fg)('platform_editor_ai_in_document_streaming') || (0, _platformFeatureFlags.fg)('editor-jira-undo-redo-show-diff-buttons')) && componentRegistry.has('trackChanges')) {
|
|
24
26
|
configuration = toolbarConfigurationV3(shouldShowFindGroup);
|
|
25
27
|
} else {
|
|
26
28
|
configuration = toolbarConfiguration(shouldShowFindGroup);
|
|
@@ -161,7 +163,9 @@ var pinToolbar = [{
|
|
|
161
163
|
}];
|
|
162
164
|
var toolbarConfigurationV2 = function toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup) {
|
|
163
165
|
var shouldShowFindGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
164
|
-
return [].concat((0, _toConsumableArray2.default)(shouldShowUndoRedoGroup ? undoRedoGroup : []), blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, (0, _toConsumableArray2.default)(shouldShowInsertBlock ? insertBlockGroup : []),
|
|
166
|
+
return [].concat((0, _toConsumableArray2.default)(shouldShowUndoRedoGroup ? undoRedoGroup : []), blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, (0, _toConsumableArray2.default)(shouldShowInsertBlock ? insertBlockGroup : []), [{
|
|
167
|
+
name: 'selectionExtension'
|
|
168
|
+
}], pinToolbar, [{
|
|
165
169
|
name: 'beforePrimaryToolbar'
|
|
166
170
|
}], (0, _toConsumableArray2.default)(shouldShowFindGroup ? findGroup : []));
|
|
167
171
|
};
|
|
@@ -13,7 +13,9 @@ export const getToolbarComponents = ({
|
|
|
13
13
|
configuration = toolbarConfigurationV2(true, shouldShowUndoRedoGroup);
|
|
14
14
|
} else {
|
|
15
15
|
const shouldShowFindGroup = !!contextualFormattingEnabled;
|
|
16
|
-
|
|
16
|
+
// platform_editor_ai_in_document_streaming is the feature flag for Confluence
|
|
17
|
+
// editor-jira-undo-redo-show-diff-buttons is the feature flag for Jira
|
|
18
|
+
if ((fg('platform_editor_ai_in_document_streaming') || fg('editor-jira-undo-redo-show-diff-buttons')) && componentRegistry.has('trackChanges')) {
|
|
17
19
|
configuration = toolbarConfigurationV3(shouldShowFindGroup);
|
|
18
20
|
} else {
|
|
19
21
|
configuration = toolbarConfiguration(shouldShowFindGroup);
|
|
@@ -124,6 +126,8 @@ const toolbarConfiguration = shouldShowFindGroup => [...undoRedoGroup, ...spellC
|
|
|
124
126
|
const pinToolbar = [{
|
|
125
127
|
name: 'pinToolbar'
|
|
126
128
|
}];
|
|
127
|
-
const toolbarConfigurationV2 = (shouldShowInsertBlock, shouldShowUndoRedoGroup, shouldShowFindGroup = false) => [...(shouldShowUndoRedoGroup ? undoRedoGroup : []), ...blockTypeGroup, ...textFormattingGroup, ...textColorGroup, ...alignmentGroup, ...listFormattingGroup, ...hyperlinkGroup, ...(shouldShowInsertBlock ? insertBlockGroup : []),
|
|
129
|
+
const toolbarConfigurationV2 = (shouldShowInsertBlock, shouldShowUndoRedoGroup, shouldShowFindGroup = false) => [...(shouldShowUndoRedoGroup ? undoRedoGroup : []), ...blockTypeGroup, ...textFormattingGroup, ...textColorGroup, ...alignmentGroup, ...listFormattingGroup, ...hyperlinkGroup, ...(shouldShowInsertBlock ? insertBlockGroup : []), {
|
|
130
|
+
name: 'selectionExtension'
|
|
131
|
+
}, ...pinToolbar, {
|
|
128
132
|
name: 'beforePrimaryToolbar'
|
|
129
133
|
}, ...(shouldShowFindGroup ? findGroup : [])];
|
|
@@ -13,7 +13,9 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
13
13
|
configuration = toolbarConfigurationV2(true, shouldShowUndoRedoGroup);
|
|
14
14
|
} else {
|
|
15
15
|
var shouldShowFindGroup = !!contextualFormattingEnabled;
|
|
16
|
-
|
|
16
|
+
// platform_editor_ai_in_document_streaming is the feature flag for Confluence
|
|
17
|
+
// editor-jira-undo-redo-show-diff-buttons is the feature flag for Jira
|
|
18
|
+
if ((fg('platform_editor_ai_in_document_streaming') || fg('editor-jira-undo-redo-show-diff-buttons')) && componentRegistry.has('trackChanges')) {
|
|
17
19
|
configuration = toolbarConfigurationV3(shouldShowFindGroup);
|
|
18
20
|
} else {
|
|
19
21
|
configuration = toolbarConfiguration(shouldShowFindGroup);
|
|
@@ -154,7 +156,9 @@ var pinToolbar = [{
|
|
|
154
156
|
}];
|
|
155
157
|
var toolbarConfigurationV2 = function toolbarConfigurationV2(shouldShowInsertBlock, shouldShowUndoRedoGroup) {
|
|
156
158
|
var shouldShowFindGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
157
|
-
return [].concat(_toConsumableArray(shouldShowUndoRedoGroup ? undoRedoGroup : []), blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, _toConsumableArray(shouldShowInsertBlock ? insertBlockGroup : []),
|
|
159
|
+
return [].concat(_toConsumableArray(shouldShowUndoRedoGroup ? undoRedoGroup : []), blockTypeGroup, textFormattingGroup, textColorGroup, alignmentGroup, listFormattingGroup, hyperlinkGroup, _toConsumableArray(shouldShowInsertBlock ? insertBlockGroup : []), [{
|
|
160
|
+
name: 'selectionExtension'
|
|
161
|
+
}], pinToolbar, [{
|
|
158
162
|
name: 'beforePrimaryToolbar'
|
|
159
163
|
}], _toConsumableArray(shouldShowFindGroup ? findGroup : []));
|
|
160
164
|
};
|
|
@@ -14,7 +14,7 @@ export type PrimaryToolbarPlugin = NextEditorPlugin<'primaryToolbar', {
|
|
|
14
14
|
pluginConfiguration?: PrimaryToolbarPluginOptions;
|
|
15
15
|
}>;
|
|
16
16
|
export type ComponentRegistry = Map<string, ToolbarUIComponentFactory>;
|
|
17
|
-
export type ToolbarElementNames = 'aiExperience' | 'aiSimplified' | 'alignment' | 'avatarGroup' | 'beforePrimaryToolbar' | 'blockType' | 'findReplace' | 'highlight' | 'hyperlink' | 'insertBlock' | 'loom' | 'overflowMenu' | 'pinToolbar' | 'separator' | 'spellCheck' | 'textColor' | 'textFormatting' | 'toolbarListsIndentation' | 'trackChanges' | 'undoRedoPlugin';
|
|
17
|
+
export type ToolbarElementNames = 'aiExperience' | 'aiSimplified' | 'alignment' | 'avatarGroup' | 'beforePrimaryToolbar' | 'blockType' | 'findReplace' | 'highlight' | 'hyperlink' | 'insertBlock' | 'loom' | 'overflowMenu' | 'pinToolbar' | 'selectionExtension' | 'separator' | 'spellCheck' | 'textColor' | 'textFormatting' | 'toolbarListsIndentation' | 'trackChanges' | 'undoRedoPlugin';
|
|
18
18
|
export type ToolbarElementConfig = {
|
|
19
19
|
name: ToolbarElementNames;
|
|
20
20
|
enabled?: (componentRegistry: ComponentRegistry, editorState: EditorState) => boolean;
|
|
@@ -14,7 +14,7 @@ export type PrimaryToolbarPlugin = NextEditorPlugin<'primaryToolbar', {
|
|
|
14
14
|
pluginConfiguration?: PrimaryToolbarPluginOptions;
|
|
15
15
|
}>;
|
|
16
16
|
export type ComponentRegistry = Map<string, ToolbarUIComponentFactory>;
|
|
17
|
-
export type ToolbarElementNames = 'aiExperience' | 'aiSimplified' | 'alignment' | 'avatarGroup' | 'beforePrimaryToolbar' | 'blockType' | 'findReplace' | 'highlight' | 'hyperlink' | 'insertBlock' | 'loom' | 'overflowMenu' | 'pinToolbar' | 'separator' | 'spellCheck' | 'textColor' | 'textFormatting' | 'toolbarListsIndentation' | 'trackChanges' | 'undoRedoPlugin';
|
|
17
|
+
export type ToolbarElementNames = 'aiExperience' | 'aiSimplified' | 'alignment' | 'avatarGroup' | 'beforePrimaryToolbar' | 'blockType' | 'findReplace' | 'highlight' | 'hyperlink' | 'insertBlock' | 'loom' | 'overflowMenu' | 'pinToolbar' | 'selectionExtension' | 'separator' | 'spellCheck' | 'textColor' | 'textFormatting' | 'toolbarListsIndentation' | 'trackChanges' | 'undoRedoPlugin';
|
|
18
18
|
export type ToolbarElementConfig = {
|
|
19
19
|
name: ToolbarElementNames;
|
|
20
20
|
enabled?: (componentRegistry: ComponentRegistry, editorState: EditorState) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-primary-toolbar",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "Primary toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^9.24.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@atlaskit/editor-common": "^107.
|
|
45
|
+
"@atlaskit/editor-common": "^107.17.0",
|
|
46
46
|
"react": "^18.2.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -88,6 +88,9 @@
|
|
|
88
88
|
"type": "boolean",
|
|
89
89
|
"referenceOnly": true
|
|
90
90
|
},
|
|
91
|
+
"editor-jira-undo-redo-show-diff-buttons": {
|
|
92
|
+
"type": "boolean"
|
|
93
|
+
},
|
|
91
94
|
"platform_editor_undo_redo_find_on_primary_toolbar": {
|
|
92
95
|
"type": "boolean"
|
|
93
96
|
}
|