@atlaskit/editor-plugin-insert-block 7.0.21 → 7.0.23
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 +15 -0
- package/dist/cjs/pm-plugins/toggleInsertBlock.js +2 -0
- package/dist/cjs/ui/toolbar-components/config-resolver.js +5 -3
- package/dist/cjs/ui/toolbar-components.js +13 -9
- package/dist/es2019/pm-plugins/toggleInsertBlock.js +4 -0
- package/dist/es2019/ui/toolbar-components/config-resolver.js +5 -3
- package/dist/es2019/ui/toolbar-components.js +13 -9
- package/dist/esm/pm-plugins/toggleInsertBlock.js +2 -0
- package/dist/esm/ui/toolbar-components/config-resolver.js +5 -3
- package/dist/esm/ui/toolbar-components.js +13 -9
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types-ts4.5/types/index.d.ts +2 -0
- package/package.json +11 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 7.0.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 7.0.22
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
14
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
15
|
+
project refs are setup
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 7.0.21
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -11,11 +11,13 @@ var toggleInsertBlockPmPlugin = exports.toggleInsertBlockPmPlugin = function tog
|
|
|
11
11
|
return new _safePlugin.SafePlugin({
|
|
12
12
|
key: toggleInsertBlockPmKey,
|
|
13
13
|
state: {
|
|
14
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
14
15
|
init: function init() {
|
|
15
16
|
return {
|
|
16
17
|
showElementBrowser: false
|
|
17
18
|
};
|
|
18
19
|
},
|
|
20
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
19
21
|
apply: function apply(tr, pluginState) {
|
|
20
22
|
var meta = tr.getMeta(toggleInsertBlockPmKey);
|
|
21
23
|
if (!meta) {
|
|
@@ -69,12 +69,14 @@ var resolveToolbarConfig = exports.resolveToolbarConfig = function resolveToolba
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
var defaults = {
|
|
72
|
-
enabled: false
|
|
72
|
+
enabled: false,
|
|
73
|
+
showAt: 'lg'
|
|
73
74
|
};
|
|
74
75
|
var resolveGroupConfig = function resolveGroupConfig(groupConfig) {
|
|
75
|
-
var _groupConfig$enabled;
|
|
76
|
+
var _groupConfig$enabled, _groupConfig$showAt;
|
|
76
77
|
return {
|
|
77
|
-
enabled: (_groupConfig$enabled = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.enabled) !== null && _groupConfig$enabled !== void 0 ? _groupConfig$enabled : defaults.enabled
|
|
78
|
+
enabled: (_groupConfig$enabled = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.enabled) !== null && _groupConfig$enabled !== void 0 ? _groupConfig$enabled : defaults.enabled,
|
|
79
|
+
showAt: (_groupConfig$showAt = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.showAt) !== null && _groupConfig$showAt !== void 0 ? _groupConfig$showAt : defaults.showAt
|
|
78
80
|
};
|
|
79
81
|
};
|
|
80
82
|
return {
|
|
@@ -8,6 +8,7 @@ exports.getToolbarComponents = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
10
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
13
|
var _CodeBlockButton = require("./toolbar-components/CodeBlockButton");
|
|
13
14
|
var _configResolver = require("./toolbar-components/config-resolver");
|
|
@@ -33,17 +34,18 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
33
34
|
var components = [];
|
|
34
35
|
|
|
35
36
|
// Helper function to create responsive wrapper component
|
|
36
|
-
var createResponsiveComponent = function createResponsiveComponent() {
|
|
37
|
+
var createResponsiveComponent = function createResponsiveComponent(showAt) {
|
|
37
38
|
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
|
|
38
39
|
var children = _ref2.children;
|
|
39
40
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
|
|
40
|
-
above:
|
|
41
|
+
above: (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_undo_redo_confluence') ? showAt || 'lg' : 'lg'
|
|
41
42
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
|
|
42
43
|
} : undefined;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
// TaskList Group
|
|
46
47
|
if ((_config$taskList = config.taskList) !== null && _config$taskList !== void 0 && _config$taskList.enabled) {
|
|
48
|
+
var _config$taskList2;
|
|
47
49
|
components.push({
|
|
48
50
|
type: _toolbar.TASK_LIST_GROUP.type,
|
|
49
51
|
key: _toolbar.TASK_LIST_GROUP.key,
|
|
@@ -52,7 +54,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
52
54
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
53
55
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.TASK_LIST_GROUP.key]
|
|
54
56
|
}],
|
|
55
|
-
component: createResponsiveComponent()
|
|
57
|
+
component: createResponsiveComponent((_config$taskList2 = config.taskList) === null || _config$taskList2 === void 0 ? void 0 : _config$taskList2.showAt)
|
|
56
58
|
});
|
|
57
59
|
components.push({
|
|
58
60
|
type: _toolbar.TASK_LIST_BUTTON.type,
|
|
@@ -72,6 +74,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
72
74
|
|
|
73
75
|
// Media Group
|
|
74
76
|
if ((_config$media = config.media) !== null && _config$media !== void 0 && _config$media.enabled) {
|
|
77
|
+
var _config$media2;
|
|
75
78
|
components.push({
|
|
76
79
|
type: _toolbar.MEDIA_GROUP.type,
|
|
77
80
|
key: _toolbar.MEDIA_GROUP.key,
|
|
@@ -80,7 +83,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
80
83
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
81
84
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.MEDIA_GROUP.key]
|
|
82
85
|
}],
|
|
83
|
-
component: createResponsiveComponent()
|
|
86
|
+
component: createResponsiveComponent((_config$media2 = config.media) === null || _config$media2 === void 0 ? void 0 : _config$media2.showAt)
|
|
84
87
|
});
|
|
85
88
|
components.push({
|
|
86
89
|
type: _toolbar.MEDIA_BUTTON.type,
|
|
@@ -102,6 +105,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
102
105
|
|
|
103
106
|
// CodeBlock Group
|
|
104
107
|
if ((_config$codeBlock = config.codeBlock) !== null && _config$codeBlock !== void 0 && _config$codeBlock.enabled) {
|
|
108
|
+
var _config$codeBlock2;
|
|
105
109
|
components.push({
|
|
106
110
|
type: _toolbar.CODE_BLOCK_GROUP.type,
|
|
107
111
|
key: _toolbar.CODE_BLOCK_GROUP.key,
|
|
@@ -110,7 +114,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
110
114
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
111
115
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.CODE_BLOCK_GROUP.key]
|
|
112
116
|
}],
|
|
113
|
-
component: createResponsiveComponent()
|
|
117
|
+
component: createResponsiveComponent((_config$codeBlock2 = config.codeBlock) === null || _config$codeBlock2 === void 0 ? void 0 : _config$codeBlock2.showAt)
|
|
114
118
|
});
|
|
115
119
|
components.push({
|
|
116
120
|
type: _toolbar.CODE_BLOCK_BUTTON.type,
|
|
@@ -138,7 +142,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
138
142
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
139
143
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.MENTION_GROUP.key]
|
|
140
144
|
}],
|
|
141
|
-
component: createResponsiveComponent()
|
|
145
|
+
component: createResponsiveComponent(config.mention.showAt)
|
|
142
146
|
});
|
|
143
147
|
components.push({
|
|
144
148
|
type: _toolbar.MENTION_BUTTON.type,
|
|
@@ -166,7 +170,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
166
170
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
167
171
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.EMOJI_GROUP.key]
|
|
168
172
|
}],
|
|
169
|
-
component: createResponsiveComponent()
|
|
173
|
+
component: createResponsiveComponent(config.emoji.showAt)
|
|
170
174
|
});
|
|
171
175
|
components.push({
|
|
172
176
|
type: _toolbar.EMOJI_BUTTON.type,
|
|
@@ -194,7 +198,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
194
198
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
195
199
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.LAYOUT_GROUP.key]
|
|
196
200
|
}],
|
|
197
|
-
component: createResponsiveComponent()
|
|
201
|
+
component: createResponsiveComponent(config.layout.showAt)
|
|
198
202
|
});
|
|
199
203
|
components.push({
|
|
200
204
|
type: _toolbar.LAYOUT_BUTTON.type,
|
|
@@ -222,7 +226,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
222
226
|
key: _toolbar.INSERT_BLOCK_SECTION.key,
|
|
223
227
|
rank: _toolbar.INSERT_BLOCK_SECTION_RANK[_toolbar.TABLE_GROUP.key]
|
|
224
228
|
}],
|
|
225
|
-
component: createResponsiveComponent()
|
|
229
|
+
component: createResponsiveComponent(config.table.showAt)
|
|
226
230
|
});
|
|
227
231
|
components.push({
|
|
228
232
|
type: _toolbar.TABLE_BUTTON.type,
|
|
@@ -4,11 +4,15 @@ export const toggleInsertBlockPmKey = new PluginKey('toggleInsertBlockPmKey');
|
|
|
4
4
|
export const toggleInsertBlockPmPlugin = () => new SafePlugin({
|
|
5
5
|
key: toggleInsertBlockPmKey,
|
|
6
6
|
state: {
|
|
7
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
8
|
+
|
|
7
9
|
init() {
|
|
8
10
|
return {
|
|
9
11
|
showElementBrowser: false
|
|
10
12
|
};
|
|
11
13
|
},
|
|
14
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
15
|
+
|
|
12
16
|
apply(tr, pluginState) {
|
|
13
17
|
const meta = tr.getMeta(toggleInsertBlockPmKey);
|
|
14
18
|
if (!meta) {
|
|
@@ -63,12 +63,14 @@ export const resolveToolbarConfig = options => {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
const defaults = {
|
|
66
|
-
enabled: false
|
|
66
|
+
enabled: false,
|
|
67
|
+
showAt: 'lg'
|
|
67
68
|
};
|
|
68
69
|
const resolveGroupConfig = groupConfig => {
|
|
69
|
-
var _groupConfig$enabled;
|
|
70
|
+
var _groupConfig$enabled, _groupConfig$showAt;
|
|
70
71
|
return {
|
|
71
|
-
enabled: (_groupConfig$enabled = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.enabled) !== null && _groupConfig$enabled !== void 0 ? _groupConfig$enabled : defaults.enabled
|
|
72
|
+
enabled: (_groupConfig$enabled = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.enabled) !== null && _groupConfig$enabled !== void 0 ? _groupConfig$enabled : defaults.enabled,
|
|
73
|
+
showAt: (_groupConfig$showAt = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.showAt) !== null && _groupConfig$showAt !== void 0 ? _groupConfig$showAt : defaults.showAt
|
|
72
74
|
};
|
|
73
75
|
};
|
|
74
76
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { INSERT_BLOCK_SECTION, TASK_LIST_GROUP, MEDIA_GROUP, 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, INSERT_GROUP, INSERT_BUTTON, INSERT_GROUP_RANK, CODE_BLOCK_GROUP, CODE_BLOCK_BUTTON, CODE_BLOCK_GROUP_RANK } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { Show, ToolbarButtonGroup } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
import { CodeBlockButton } from './toolbar-components/CodeBlockButton';
|
|
6
7
|
import { resolveToolbarConfig } from './toolbar-components/config-resolver';
|
|
@@ -27,16 +28,17 @@ export const getToolbarComponents = ({
|
|
|
27
28
|
const components = [];
|
|
28
29
|
|
|
29
30
|
// Helper function to create responsive wrapper component
|
|
30
|
-
const createResponsiveComponent =
|
|
31
|
+
const createResponsiveComponent = showAt => {
|
|
31
32
|
return expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? ({
|
|
32
33
|
children
|
|
33
34
|
}) => /*#__PURE__*/React.createElement(Show, {
|
|
34
|
-
above:
|
|
35
|
+
above: fg('platform_editor_toolbar_aifc_undo_redo_confluence') ? showAt || 'lg' : 'lg'
|
|
35
36
|
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children)) : undefined;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
// TaskList Group
|
|
39
40
|
if ((_config$taskList = config.taskList) !== null && _config$taskList !== void 0 && _config$taskList.enabled) {
|
|
41
|
+
var _config$taskList2;
|
|
40
42
|
components.push({
|
|
41
43
|
type: TASK_LIST_GROUP.type,
|
|
42
44
|
key: TASK_LIST_GROUP.key,
|
|
@@ -45,7 +47,7 @@ export const getToolbarComponents = ({
|
|
|
45
47
|
key: INSERT_BLOCK_SECTION.key,
|
|
46
48
|
rank: INSERT_BLOCK_SECTION_RANK[TASK_LIST_GROUP.key]
|
|
47
49
|
}],
|
|
48
|
-
component: createResponsiveComponent()
|
|
50
|
+
component: createResponsiveComponent((_config$taskList2 = config.taskList) === null || _config$taskList2 === void 0 ? void 0 : _config$taskList2.showAt)
|
|
49
51
|
});
|
|
50
52
|
components.push({
|
|
51
53
|
type: TASK_LIST_BUTTON.type,
|
|
@@ -63,6 +65,7 @@ export const getToolbarComponents = ({
|
|
|
63
65
|
|
|
64
66
|
// Media Group
|
|
65
67
|
if ((_config$media = config.media) !== null && _config$media !== void 0 && _config$media.enabled) {
|
|
68
|
+
var _config$media2;
|
|
66
69
|
components.push({
|
|
67
70
|
type: MEDIA_GROUP.type,
|
|
68
71
|
key: MEDIA_GROUP.key,
|
|
@@ -71,7 +74,7 @@ export const getToolbarComponents = ({
|
|
|
71
74
|
key: INSERT_BLOCK_SECTION.key,
|
|
72
75
|
rank: INSERT_BLOCK_SECTION_RANK[MEDIA_GROUP.key]
|
|
73
76
|
}],
|
|
74
|
-
component: createResponsiveComponent()
|
|
77
|
+
component: createResponsiveComponent((_config$media2 = config.media) === null || _config$media2 === void 0 ? void 0 : _config$media2.showAt)
|
|
75
78
|
});
|
|
76
79
|
components.push({
|
|
77
80
|
type: MEDIA_BUTTON.type,
|
|
@@ -91,6 +94,7 @@ export const getToolbarComponents = ({
|
|
|
91
94
|
|
|
92
95
|
// CodeBlock Group
|
|
93
96
|
if ((_config$codeBlock = config.codeBlock) !== null && _config$codeBlock !== void 0 && _config$codeBlock.enabled) {
|
|
97
|
+
var _config$codeBlock2;
|
|
94
98
|
components.push({
|
|
95
99
|
type: CODE_BLOCK_GROUP.type,
|
|
96
100
|
key: CODE_BLOCK_GROUP.key,
|
|
@@ -99,7 +103,7 @@ export const getToolbarComponents = ({
|
|
|
99
103
|
key: INSERT_BLOCK_SECTION.key,
|
|
100
104
|
rank: INSERT_BLOCK_SECTION_RANK[CODE_BLOCK_GROUP.key]
|
|
101
105
|
}],
|
|
102
|
-
component: createResponsiveComponent()
|
|
106
|
+
component: createResponsiveComponent((_config$codeBlock2 = config.codeBlock) === null || _config$codeBlock2 === void 0 ? void 0 : _config$codeBlock2.showAt)
|
|
103
107
|
});
|
|
104
108
|
components.push({
|
|
105
109
|
type: CODE_BLOCK_BUTTON.type,
|
|
@@ -125,7 +129,7 @@ export const getToolbarComponents = ({
|
|
|
125
129
|
key: INSERT_BLOCK_SECTION.key,
|
|
126
130
|
rank: INSERT_BLOCK_SECTION_RANK[MENTION_GROUP.key]
|
|
127
131
|
}],
|
|
128
|
-
component: createResponsiveComponent()
|
|
132
|
+
component: createResponsiveComponent(config.mention.showAt)
|
|
129
133
|
});
|
|
130
134
|
components.push({
|
|
131
135
|
type: MENTION_BUTTON.type,
|
|
@@ -151,7 +155,7 @@ export const getToolbarComponents = ({
|
|
|
151
155
|
key: INSERT_BLOCK_SECTION.key,
|
|
152
156
|
rank: INSERT_BLOCK_SECTION_RANK[EMOJI_GROUP.key]
|
|
153
157
|
}],
|
|
154
|
-
component: createResponsiveComponent()
|
|
158
|
+
component: createResponsiveComponent(config.emoji.showAt)
|
|
155
159
|
});
|
|
156
160
|
components.push({
|
|
157
161
|
type: EMOJI_BUTTON.type,
|
|
@@ -177,7 +181,7 @@ export const getToolbarComponents = ({
|
|
|
177
181
|
key: INSERT_BLOCK_SECTION.key,
|
|
178
182
|
rank: INSERT_BLOCK_SECTION_RANK[LAYOUT_GROUP.key]
|
|
179
183
|
}],
|
|
180
|
-
component: createResponsiveComponent()
|
|
184
|
+
component: createResponsiveComponent(config.layout.showAt)
|
|
181
185
|
});
|
|
182
186
|
components.push({
|
|
183
187
|
type: LAYOUT_BUTTON.type,
|
|
@@ -203,7 +207,7 @@ export const getToolbarComponents = ({
|
|
|
203
207
|
key: INSERT_BLOCK_SECTION.key,
|
|
204
208
|
rank: INSERT_BLOCK_SECTION_RANK[TABLE_GROUP.key]
|
|
205
209
|
}],
|
|
206
|
-
component: createResponsiveComponent()
|
|
210
|
+
component: createResponsiveComponent(config.table.showAt)
|
|
207
211
|
});
|
|
208
212
|
components.push({
|
|
209
213
|
type: TABLE_BUTTON.type,
|
|
@@ -5,11 +5,13 @@ export var toggleInsertBlockPmPlugin = function toggleInsertBlockPmPlugin() {
|
|
|
5
5
|
return new SafePlugin({
|
|
6
6
|
key: toggleInsertBlockPmKey,
|
|
7
7
|
state: {
|
|
8
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
8
9
|
init: function init() {
|
|
9
10
|
return {
|
|
10
11
|
showElementBrowser: false
|
|
11
12
|
};
|
|
12
13
|
},
|
|
14
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
13
15
|
apply: function apply(tr, pluginState) {
|
|
14
16
|
var meta = tr.getMeta(toggleInsertBlockPmKey);
|
|
15
17
|
if (!meta) {
|
|
@@ -63,12 +63,14 @@ export var resolveToolbarConfig = function resolveToolbarConfig(options) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
var defaults = {
|
|
66
|
-
enabled: false
|
|
66
|
+
enabled: false,
|
|
67
|
+
showAt: 'lg'
|
|
67
68
|
};
|
|
68
69
|
var resolveGroupConfig = function resolveGroupConfig(groupConfig) {
|
|
69
|
-
var _groupConfig$enabled;
|
|
70
|
+
var _groupConfig$enabled, _groupConfig$showAt;
|
|
70
71
|
return {
|
|
71
|
-
enabled: (_groupConfig$enabled = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.enabled) !== null && _groupConfig$enabled !== void 0 ? _groupConfig$enabled : defaults.enabled
|
|
72
|
+
enabled: (_groupConfig$enabled = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.enabled) !== null && _groupConfig$enabled !== void 0 ? _groupConfig$enabled : defaults.enabled,
|
|
73
|
+
showAt: (_groupConfig$showAt = groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.showAt) !== null && _groupConfig$showAt !== void 0 ? _groupConfig$showAt : defaults.showAt
|
|
72
74
|
};
|
|
73
75
|
};
|
|
74
76
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { INSERT_BLOCK_SECTION, TASK_LIST_GROUP, MEDIA_GROUP, 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, INSERT_GROUP, INSERT_BUTTON, INSERT_GROUP_RANK, CODE_BLOCK_GROUP, CODE_BLOCK_BUTTON, CODE_BLOCK_GROUP_RANK } from '@atlaskit/editor-common/toolbar';
|
|
3
3
|
import { Show, ToolbarButtonGroup } from '@atlaskit/editor-toolbar';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
import { CodeBlockButton } from './toolbar-components/CodeBlockButton';
|
|
6
7
|
import { resolveToolbarConfig } from './toolbar-components/config-resolver';
|
|
@@ -26,17 +27,18 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
26
27
|
var components = [];
|
|
27
28
|
|
|
28
29
|
// Helper function to create responsive wrapper component
|
|
29
|
-
var createResponsiveComponent = function createResponsiveComponent() {
|
|
30
|
+
var createResponsiveComponent = function createResponsiveComponent(showAt) {
|
|
30
31
|
return expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? function (_ref2) {
|
|
31
32
|
var children = _ref2.children;
|
|
32
33
|
return /*#__PURE__*/React.createElement(Show, {
|
|
33
|
-
above:
|
|
34
|
+
above: fg('platform_editor_toolbar_aifc_undo_redo_confluence') ? showAt || 'lg' : 'lg'
|
|
34
35
|
}, /*#__PURE__*/React.createElement(ToolbarButtonGroup, null, children));
|
|
35
36
|
} : undefined;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
// TaskList Group
|
|
39
40
|
if ((_config$taskList = config.taskList) !== null && _config$taskList !== void 0 && _config$taskList.enabled) {
|
|
41
|
+
var _config$taskList2;
|
|
40
42
|
components.push({
|
|
41
43
|
type: TASK_LIST_GROUP.type,
|
|
42
44
|
key: TASK_LIST_GROUP.key,
|
|
@@ -45,7 +47,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
45
47
|
key: INSERT_BLOCK_SECTION.key,
|
|
46
48
|
rank: INSERT_BLOCK_SECTION_RANK[TASK_LIST_GROUP.key]
|
|
47
49
|
}],
|
|
48
|
-
component: createResponsiveComponent()
|
|
50
|
+
component: createResponsiveComponent((_config$taskList2 = config.taskList) === null || _config$taskList2 === void 0 ? void 0 : _config$taskList2.showAt)
|
|
49
51
|
});
|
|
50
52
|
components.push({
|
|
51
53
|
type: TASK_LIST_BUTTON.type,
|
|
@@ -65,6 +67,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
65
67
|
|
|
66
68
|
// Media Group
|
|
67
69
|
if ((_config$media = config.media) !== null && _config$media !== void 0 && _config$media.enabled) {
|
|
70
|
+
var _config$media2;
|
|
68
71
|
components.push({
|
|
69
72
|
type: MEDIA_GROUP.type,
|
|
70
73
|
key: MEDIA_GROUP.key,
|
|
@@ -73,7 +76,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
73
76
|
key: INSERT_BLOCK_SECTION.key,
|
|
74
77
|
rank: INSERT_BLOCK_SECTION_RANK[MEDIA_GROUP.key]
|
|
75
78
|
}],
|
|
76
|
-
component: createResponsiveComponent()
|
|
79
|
+
component: createResponsiveComponent((_config$media2 = config.media) === null || _config$media2 === void 0 ? void 0 : _config$media2.showAt)
|
|
77
80
|
});
|
|
78
81
|
components.push({
|
|
79
82
|
type: MEDIA_BUTTON.type,
|
|
@@ -95,6 +98,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
95
98
|
|
|
96
99
|
// CodeBlock Group
|
|
97
100
|
if ((_config$codeBlock = config.codeBlock) !== null && _config$codeBlock !== void 0 && _config$codeBlock.enabled) {
|
|
101
|
+
var _config$codeBlock2;
|
|
98
102
|
components.push({
|
|
99
103
|
type: CODE_BLOCK_GROUP.type,
|
|
100
104
|
key: CODE_BLOCK_GROUP.key,
|
|
@@ -103,7 +107,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
103
107
|
key: INSERT_BLOCK_SECTION.key,
|
|
104
108
|
rank: INSERT_BLOCK_SECTION_RANK[CODE_BLOCK_GROUP.key]
|
|
105
109
|
}],
|
|
106
|
-
component: createResponsiveComponent()
|
|
110
|
+
component: createResponsiveComponent((_config$codeBlock2 = config.codeBlock) === null || _config$codeBlock2 === void 0 ? void 0 : _config$codeBlock2.showAt)
|
|
107
111
|
});
|
|
108
112
|
components.push({
|
|
109
113
|
type: CODE_BLOCK_BUTTON.type,
|
|
@@ -131,7 +135,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
131
135
|
key: INSERT_BLOCK_SECTION.key,
|
|
132
136
|
rank: INSERT_BLOCK_SECTION_RANK[MENTION_GROUP.key]
|
|
133
137
|
}],
|
|
134
|
-
component: createResponsiveComponent()
|
|
138
|
+
component: createResponsiveComponent(config.mention.showAt)
|
|
135
139
|
});
|
|
136
140
|
components.push({
|
|
137
141
|
type: MENTION_BUTTON.type,
|
|
@@ -159,7 +163,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
159
163
|
key: INSERT_BLOCK_SECTION.key,
|
|
160
164
|
rank: INSERT_BLOCK_SECTION_RANK[EMOJI_GROUP.key]
|
|
161
165
|
}],
|
|
162
|
-
component: createResponsiveComponent()
|
|
166
|
+
component: createResponsiveComponent(config.emoji.showAt)
|
|
163
167
|
});
|
|
164
168
|
components.push({
|
|
165
169
|
type: EMOJI_BUTTON.type,
|
|
@@ -187,7 +191,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
187
191
|
key: INSERT_BLOCK_SECTION.key,
|
|
188
192
|
rank: INSERT_BLOCK_SECTION_RANK[LAYOUT_GROUP.key]
|
|
189
193
|
}],
|
|
190
|
-
component: createResponsiveComponent()
|
|
194
|
+
component: createResponsiveComponent(config.layout.showAt)
|
|
191
195
|
});
|
|
192
196
|
components.push({
|
|
193
197
|
type: LAYOUT_BUTTON.type,
|
|
@@ -215,7 +219,7 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
215
219
|
key: INSERT_BLOCK_SECTION.key,
|
|
216
220
|
rank: INSERT_BLOCK_SECTION_RANK[TABLE_GROUP.key]
|
|
217
221
|
}],
|
|
218
|
-
component: createResponsiveComponent()
|
|
222
|
+
component: createResponsiveComponent(config.table.showAt)
|
|
219
223
|
});
|
|
220
224
|
components.push({
|
|
221
225
|
type: TABLE_BUTTON.type,
|
|
@@ -26,6 +26,7 @@ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
|
|
|
26
26
|
import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
|
|
27
27
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
28
28
|
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
29
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
29
30
|
export type InsertBlockPluginDependencies = [
|
|
30
31
|
TypeAheadPlugin,
|
|
31
32
|
OptionalPlugin<TablePlugin>,
|
|
@@ -57,6 +58,7 @@ export type InsertBlockPluginDependencies = [
|
|
|
57
58
|
];
|
|
58
59
|
export interface ToolbarGroupConfig {
|
|
59
60
|
enabled?: boolean;
|
|
61
|
+
showAt?: Breakpoint;
|
|
60
62
|
}
|
|
61
63
|
export interface ToolbarInsertBlockButtonsConfig {
|
|
62
64
|
codeBlock?: ToolbarGroupConfig;
|
|
@@ -26,6 +26,7 @@ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
|
|
|
26
26
|
import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
|
|
27
27
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
28
28
|
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
29
|
+
import type { Breakpoint } from '@atlaskit/editor-toolbar';
|
|
29
30
|
export type InsertBlockPluginDependencies = [
|
|
30
31
|
TypeAheadPlugin,
|
|
31
32
|
OptionalPlugin<TablePlugin>,
|
|
@@ -57,6 +58,7 @@ export type InsertBlockPluginDependencies = [
|
|
|
57
58
|
];
|
|
58
59
|
export interface ToolbarGroupConfig {
|
|
59
60
|
enabled?: boolean;
|
|
61
|
+
showAt?: Breakpoint;
|
|
60
62
|
}
|
|
61
63
|
export interface ToolbarInsertBlockButtonsConfig {
|
|
62
64
|
codeBlock?: ToolbarGroupConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.23",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,13 +29,12 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/button": "^23.6.0",
|
|
33
32
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
33
|
"@atlaskit/editor-plugin-block-type": "^10.2.0",
|
|
35
34
|
"@atlaskit/editor-plugin-code-block": "^8.1.0",
|
|
36
35
|
"@atlaskit/editor-plugin-connectivity": "^6.0.0",
|
|
37
36
|
"@atlaskit/editor-plugin-date": "^8.1.0",
|
|
38
|
-
"@atlaskit/editor-plugin-emoji": "^7.
|
|
37
|
+
"@atlaskit/editor-plugin-emoji": "^7.7.0",
|
|
39
38
|
"@atlaskit/editor-plugin-expand": "^7.4.0",
|
|
40
39
|
"@atlaskit/editor-plugin-extension": "^9.2.0",
|
|
41
40
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
@@ -52,24 +51,21 @@
|
|
|
52
51
|
"@atlaskit/editor-plugin-quick-insert": "^6.0.0",
|
|
53
52
|
"@atlaskit/editor-plugin-rule": "^6.1.0",
|
|
54
53
|
"@atlaskit/editor-plugin-status": "^7.1.0",
|
|
55
|
-
"@atlaskit/editor-plugin-table": "^15.
|
|
54
|
+
"@atlaskit/editor-plugin-table": "^15.4.0",
|
|
56
55
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^9.1.0",
|
|
57
56
|
"@atlaskit/editor-plugin-toolbar": "^3.4.0",
|
|
58
57
|
"@atlaskit/editor-plugin-type-ahead": "^6.5.0",
|
|
59
58
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
60
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
59
|
+
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
61
60
|
"@atlaskit/editor-toolbar": "^0.17.0",
|
|
62
61
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
63
|
-
"@atlaskit/emoji": "^69.
|
|
64
|
-
"@atlaskit/heading": "^5.2.0",
|
|
62
|
+
"@atlaskit/emoji": "^69.8.0",
|
|
65
63
|
"@atlaskit/icon": "^29.0.0",
|
|
66
64
|
"@atlaskit/icon-lab": "^5.12.0",
|
|
67
65
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
68
|
-
"@atlaskit/primitives": "^16.1.0",
|
|
69
66
|
"@atlaskit/theme": "^21.0.0",
|
|
70
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
71
|
-
"@atlaskit/tokens": "^8.
|
|
72
|
-
"@atlaskit/tooltip": "^20.8.0",
|
|
67
|
+
"@atlaskit/tmp-editor-statsig": "^14.0.0",
|
|
68
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
73
69
|
"@babel/runtime": "^7.0.0",
|
|
74
70
|
"@emotion/react": "^11.7.1",
|
|
75
71
|
"bind-event-listener": "^3.0.0",
|
|
@@ -78,15 +74,12 @@
|
|
|
78
74
|
"react-virtualized": "^9.22.6"
|
|
79
75
|
},
|
|
80
76
|
"peerDependencies": {
|
|
81
|
-
"@atlaskit/editor-common": "^110.
|
|
77
|
+
"@atlaskit/editor-common": "^110.36.0",
|
|
82
78
|
"react": "^18.2.0",
|
|
83
79
|
"react-dom": "^18.2.0",
|
|
84
80
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
85
81
|
},
|
|
86
82
|
"devDependencies": {
|
|
87
|
-
"@af/integration-testing": "workspace:^",
|
|
88
|
-
"@af/visual-regression": "workspace:^",
|
|
89
|
-
"@atlaskit/ssr": "workspace:^",
|
|
90
83
|
"@testing-library/react": "^13.4.0",
|
|
91
84
|
"@types/react-virtualized": "^9.18.12"
|
|
92
85
|
},
|
|
@@ -144,6 +137,9 @@
|
|
|
144
137
|
},
|
|
145
138
|
"platform_editor_remove_unused_block_insert_props": {
|
|
146
139
|
"type": "boolean"
|
|
140
|
+
},
|
|
141
|
+
"platform_editor_toolbar_aifc_undo_redo_confluence": {
|
|
142
|
+
"type": "boolean"
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
145
|
}
|