@atlaskit/editor-plugin-insert-block 4.2.1 → 4.3.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 +17 -0
- package/dist/cjs/insertBlockPlugin.js +2 -1
- package/dist/cjs/ui/toolbar-components.js +5 -3
- package/dist/es2019/insertBlockPlugin.js +2 -1
- package/dist/es2019/ui/toolbar-components.js +4 -3
- package/dist/esm/insertBlockPlugin.js +2 -1
- package/dist/esm/ui/toolbar-components.js +5 -3
- package/dist/types/types/index.d.ts +8 -0
- package/dist/types/ui/toolbar-components.d.ts +2 -1
- package/dist/types-ts4.5/types/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/toolbar-components.d.ts +2 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 4.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d4b3d46926b3b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4b3d46926b3b) -
|
|
8
|
+
[ux] ED-29014 add new option to insert block plugin to only show the plus button in the toolbar.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 4.2.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 4.2.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -166,7 +166,8 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
|
|
|
166
166
|
var _api$toolbar;
|
|
167
167
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)({
|
|
168
168
|
api: api,
|
|
169
|
-
tableSelectorSupported: options.tableSelectorSupported
|
|
169
|
+
tableSelectorSupported: options.tableSelectorSupported,
|
|
170
|
+
toolbarShowPlusInsertOnly: options.toolbarShowPlusInsertOnly
|
|
170
171
|
}));
|
|
171
172
|
} else {
|
|
172
173
|
var _api$primaryToolbar;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getToolbarComponents = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
11
|
var _EmojiButton = require("./toolbar-components/EmojiButton");
|
|
@@ -17,7 +18,8 @@ var _TableSizePicker = require("./toolbar-components/TableSizePicker");
|
|
|
17
18
|
var _TaskListButton = require("./toolbar-components/TaskListButton");
|
|
18
19
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(_ref) {
|
|
19
20
|
var api = _ref.api,
|
|
20
|
-
tableSelectorSupported = _ref.tableSelectorSupported
|
|
21
|
+
tableSelectorSupported = _ref.tableSelectorSupported,
|
|
22
|
+
toolbarShowPlusInsertOnly = _ref.toolbarShowPlusInsertOnly;
|
|
21
23
|
return [{
|
|
22
24
|
type: _toolbar.INSERT_BLOCK_SECTION.type,
|
|
23
25
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
@@ -26,7 +28,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
26
28
|
key: _toolbar.TOOLBARS.PRIMARY_TOOLBAR,
|
|
27
29
|
rank: _toolbar.TOOLBAR_RANK[_toolbar.INSERT_BLOCK_SECTION.key]
|
|
28
30
|
}]
|
|
29
|
-
}, {
|
|
31
|
+
}].concat((0, _toConsumableArray2.default)(toolbarShowPlusInsertOnly ? [] : [{
|
|
30
32
|
type: _toolbar.TASK_LIST_GROUP.type,
|
|
31
33
|
key: _toolbar.TASK_LIST_GROUP.key,
|
|
32
34
|
parents: [{
|
|
@@ -168,5 +170,5 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
168
170
|
tableSelectorSupported: tableSelectorSupported
|
|
169
171
|
});
|
|
170
172
|
}
|
|
171
|
-
}];
|
|
173
|
+
}]));
|
|
172
174
|
};
|
|
@@ -151,7 +151,8 @@ export const insertBlockPlugin = ({
|
|
|
151
151
|
var _api$toolbar;
|
|
152
152
|
api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents({
|
|
153
153
|
api,
|
|
154
|
-
tableSelectorSupported: options.tableSelectorSupported
|
|
154
|
+
tableSelectorSupported: options.tableSelectorSupported,
|
|
155
|
+
toolbarShowPlusInsertOnly: options.toolbarShowPlusInsertOnly
|
|
155
156
|
}));
|
|
156
157
|
} else {
|
|
157
158
|
var _api$primaryToolbar;
|
|
@@ -10,7 +10,8 @@ import { TableSizePicker } from './toolbar-components/TableSizePicker';
|
|
|
10
10
|
import { TaskListButton } from './toolbar-components/TaskListButton';
|
|
11
11
|
export const getToolbarComponents = ({
|
|
12
12
|
api,
|
|
13
|
-
tableSelectorSupported
|
|
13
|
+
tableSelectorSupported,
|
|
14
|
+
toolbarShowPlusInsertOnly
|
|
14
15
|
}) => {
|
|
15
16
|
return [{
|
|
16
17
|
type: INSERT_BLOCK_SECTION.type,
|
|
@@ -20,7 +21,7 @@ export const getToolbarComponents = ({
|
|
|
20
21
|
key: TOOLBARS.PRIMARY_TOOLBAR,
|
|
21
22
|
rank: TOOLBAR_RANK[INSERT_BLOCK_SECTION.key]
|
|
22
23
|
}]
|
|
23
|
-
}, {
|
|
24
|
+
}, ...(toolbarShowPlusInsertOnly ? [] : [{
|
|
24
25
|
type: TASK_LIST_GROUP.type,
|
|
25
26
|
key: TASK_LIST_GROUP.key,
|
|
26
27
|
parents: [{
|
|
@@ -148,5 +149,5 @@ export const getToolbarComponents = ({
|
|
|
148
149
|
api: api,
|
|
149
150
|
tableSelectorSupported: tableSelectorSupported
|
|
150
151
|
})
|
|
151
|
-
}];
|
|
152
|
+
}])];
|
|
152
153
|
};
|
|
@@ -156,7 +156,8 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
156
156
|
var _api$toolbar;
|
|
157
157
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents({
|
|
158
158
|
api: api,
|
|
159
|
-
tableSelectorSupported: options.tableSelectorSupported
|
|
159
|
+
tableSelectorSupported: options.tableSelectorSupported,
|
|
160
|
+
toolbarShowPlusInsertOnly: options.toolbarShowPlusInsertOnly
|
|
160
161
|
}));
|
|
161
162
|
} else {
|
|
162
163
|
var _api$primaryToolbar;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { INSERT_BLOCK_SECTION, TASK_LIST_GROUP, MEDIA_GROUP, TOOLBAR_RANK, TOOLBARS, INSERT_BLOCK_SECTION_RANK, TASK_LIST_BUTTON, TASK_LIST_GROUP_RANK, MEDIA_BUTTON, MENTION_GROUP, MEDIA_GROUP_RANK, MENTION_BUTTON, MENTION_GROUP_RANK, EMOJI_GROUP, EMOJI_BUTTON, EMOJI_GROUP_RANK, LAYOUT_GROUP, LAYOUT_BUTTON, LAYOUT_GROUP_RANK, TABLE_GROUP_RANK, TABLE_BUTTON, TABLE_GROUP, TABLE_SIZE_PICKER } from '@atlaskit/editor-common/toolbar';
|
|
3
4
|
import { EmojiButton } from './toolbar-components/EmojiButton';
|
|
@@ -10,7 +11,8 @@ import { TableSizePicker } from './toolbar-components/TableSizePicker';
|
|
|
10
11
|
import { TaskListButton } from './toolbar-components/TaskListButton';
|
|
11
12
|
export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
12
13
|
var api = _ref.api,
|
|
13
|
-
tableSelectorSupported = _ref.tableSelectorSupported
|
|
14
|
+
tableSelectorSupported = _ref.tableSelectorSupported,
|
|
15
|
+
toolbarShowPlusInsertOnly = _ref.toolbarShowPlusInsertOnly;
|
|
14
16
|
return [{
|
|
15
17
|
type: INSERT_BLOCK_SECTION.type,
|
|
16
18
|
key: INSERT_BLOCK_SECTION.key,
|
|
@@ -19,7 +21,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
19
21
|
key: TOOLBARS.PRIMARY_TOOLBAR,
|
|
20
22
|
rank: TOOLBAR_RANK[INSERT_BLOCK_SECTION.key]
|
|
21
23
|
}]
|
|
22
|
-
}
|
|
24
|
+
}].concat(_toConsumableArray(toolbarShowPlusInsertOnly ? [] : [{
|
|
23
25
|
type: TASK_LIST_GROUP.type,
|
|
24
26
|
key: TASK_LIST_GROUP.key,
|
|
25
27
|
parents: [{
|
|
@@ -161,5 +163,5 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
161
163
|
tableSelectorSupported: tableSelectorSupported
|
|
162
164
|
});
|
|
163
165
|
}
|
|
164
|
-
}];
|
|
166
|
+
}]));
|
|
165
167
|
};
|
|
@@ -69,6 +69,14 @@ export interface InsertBlockPluginOptions {
|
|
|
69
69
|
showElementBrowserLink?: boolean;
|
|
70
70
|
tableSelectorSupported?: boolean;
|
|
71
71
|
appearance?: EditorAppearance;
|
|
72
|
+
/**
|
|
73
|
+
* To hide the individual insert block buttons in the toolbar
|
|
74
|
+
* and only show the plus button
|
|
75
|
+
* @default undefined Shows the insert block buttons and the plus button
|
|
76
|
+
*
|
|
77
|
+
* Only applies when platform_editor_toolbar_aifc is enabled
|
|
78
|
+
*/
|
|
79
|
+
toolbarShowPlusInsertOnly?: boolean;
|
|
72
80
|
}
|
|
73
81
|
/**
|
|
74
82
|
* @private
|
|
@@ -4,6 +4,7 @@ import type { InsertBlockPlugin } from '../insertBlockPluginType';
|
|
|
4
4
|
type GetToolbarComponentsProps = {
|
|
5
5
|
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
6
6
|
tableSelectorSupported?: boolean;
|
|
7
|
+
toolbarShowPlusInsertOnly?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare const getToolbarComponents: ({ api, tableSelectorSupported, }: GetToolbarComponentsProps) => RegisterComponent[];
|
|
9
|
+
export declare const getToolbarComponents: ({ api, tableSelectorSupported, toolbarShowPlusInsertOnly, }: GetToolbarComponentsProps) => RegisterComponent[];
|
|
9
10
|
export {};
|
|
@@ -69,6 +69,14 @@ export interface InsertBlockPluginOptions {
|
|
|
69
69
|
showElementBrowserLink?: boolean;
|
|
70
70
|
tableSelectorSupported?: boolean;
|
|
71
71
|
appearance?: EditorAppearance;
|
|
72
|
+
/**
|
|
73
|
+
* To hide the individual insert block buttons in the toolbar
|
|
74
|
+
* and only show the plus button
|
|
75
|
+
* @default undefined Shows the insert block buttons and the plus button
|
|
76
|
+
*
|
|
77
|
+
* Only applies when platform_editor_toolbar_aifc is enabled
|
|
78
|
+
*/
|
|
79
|
+
toolbarShowPlusInsertOnly?: boolean;
|
|
72
80
|
}
|
|
73
81
|
/**
|
|
74
82
|
* @private
|
|
@@ -4,6 +4,7 @@ import type { InsertBlockPlugin } from '../insertBlockPluginType';
|
|
|
4
4
|
type GetToolbarComponentsProps = {
|
|
5
5
|
api?: ExtractInjectionAPI<InsertBlockPlugin>;
|
|
6
6
|
tableSelectorSupported?: boolean;
|
|
7
|
+
toolbarShowPlusInsertOnly?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare const getToolbarComponents: ({ api, tableSelectorSupported, }: GetToolbarComponentsProps) => RegisterComponent[];
|
|
9
|
+
export declare const getToolbarComponents: ({ api, tableSelectorSupported, toolbarShowPlusInsertOnly, }: GetToolbarComponentsProps) => RegisterComponent[];
|
|
9
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-code-block": "^5.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-connectivity": "^3.1.0",
|
|
40
40
|
"@atlaskit/editor-plugin-date": "^5.1.0",
|
|
41
|
-
"@atlaskit/editor-plugin-emoji": "^4.
|
|
41
|
+
"@atlaskit/editor-plugin-emoji": "^4.3.0",
|
|
42
42
|
"@atlaskit/editor-plugin-expand": "^4.2.0",
|
|
43
43
|
"@atlaskit/editor-plugin-extension": "^6.1.0",
|
|
44
44
|
"@atlaskit/editor-plugin-feature-flags": "^2.0.0",
|
|
@@ -56,21 +56,21 @@
|
|
|
56
56
|
"@atlaskit/editor-plugin-rule": "^3.0.0",
|
|
57
57
|
"@atlaskit/editor-plugin-status": "^4.1.0",
|
|
58
58
|
"@atlaskit/editor-plugin-table": "^12.2.0",
|
|
59
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^6.
|
|
60
|
-
"@atlaskit/editor-plugin-toolbar": "^0.
|
|
59
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^6.4.0",
|
|
60
|
+
"@atlaskit/editor-plugin-toolbar": "^0.3.0",
|
|
61
61
|
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
62
62
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
63
63
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
64
64
|
"@atlaskit/editor-toolbar": "^0.3.0",
|
|
65
65
|
"@atlaskit/editor-toolbar-model": "^0.1.0",
|
|
66
|
-
"@atlaskit/emoji": "^69.
|
|
66
|
+
"@atlaskit/emoji": "^69.5.0",
|
|
67
67
|
"@atlaskit/heading": "^5.2.0",
|
|
68
|
-
"@atlaskit/icon": "^
|
|
68
|
+
"@atlaskit/icon": "^28.0.0",
|
|
69
69
|
"@atlaskit/icon-lab": "^5.6.0",
|
|
70
70
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
71
71
|
"@atlaskit/primitives": "^14.11.0",
|
|
72
72
|
"@atlaskit/theme": "^19.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^11.3.0",
|
|
74
74
|
"@atlaskit/tokens": "^6.0.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.4.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"react-virtualized": "^9.8.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@atlaskit/editor-common": "^107.
|
|
84
|
+
"@atlaskit/editor-common": "^107.26.0",
|
|
85
85
|
"react": "^18.2.0",
|
|
86
86
|
"react-dom": "^18.2.0",
|
|
87
87
|
"react-intl-next": "npm:react-intl@^5.18.1"
|