@atlaskit/editor-plugin-primary-toolbar 1.1.4 → 1.2.0
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,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-primary-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#120426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120426)
|
|
8
|
+
[`1cb3869ab1a96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1cb3869ab1a96) -
|
|
9
|
+
[ED-23436] Use editor primary toolbar plugin to structure the primary toolbar
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -59,4 +59,34 @@ var textColorGroup = [{
|
|
|
59
59
|
return componentRegistry.has('textColor') || componentRegistry.has('highlight');
|
|
60
60
|
}
|
|
61
61
|
}];
|
|
62
|
-
var
|
|
62
|
+
var listFormatting = [{
|
|
63
|
+
name: 'toolbarListsIndentation'
|
|
64
|
+
}, {
|
|
65
|
+
name: 'separator',
|
|
66
|
+
enabled: function enabled(componentRegistry) {
|
|
67
|
+
return componentRegistry.has('toolbarListsIndentation');
|
|
68
|
+
}
|
|
69
|
+
}];
|
|
70
|
+
var insertBlockGroup = [{
|
|
71
|
+
name: 'insertBlock'
|
|
72
|
+
}, {
|
|
73
|
+
name: 'separator',
|
|
74
|
+
enabled: function enabled(componentRegistry) {
|
|
75
|
+
return componentRegistry.has('insertBlock') &&
|
|
76
|
+
// is last group in the toolbar
|
|
77
|
+
!componentRegistry.has('beforePrimaryToolbar') && !componentRegistry.has('avatarGroup') && !componentRegistry.has('findReplace') && !componentRegistry.has('aiExperience') && !componentRegistry.has('loom');
|
|
78
|
+
}
|
|
79
|
+
}];
|
|
80
|
+
var others = [{
|
|
81
|
+
name: 'beforePrimaryToolbar'
|
|
82
|
+
}, {
|
|
83
|
+
name: 'avatarGroup'
|
|
84
|
+
}, {
|
|
85
|
+
name: 'findReplace'
|
|
86
|
+
}, {
|
|
87
|
+
// TODO: Should likely be split into three: spelling & grammar, separator, and AI trigger
|
|
88
|
+
name: 'aiExperience'
|
|
89
|
+
}, {
|
|
90
|
+
name: 'loom'
|
|
91
|
+
}];
|
|
92
|
+
var toolbarConfiguration = [].concat(undoRedoGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormatting, insertBlockGroup, others);
|
|
@@ -39,4 +39,30 @@ const textColorGroup = [{
|
|
|
39
39
|
name: 'separator',
|
|
40
40
|
enabled: componentRegistry => componentRegistry.has('textColor') || componentRegistry.has('highlight')
|
|
41
41
|
}];
|
|
42
|
-
const
|
|
42
|
+
const listFormatting = [{
|
|
43
|
+
name: 'toolbarListsIndentation'
|
|
44
|
+
}, {
|
|
45
|
+
name: 'separator',
|
|
46
|
+
enabled: componentRegistry => componentRegistry.has('toolbarListsIndentation')
|
|
47
|
+
}];
|
|
48
|
+
const insertBlockGroup = [{
|
|
49
|
+
name: 'insertBlock'
|
|
50
|
+
}, {
|
|
51
|
+
name: 'separator',
|
|
52
|
+
enabled: componentRegistry => componentRegistry.has('insertBlock') &&
|
|
53
|
+
// is last group in the toolbar
|
|
54
|
+
!componentRegistry.has('beforePrimaryToolbar') && !componentRegistry.has('avatarGroup') && !componentRegistry.has('findReplace') && !componentRegistry.has('aiExperience') && !componentRegistry.has('loom')
|
|
55
|
+
}];
|
|
56
|
+
const others = [{
|
|
57
|
+
name: 'beforePrimaryToolbar'
|
|
58
|
+
}, {
|
|
59
|
+
name: 'avatarGroup'
|
|
60
|
+
}, {
|
|
61
|
+
name: 'findReplace'
|
|
62
|
+
}, {
|
|
63
|
+
// TODO: Should likely be split into three: spelling & grammar, separator, and AI trigger
|
|
64
|
+
name: 'aiExperience'
|
|
65
|
+
}, {
|
|
66
|
+
name: 'loom'
|
|
67
|
+
}];
|
|
68
|
+
const toolbarConfiguration = [...undoRedoGroup, ...blockTypeGroup, ...textFormattingGroup, ...alignmentGroup, ...textColorGroup, ...listFormatting, ...insertBlockGroup, ...others];
|
|
@@ -53,4 +53,34 @@ var textColorGroup = [{
|
|
|
53
53
|
return componentRegistry.has('textColor') || componentRegistry.has('highlight');
|
|
54
54
|
}
|
|
55
55
|
}];
|
|
56
|
-
var
|
|
56
|
+
var listFormatting = [{
|
|
57
|
+
name: 'toolbarListsIndentation'
|
|
58
|
+
}, {
|
|
59
|
+
name: 'separator',
|
|
60
|
+
enabled: function enabled(componentRegistry) {
|
|
61
|
+
return componentRegistry.has('toolbarListsIndentation');
|
|
62
|
+
}
|
|
63
|
+
}];
|
|
64
|
+
var insertBlockGroup = [{
|
|
65
|
+
name: 'insertBlock'
|
|
66
|
+
}, {
|
|
67
|
+
name: 'separator',
|
|
68
|
+
enabled: function enabled(componentRegistry) {
|
|
69
|
+
return componentRegistry.has('insertBlock') &&
|
|
70
|
+
// is last group in the toolbar
|
|
71
|
+
!componentRegistry.has('beforePrimaryToolbar') && !componentRegistry.has('avatarGroup') && !componentRegistry.has('findReplace') && !componentRegistry.has('aiExperience') && !componentRegistry.has('loom');
|
|
72
|
+
}
|
|
73
|
+
}];
|
|
74
|
+
var others = [{
|
|
75
|
+
name: 'beforePrimaryToolbar'
|
|
76
|
+
}, {
|
|
77
|
+
name: 'avatarGroup'
|
|
78
|
+
}, {
|
|
79
|
+
name: 'findReplace'
|
|
80
|
+
}, {
|
|
81
|
+
// TODO: Should likely be split into three: spelling & grammar, separator, and AI trigger
|
|
82
|
+
name: 'aiExperience'
|
|
83
|
+
}, {
|
|
84
|
+
name: 'loom'
|
|
85
|
+
}];
|
|
86
|
+
var toolbarConfiguration = [].concat(undoRedoGroup, blockTypeGroup, textFormattingGroup, alignmentGroup, textColorGroup, listFormatting, insertBlockGroup, others);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type PrimaryToolbarPlugin = NextEditorPlugin<'primaryToolbar', {
|
|
|
9
9
|
};
|
|
10
10
|
}>;
|
|
11
11
|
type ComponentRegistry = Map<string, ToolbarUIComponentFactory>;
|
|
12
|
-
export type ToolbarElementNames = 'separator' | 'undoRedoPlugin' | 'blockType' | 'textFormatting' | 'alignment' | 'textColor' | 'highlight';
|
|
12
|
+
export type ToolbarElementNames = 'separator' | 'undoRedoPlugin' | 'blockType' | 'textFormatting' | 'alignment' | 'textColor' | 'highlight' | 'toolbarListsIndentation' | 'insertBlock' | 'beforePrimaryToolbar' | 'avatarGroup' | 'findReplace' | 'aiExperience' | 'loom';
|
|
13
13
|
export type ToolbarElementConfig = {
|
|
14
14
|
name: ToolbarElementNames;
|
|
15
15
|
enabled?: (componentRegistry: ComponentRegistry) => boolean;
|
|
@@ -9,7 +9,7 @@ export type PrimaryToolbarPlugin = NextEditorPlugin<'primaryToolbar', {
|
|
|
9
9
|
};
|
|
10
10
|
}>;
|
|
11
11
|
type ComponentRegistry = Map<string, ToolbarUIComponentFactory>;
|
|
12
|
-
export type ToolbarElementNames = 'separator' | 'undoRedoPlugin' | 'blockType' | 'textFormatting' | 'alignment' | 'textColor' | 'highlight';
|
|
12
|
+
export type ToolbarElementNames = 'separator' | 'undoRedoPlugin' | 'blockType' | 'textFormatting' | 'alignment' | 'textColor' | 'highlight' | 'toolbarListsIndentation' | 'insertBlock' | 'beforePrimaryToolbar' | 'avatarGroup' | 'findReplace' | 'aiExperience' | 'loom';
|
|
13
13
|
export type ToolbarElementConfig = {
|
|
14
14
|
name: ToolbarElementNames;
|
|
15
15
|
enabled?: (componentRegistry: ComponentRegistry) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-primary-toolbar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Primary toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
".": "./src/index.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^85.
|
|
41
|
+
"@atlaskit/editor-common": "^85.1.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|