@atlaskit/editor-plugin-block-type 4.3.2 → 4.5.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,29 @@
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
2
2
|
|
3
|
+
## 4.5.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#116949](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116949)
|
8
|
+
[`9154f7b89e3d2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9154f7b89e3d2) -
|
9
|
+
[ux] ED-26674 Hiding contextual toolbar menu items when the menu is docked to top
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- Updated dependencies
|
14
|
+
|
15
|
+
## 4.4.0
|
16
|
+
|
17
|
+
### Minor Changes
|
18
|
+
|
19
|
+
- [#116013](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116013)
|
20
|
+
[`18e022766bfd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18e022766bfd3) -
|
21
|
+
[ux] ED-26464 Hiding primary toolbar and docking contextual toolbar items to top
|
22
|
+
|
23
|
+
### Patch Changes
|
24
|
+
|
25
|
+
- Updated dependencies
|
26
|
+
|
3
27
|
## 4.3.2
|
4
28
|
|
5
29
|
### Patch Changes
|
@@ -107,6 +107,13 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
107
107
|
toolbarSize = _ref4.toolbarSize,
|
108
108
|
disabled = _ref4.disabled,
|
109
109
|
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
110
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
|
111
|
+
exposure: true
|
112
|
+
})) {
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_FloatingToolbarComponent.FloatingToolbarComponent, {
|
114
|
+
api: api
|
115
|
+
});
|
116
|
+
}
|
110
117
|
var isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < _types.ToolbarSize.XXL : toolbarSize < _types.ToolbarSize.XL;
|
111
118
|
if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_responsive_fixes')) {
|
112
119
|
isSmall = toolbarSize < _types.ToolbarSize.XXL;
|
@@ -205,6 +212,12 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
|
|
205
212
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
206
213
|
pluginsOptions: {
|
207
214
|
selectionToolbar: function selectionToolbar() {
|
215
|
+
var _api$selectionToolbar;
|
216
|
+
if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
|
217
|
+
exposure: true
|
218
|
+
})) {
|
219
|
+
return undefined;
|
220
|
+
}
|
208
221
|
if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
|
209
222
|
exposure: true
|
210
223
|
}) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
|
@@ -7,7 +7,7 @@ import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
7
7
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
9
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
10
|
-
import {
|
10
|
+
import { clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
11
11
|
import inputRulePlugin from './pm-plugins/input-rule';
|
12
12
|
import keymapPlugin from './pm-plugins/keymap';
|
13
13
|
import { createPlugin, pluginKey } from './pm-plugins/main';
|
@@ -99,6 +99,13 @@ const blockTypePlugin = ({
|
|
99
99
|
disabled,
|
100
100
|
isToolbarReducedSpacing
|
101
101
|
}) => {
|
102
|
+
if (editorExperiment('platform_editor_controls', 'variant1', {
|
103
|
+
exposure: true
|
104
|
+
})) {
|
105
|
+
return /*#__PURE__*/React.createElement(FloatingToolbarComponent, {
|
106
|
+
api: api
|
107
|
+
});
|
108
|
+
}
|
102
109
|
let isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < ToolbarSize.XXL : toolbarSize < ToolbarSize.XL;
|
103
110
|
if (fg('platform_editor_toolbar_responsive_fixes')) {
|
104
111
|
isSmall = toolbarSize < ToolbarSize.XXL;
|
@@ -195,6 +202,12 @@ const blockTypePlugin = ({
|
|
195
202
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
196
203
|
pluginsOptions: {
|
197
204
|
selectionToolbar: () => {
|
205
|
+
var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
|
206
|
+
if ((api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
|
207
|
+
exposure: true
|
208
|
+
})) {
|
209
|
+
return undefined;
|
210
|
+
}
|
198
211
|
if (editorExperiment('contextual_formatting_toolbar', true, {
|
199
212
|
exposure: true
|
200
213
|
}) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
|
@@ -8,7 +8,7 @@ import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
8
8
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
11
|
-
import {
|
11
|
+
import { clearFormatting as _clearFormatting, insertBlockQuoteWithAnalytics, insertBlockQuoteWithAnalyticsCommand, setBlockTypeWithAnalytics } from './pm-plugins/commands/block-type';
|
12
12
|
import inputRulePlugin from './pm-plugins/input-rule';
|
13
13
|
import keymapPlugin from './pm-plugins/keymap';
|
14
14
|
import { createPlugin, pluginKey } from './pm-plugins/main';
|
@@ -100,6 +100,13 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
100
100
|
toolbarSize = _ref4.toolbarSize,
|
101
101
|
disabled = _ref4.disabled,
|
102
102
|
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
103
|
+
if (editorExperiment('platform_editor_controls', 'variant1', {
|
104
|
+
exposure: true
|
105
|
+
})) {
|
106
|
+
return /*#__PURE__*/React.createElement(FloatingToolbarComponent, {
|
107
|
+
api: api
|
108
|
+
});
|
109
|
+
}
|
103
110
|
var isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < ToolbarSize.XXL : toolbarSize < ToolbarSize.XL;
|
104
111
|
if (fg('platform_editor_toolbar_responsive_fixes')) {
|
105
112
|
isSmall = toolbarSize < ToolbarSize.XXL;
|
@@ -198,6 +205,12 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
198
205
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
|
199
206
|
pluginsOptions: {
|
200
207
|
selectionToolbar: function selectionToolbar() {
|
208
|
+
var _api$selectionToolbar;
|
209
|
+
if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
|
210
|
+
exposure: true
|
211
|
+
})) {
|
212
|
+
return undefined;
|
213
|
+
}
|
201
214
|
if (editorExperiment('contextual_formatting_toolbar', true, {
|
202
215
|
exposure: true
|
203
216
|
}) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
|
@@ -1,13 +1,18 @@
|
|
1
1
|
import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
3
3
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
4
|
+
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
4
5
|
import type { TextBlockTypes } from './pm-plugins/block-types';
|
5
|
-
import type {
|
6
|
+
import type { ClearFormattingInputMethod, InputMethod } from './pm-plugins/commands/block-type';
|
6
7
|
import type { BlockTypeState } from './pm-plugins/main';
|
7
8
|
import type { BlockTypePluginOptions } from './pm-plugins/types';
|
8
9
|
export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
9
10
|
pluginConfiguration: BlockTypePluginOptions | undefined;
|
10
|
-
dependencies: [
|
11
|
+
dependencies: [
|
12
|
+
OptionalPlugin<AnalyticsPlugin>,
|
13
|
+
OptionalPlugin<PrimaryToolbarPlugin>,
|
14
|
+
OptionalPlugin<SelectionToolbarPlugin>
|
15
|
+
];
|
11
16
|
sharedState: BlockTypeState | undefined;
|
12
17
|
actions: {
|
13
18
|
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
@@ -1,15 +1,17 @@
|
|
1
1
|
import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
3
3
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
4
|
+
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
4
5
|
import type { TextBlockTypes } from './pm-plugins/block-types';
|
5
|
-
import type {
|
6
|
+
import type { ClearFormattingInputMethod, InputMethod } from './pm-plugins/commands/block-type';
|
6
7
|
import type { BlockTypeState } from './pm-plugins/main';
|
7
8
|
import type { BlockTypePluginOptions } from './pm-plugins/types';
|
8
9
|
export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
9
10
|
pluginConfiguration: BlockTypePluginOptions | undefined;
|
10
11
|
dependencies: [
|
11
12
|
OptionalPlugin<AnalyticsPlugin>,
|
12
|
-
OptionalPlugin<PrimaryToolbarPlugin
|
13
|
+
OptionalPlugin<PrimaryToolbarPlugin>,
|
14
|
+
OptionalPlugin<SelectionToolbarPlugin>
|
13
15
|
];
|
14
16
|
sharedState: BlockTypeState | undefined;
|
15
17
|
actions: {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.5.0",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -34,18 +34,19 @@
|
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
36
|
"@atlaskit/adf-schema": "^47.2.1",
|
37
|
-
"@atlaskit/editor-common": "^99.
|
37
|
+
"@atlaskit/editor-common": "^99.18.0",
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.12.0",
|
39
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^2.
|
39
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^2.3.0",
|
40
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^1.9.0",
|
40
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
41
42
|
"@atlaskit/editor-shared-styles": "^3.3.0",
|
42
43
|
"@atlaskit/editor-tables": "^2.9.0",
|
43
|
-
"@atlaskit/icon": "^23.
|
44
|
+
"@atlaskit/icon": "^23.11.0",
|
44
45
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
45
|
-
"@atlaskit/primitives": "^13.
|
46
|
+
"@atlaskit/primitives": "^13.6.0",
|
46
47
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
47
48
|
"@atlaskit/theme": "^16.0.0",
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^2.47.0",
|
49
50
|
"@atlaskit/tokens": "^3.3.0",
|
50
51
|
"@babel/runtime": "^7.0.0",
|
51
52
|
"@emotion/react": "^11.7.1"
|