@atlaskit/editor-plugin-panel 8.1.4 → 8.1.6
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/nodeviews/panel.js +3 -0
- package/dist/cjs/panelPlugin.js +110 -133
- package/dist/cjs/ui/panelTypeDropdown.js +4 -4
- package/dist/es2019/nodeviews/panel.js +3 -0
- package/dist/es2019/panelPlugin.js +100 -121
- package/dist/es2019/ui/panelTypeDropdown.js +4 -4
- package/dist/esm/nodeviews/panel.js +3 -0
- package/dist/esm/panelPlugin.js +110 -133
- package/dist/esm/ui/panelTypeDropdown.js +4 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 8.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0d661119b4293`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d661119b4293) -
|
|
8
|
+
Clean up platform_editor_insertion experiment by shipping control variant. Remove modern TypeAhead
|
|
9
|
+
components and experiment infrastructure while preserving all existing functionality.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 8.1.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 8.1.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -18,6 +18,8 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
18
18
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
19
19
|
var _lightbulbEditorHint = _interopRequireDefault(require("@atlaskit/icon/core/migration/lightbulb--editor-hint"));
|
|
20
20
|
var _utils = require("../pm-plugins/utils/utils");
|
|
21
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
22
|
+
|
|
21
23
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
22
24
|
// Mapping export
|
|
23
25
|
var panelIcons = exports.panelIcons = {
|
|
@@ -74,6 +76,7 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
74
76
|
this.pluginOptions = pluginOptions;
|
|
75
77
|
this.view = view;
|
|
76
78
|
this.node = node;
|
|
79
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
77
80
|
this.key = (0, _v.default)();
|
|
78
81
|
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, (0, _utils.panelAttrsToDom)(node.attrs, pluginOptions.allowCustomPanel || false)),
|
|
79
82
|
dom = _DOMSerializer$render.dom,
|
package/dist/cjs/panelPlugin.js
CHANGED
|
@@ -110,152 +110,129 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
110
110
|
pluginsOptions: {
|
|
111
111
|
quickInsert: function quickInsert(_ref3) {
|
|
112
112
|
var formatMessage = _ref3.formatMessage;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
title: formatMessage(_messages.blockTypeMessages.errorPanel),
|
|
212
|
-
description: formatMessage(_messages.blockTypeMessages.errorPanelDescription),
|
|
113
|
+
var quickInsertOptions = [{
|
|
114
|
+
id: 'infopanel',
|
|
115
|
+
title: formatMessage(_messages.blockTypeMessages.infoPanel),
|
|
116
|
+
keywords: ['panel'],
|
|
117
|
+
description: formatMessage(_messages.blockTypeMessages.infoPanelDescription),
|
|
118
|
+
priority: 800,
|
|
119
|
+
icon: function icon() {
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanel, null);
|
|
121
|
+
},
|
|
122
|
+
action: function action(typeAheadInsert, state) {
|
|
123
|
+
return createPanelAction({
|
|
124
|
+
state: state,
|
|
125
|
+
attributes: {
|
|
126
|
+
panelType: _adfSchema.PanelType.INFO
|
|
127
|
+
},
|
|
128
|
+
api: api,
|
|
129
|
+
typeAheadInsert: typeAheadInsert
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
id: 'notepanel',
|
|
134
|
+
title: formatMessage(_messages.blockTypeMessages.notePanel),
|
|
135
|
+
description: formatMessage(_messages.blockTypeMessages.notePanelDescription),
|
|
136
|
+
priority: 1000,
|
|
137
|
+
icon: function icon() {
|
|
138
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelNote, null);
|
|
139
|
+
},
|
|
140
|
+
action: function action(typeAheadInsert, state) {
|
|
141
|
+
return createPanelAction({
|
|
142
|
+
state: state,
|
|
143
|
+
attributes: {
|
|
144
|
+
panelType: _adfSchema.PanelType.NOTE
|
|
145
|
+
},
|
|
146
|
+
api: api,
|
|
147
|
+
typeAheadInsert: typeAheadInsert
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
id: 'successpanel',
|
|
152
|
+
title: formatMessage(_messages.blockTypeMessages.successPanel),
|
|
153
|
+
description: formatMessage(_messages.blockTypeMessages.successPanelDescription),
|
|
154
|
+
keywords: ['tip'],
|
|
155
|
+
priority: 1000,
|
|
156
|
+
icon: function icon() {
|
|
157
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelSuccess, null);
|
|
158
|
+
},
|
|
159
|
+
action: function action(typeAheadInsert, state) {
|
|
160
|
+
return createPanelAction({
|
|
161
|
+
state: state,
|
|
162
|
+
attributes: {
|
|
163
|
+
panelType: _adfSchema.PanelType.SUCCESS
|
|
164
|
+
},
|
|
165
|
+
api: api,
|
|
166
|
+
typeAheadInsert: typeAheadInsert
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
id: 'warningpanel',
|
|
171
|
+
title: formatMessage(_messages.blockTypeMessages.warningPanel),
|
|
172
|
+
description: formatMessage(_messages.blockTypeMessages.warningPanelDescription),
|
|
173
|
+
priority: 1000,
|
|
174
|
+
icon: function icon() {
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelWarning, null);
|
|
176
|
+
},
|
|
177
|
+
action: function action(typeAheadInsert, state) {
|
|
178
|
+
return createPanelAction({
|
|
179
|
+
state: state,
|
|
180
|
+
attributes: {
|
|
181
|
+
panelType: _adfSchema.PanelType.WARNING
|
|
182
|
+
},
|
|
183
|
+
api: api,
|
|
184
|
+
typeAheadInsert: typeAheadInsert
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
id: 'errorpanel',
|
|
189
|
+
title: formatMessage(_messages.blockTypeMessages.errorPanel),
|
|
190
|
+
description: formatMessage(_messages.blockTypeMessages.errorPanelDescription),
|
|
191
|
+
priority: 1000,
|
|
192
|
+
icon: function icon() {
|
|
193
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconPanelError, null);
|
|
194
|
+
},
|
|
195
|
+
action: function action(typeAheadInsert, state) {
|
|
196
|
+
return createPanelAction({
|
|
197
|
+
state: state,
|
|
198
|
+
attributes: {
|
|
199
|
+
panelType: _adfSchema.PanelType.ERROR
|
|
200
|
+
},
|
|
201
|
+
api: api,
|
|
202
|
+
typeAheadInsert: typeAheadInsert
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}];
|
|
206
|
+
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
207
|
+
quickInsertOptions.push({
|
|
208
|
+
id: 'custompanel',
|
|
209
|
+
title: formatMessage(_messages.blockTypeMessages.customPanel),
|
|
210
|
+
description: formatMessage(_messages.blockTypeMessages.customPanelDescription),
|
|
213
211
|
priority: 1000,
|
|
214
212
|
icon: function icon() {
|
|
215
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.
|
|
213
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconCustomPanel, null);
|
|
216
214
|
},
|
|
217
215
|
action: function action(typeAheadInsert, state) {
|
|
218
216
|
return createPanelAction({
|
|
219
217
|
state: state,
|
|
220
218
|
attributes: {
|
|
221
|
-
panelType: _adfSchema.PanelType.
|
|
219
|
+
panelType: _adfSchema.PanelType.CUSTOM,
|
|
220
|
+
panelIcon: ':rainbow:',
|
|
221
|
+
panelIconId: '1f308',
|
|
222
|
+
panelIconText: '🌈',
|
|
223
|
+
// Ignored via go/ees007
|
|
224
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
225
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
226
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
227
|
+
panelColor: _colors.T50
|
|
222
228
|
},
|
|
223
229
|
api: api,
|
|
224
230
|
typeAheadInsert: typeAheadInsert
|
|
225
231
|
});
|
|
226
232
|
}
|
|
227
|
-
}
|
|
228
|
-
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
229
|
-
quickInsertOptions.push({
|
|
230
|
-
id: 'custompanel',
|
|
231
|
-
title: formatMessage(_messages.blockTypeMessages.customPanel),
|
|
232
|
-
description: formatMessage(_messages.blockTypeMessages.customPanelDescription),
|
|
233
|
-
priority: 1000,
|
|
234
|
-
icon: function icon() {
|
|
235
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconCustomPanel, null);
|
|
236
|
-
},
|
|
237
|
-
action: function action(typeAheadInsert, state) {
|
|
238
|
-
return createPanelAction({
|
|
239
|
-
state: state,
|
|
240
|
-
attributes: {
|
|
241
|
-
panelType: _adfSchema.PanelType.CUSTOM,
|
|
242
|
-
panelIcon: ':rainbow:',
|
|
243
|
-
panelIconId: '1f308',
|
|
244
|
-
panelIconText: '🌈',
|
|
245
|
-
// Ignored via go/ees007
|
|
246
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
247
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
248
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
249
|
-
panelColor: _colors.T50
|
|
250
|
-
},
|
|
251
|
-
api: api,
|
|
252
|
-
typeAheadInsert: typeAheadInsert
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
return quickInsertOptions;
|
|
233
|
+
});
|
|
258
234
|
}
|
|
235
|
+
return quickInsertOptions;
|
|
259
236
|
},
|
|
260
237
|
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
261
238
|
return (0, _toolbar.getToolbarConfig)(state, intl, options, providerFactory, api);
|
|
@@ -19,25 +19,25 @@ var panelTitleAndIcon = (0, _defineProperty2.default)((0, _defineProperty2.defau
|
|
|
19
19
|
title: _messages.panelMessages.info,
|
|
20
20
|
icon: (0, _statusInformation.default)({
|
|
21
21
|
label: 'info-icon',
|
|
22
|
-
color: "var(--ds-icon-information, #
|
|
22
|
+
color: "var(--ds-icon-information, #357DE8)"
|
|
23
23
|
})
|
|
24
24
|
}), _adfSchema.PanelType.NOTE, {
|
|
25
25
|
title: _messages.panelMessages.note,
|
|
26
26
|
icon: (0, _statusDiscovery.default)({
|
|
27
27
|
label: 'note-icon',
|
|
28
|
-
color: "var(--ds-icon-discovery, #
|
|
28
|
+
color: "var(--ds-icon-discovery, #AF59E1)"
|
|
29
29
|
})
|
|
30
30
|
}), _adfSchema.PanelType.SUCCESS, {
|
|
31
31
|
title: _messages.panelMessages.success,
|
|
32
32
|
icon: (0, _statusSuccess.default)({
|
|
33
33
|
label: 'success-icon',
|
|
34
|
-
color: "var(--ds-icon-success, #
|
|
34
|
+
color: "var(--ds-icon-success, #6A9A23)"
|
|
35
35
|
})
|
|
36
36
|
}), _adfSchema.PanelType.WARNING, {
|
|
37
37
|
title: _messages.panelMessages.warning,
|
|
38
38
|
icon: (0, _statusWarning.default)({
|
|
39
39
|
label: 'warning-icon',
|
|
40
|
-
color: "var(--ds-icon-warning, #
|
|
40
|
+
color: "var(--ds-icon-warning, #E06C00)"
|
|
41
41
|
})
|
|
42
42
|
}), _adfSchema.PanelType.ERROR, {
|
|
43
43
|
title: _messages.panelMessages.error,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
4
|
import uuid from 'uuid/v4';
|
|
3
5
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
4
6
|
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
@@ -68,6 +70,7 @@ class PanelNodeView {
|
|
|
68
70
|
this.pluginOptions = pluginOptions;
|
|
69
71
|
this.view = view;
|
|
70
72
|
this.node = node;
|
|
73
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
71
74
|
this.key = uuid();
|
|
72
75
|
const {
|
|
73
76
|
dom,
|
|
@@ -99,138 +99,117 @@ const panelPlugin = ({
|
|
|
99
99
|
quickInsert: ({
|
|
100
100
|
formatMessage
|
|
101
101
|
}) => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
title: formatMessage(blockTypeMessages.errorPanel),
|
|
191
|
-
description: formatMessage(blockTypeMessages.errorPanelDescription),
|
|
102
|
+
const quickInsertOptions = [{
|
|
103
|
+
id: 'infopanel',
|
|
104
|
+
title: formatMessage(blockTypeMessages.infoPanel),
|
|
105
|
+
keywords: ['panel'],
|
|
106
|
+
description: formatMessage(blockTypeMessages.infoPanelDescription),
|
|
107
|
+
priority: 800,
|
|
108
|
+
icon: () => /*#__PURE__*/React.createElement(IconPanel, null),
|
|
109
|
+
action(typeAheadInsert, state) {
|
|
110
|
+
return createPanelAction({
|
|
111
|
+
state,
|
|
112
|
+
attributes: {
|
|
113
|
+
panelType: PanelType.INFO
|
|
114
|
+
},
|
|
115
|
+
api,
|
|
116
|
+
typeAheadInsert
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
id: 'notepanel',
|
|
121
|
+
title: formatMessage(blockTypeMessages.notePanel),
|
|
122
|
+
description: formatMessage(blockTypeMessages.notePanelDescription),
|
|
123
|
+
priority: 1000,
|
|
124
|
+
icon: () => /*#__PURE__*/React.createElement(IconPanelNote, null),
|
|
125
|
+
action(typeAheadInsert, state) {
|
|
126
|
+
return createPanelAction({
|
|
127
|
+
state,
|
|
128
|
+
attributes: {
|
|
129
|
+
panelType: PanelType.NOTE
|
|
130
|
+
},
|
|
131
|
+
api,
|
|
132
|
+
typeAheadInsert
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
id: 'successpanel',
|
|
137
|
+
title: formatMessage(blockTypeMessages.successPanel),
|
|
138
|
+
description: formatMessage(blockTypeMessages.successPanelDescription),
|
|
139
|
+
keywords: ['tip'],
|
|
140
|
+
priority: 1000,
|
|
141
|
+
icon: () => /*#__PURE__*/React.createElement(IconPanelSuccess, null),
|
|
142
|
+
action(typeAheadInsert, state) {
|
|
143
|
+
return createPanelAction({
|
|
144
|
+
state,
|
|
145
|
+
attributes: {
|
|
146
|
+
panelType: PanelType.SUCCESS
|
|
147
|
+
},
|
|
148
|
+
api,
|
|
149
|
+
typeAheadInsert
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
id: 'warningpanel',
|
|
154
|
+
title: formatMessage(blockTypeMessages.warningPanel),
|
|
155
|
+
description: formatMessage(blockTypeMessages.warningPanelDescription),
|
|
156
|
+
priority: 1000,
|
|
157
|
+
icon: () => /*#__PURE__*/React.createElement(IconPanelWarning, null),
|
|
158
|
+
action(typeAheadInsert, state) {
|
|
159
|
+
return createPanelAction({
|
|
160
|
+
state,
|
|
161
|
+
attributes: {
|
|
162
|
+
panelType: PanelType.WARNING
|
|
163
|
+
},
|
|
164
|
+
api,
|
|
165
|
+
typeAheadInsert
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
id: 'errorpanel',
|
|
170
|
+
title: formatMessage(blockTypeMessages.errorPanel),
|
|
171
|
+
description: formatMessage(blockTypeMessages.errorPanelDescription),
|
|
172
|
+
priority: 1000,
|
|
173
|
+
icon: () => /*#__PURE__*/React.createElement(IconPanelError, null),
|
|
174
|
+
action(typeAheadInsert, state) {
|
|
175
|
+
return createPanelAction({
|
|
176
|
+
state,
|
|
177
|
+
attributes: {
|
|
178
|
+
panelType: PanelType.ERROR
|
|
179
|
+
},
|
|
180
|
+
api,
|
|
181
|
+
typeAheadInsert
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}];
|
|
185
|
+
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
186
|
+
quickInsertOptions.push({
|
|
187
|
+
id: 'custompanel',
|
|
188
|
+
title: formatMessage(blockTypeMessages.customPanel),
|
|
189
|
+
description: formatMessage(blockTypeMessages.customPanelDescription),
|
|
192
190
|
priority: 1000,
|
|
193
|
-
icon: () => /*#__PURE__*/React.createElement(
|
|
191
|
+
icon: () => /*#__PURE__*/React.createElement(IconCustomPanel, null),
|
|
194
192
|
action(typeAheadInsert, state) {
|
|
195
193
|
return createPanelAction({
|
|
196
194
|
state,
|
|
197
195
|
attributes: {
|
|
198
|
-
panelType: PanelType.
|
|
196
|
+
panelType: PanelType.CUSTOM,
|
|
197
|
+
panelIcon: ':rainbow:',
|
|
198
|
+
panelIconId: '1f308',
|
|
199
|
+
panelIconText: '🌈',
|
|
200
|
+
// Ignored via go/ees007
|
|
201
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
202
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
203
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
204
|
+
panelColor: T50
|
|
199
205
|
},
|
|
200
206
|
api,
|
|
201
207
|
typeAheadInsert
|
|
202
208
|
});
|
|
203
209
|
}
|
|
204
|
-
}
|
|
205
|
-
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
206
|
-
quickInsertOptions.push({
|
|
207
|
-
id: 'custompanel',
|
|
208
|
-
title: formatMessage(blockTypeMessages.customPanel),
|
|
209
|
-
description: formatMessage(blockTypeMessages.customPanelDescription),
|
|
210
|
-
priority: 1000,
|
|
211
|
-
icon: () => /*#__PURE__*/React.createElement(IconCustomPanel, null),
|
|
212
|
-
action(typeAheadInsert, state) {
|
|
213
|
-
return createPanelAction({
|
|
214
|
-
state,
|
|
215
|
-
attributes: {
|
|
216
|
-
panelType: PanelType.CUSTOM,
|
|
217
|
-
panelIcon: ':rainbow:',
|
|
218
|
-
panelIconId: '1f308',
|
|
219
|
-
panelIconText: '🌈',
|
|
220
|
-
// Ignored via go/ees007
|
|
221
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
222
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
223
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
224
|
-
panelColor: T50
|
|
225
|
-
},
|
|
226
|
-
api,
|
|
227
|
-
typeAheadInsert
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
return quickInsertOptions;
|
|
210
|
+
});
|
|
233
211
|
}
|
|
212
|
+
return quickInsertOptions;
|
|
234
213
|
},
|
|
235
214
|
floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory, api)
|
|
236
215
|
}
|
|
@@ -12,28 +12,28 @@ const panelTitleAndIcon = {
|
|
|
12
12
|
title: messages.info,
|
|
13
13
|
icon: StatusInformationIcon({
|
|
14
14
|
label: 'info-icon',
|
|
15
|
-
color: "var(--ds-icon-information, #
|
|
15
|
+
color: "var(--ds-icon-information, #357DE8)"
|
|
16
16
|
})
|
|
17
17
|
},
|
|
18
18
|
[PanelType.NOTE]: {
|
|
19
19
|
title: messages.note,
|
|
20
20
|
icon: StatusDiscoveryIcon({
|
|
21
21
|
label: 'note-icon',
|
|
22
|
-
color: "var(--ds-icon-discovery, #
|
|
22
|
+
color: "var(--ds-icon-discovery, #AF59E1)"
|
|
23
23
|
})
|
|
24
24
|
},
|
|
25
25
|
[PanelType.SUCCESS]: {
|
|
26
26
|
title: messages.success,
|
|
27
27
|
icon: StatusSuccessIcon({
|
|
28
28
|
label: 'success-icon',
|
|
29
|
-
color: "var(--ds-icon-success, #
|
|
29
|
+
color: "var(--ds-icon-success, #6A9A23)"
|
|
30
30
|
})
|
|
31
31
|
},
|
|
32
32
|
[PanelType.WARNING]: {
|
|
33
33
|
title: messages.warning,
|
|
34
34
|
icon: StatusWarningIcon({
|
|
35
35
|
label: 'warning-icon',
|
|
36
|
-
color: "var(--ds-icon-warning, #
|
|
36
|
+
color: "var(--ds-icon-warning, #E06C00)"
|
|
37
37
|
})
|
|
38
38
|
},
|
|
39
39
|
[PanelType.ERROR]: {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import React from 'react';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
6
|
import uuid from 'uuid/v4';
|
|
5
7
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
6
8
|
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
@@ -68,6 +70,7 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
68
70
|
this.pluginOptions = pluginOptions;
|
|
69
71
|
this.view = view;
|
|
70
72
|
this.node = node;
|
|
73
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
71
74
|
this.key = uuid();
|
|
72
75
|
var _DOMSerializer$render = DOMSerializer.renderSpec(document, panelAttrsToDom(node.attrs, pluginOptions.allowCustomPanel || false)),
|
|
73
76
|
dom = _DOMSerializer$render.dom,
|
package/dist/esm/panelPlugin.js
CHANGED
|
@@ -103,152 +103,129 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
103
103
|
pluginsOptions: {
|
|
104
104
|
quickInsert: function quickInsert(_ref3) {
|
|
105
105
|
var formatMessage = _ref3.formatMessage;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
title: formatMessage(blockTypeMessages.errorPanel),
|
|
205
|
-
description: formatMessage(blockTypeMessages.errorPanelDescription),
|
|
106
|
+
var quickInsertOptions = [{
|
|
107
|
+
id: 'infopanel',
|
|
108
|
+
title: formatMessage(blockTypeMessages.infoPanel),
|
|
109
|
+
keywords: ['panel'],
|
|
110
|
+
description: formatMessage(blockTypeMessages.infoPanelDescription),
|
|
111
|
+
priority: 800,
|
|
112
|
+
icon: function icon() {
|
|
113
|
+
return /*#__PURE__*/React.createElement(IconPanel, null);
|
|
114
|
+
},
|
|
115
|
+
action: function action(typeAheadInsert, state) {
|
|
116
|
+
return createPanelAction({
|
|
117
|
+
state: state,
|
|
118
|
+
attributes: {
|
|
119
|
+
panelType: PanelType.INFO
|
|
120
|
+
},
|
|
121
|
+
api: api,
|
|
122
|
+
typeAheadInsert: typeAheadInsert
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
id: 'notepanel',
|
|
127
|
+
title: formatMessage(blockTypeMessages.notePanel),
|
|
128
|
+
description: formatMessage(blockTypeMessages.notePanelDescription),
|
|
129
|
+
priority: 1000,
|
|
130
|
+
icon: function icon() {
|
|
131
|
+
return /*#__PURE__*/React.createElement(IconPanelNote, null);
|
|
132
|
+
},
|
|
133
|
+
action: function action(typeAheadInsert, state) {
|
|
134
|
+
return createPanelAction({
|
|
135
|
+
state: state,
|
|
136
|
+
attributes: {
|
|
137
|
+
panelType: PanelType.NOTE
|
|
138
|
+
},
|
|
139
|
+
api: api,
|
|
140
|
+
typeAheadInsert: typeAheadInsert
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
id: 'successpanel',
|
|
145
|
+
title: formatMessage(blockTypeMessages.successPanel),
|
|
146
|
+
description: formatMessage(blockTypeMessages.successPanelDescription),
|
|
147
|
+
keywords: ['tip'],
|
|
148
|
+
priority: 1000,
|
|
149
|
+
icon: function icon() {
|
|
150
|
+
return /*#__PURE__*/React.createElement(IconPanelSuccess, null);
|
|
151
|
+
},
|
|
152
|
+
action: function action(typeAheadInsert, state) {
|
|
153
|
+
return createPanelAction({
|
|
154
|
+
state: state,
|
|
155
|
+
attributes: {
|
|
156
|
+
panelType: PanelType.SUCCESS
|
|
157
|
+
},
|
|
158
|
+
api: api,
|
|
159
|
+
typeAheadInsert: typeAheadInsert
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
id: 'warningpanel',
|
|
164
|
+
title: formatMessage(blockTypeMessages.warningPanel),
|
|
165
|
+
description: formatMessage(blockTypeMessages.warningPanelDescription),
|
|
166
|
+
priority: 1000,
|
|
167
|
+
icon: function icon() {
|
|
168
|
+
return /*#__PURE__*/React.createElement(IconPanelWarning, null);
|
|
169
|
+
},
|
|
170
|
+
action: function action(typeAheadInsert, state) {
|
|
171
|
+
return createPanelAction({
|
|
172
|
+
state: state,
|
|
173
|
+
attributes: {
|
|
174
|
+
panelType: PanelType.WARNING
|
|
175
|
+
},
|
|
176
|
+
api: api,
|
|
177
|
+
typeAheadInsert: typeAheadInsert
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
id: 'errorpanel',
|
|
182
|
+
title: formatMessage(blockTypeMessages.errorPanel),
|
|
183
|
+
description: formatMessage(blockTypeMessages.errorPanelDescription),
|
|
184
|
+
priority: 1000,
|
|
185
|
+
icon: function icon() {
|
|
186
|
+
return /*#__PURE__*/React.createElement(IconPanelError, null);
|
|
187
|
+
},
|
|
188
|
+
action: function action(typeAheadInsert, state) {
|
|
189
|
+
return createPanelAction({
|
|
190
|
+
state: state,
|
|
191
|
+
attributes: {
|
|
192
|
+
panelType: PanelType.ERROR
|
|
193
|
+
},
|
|
194
|
+
api: api,
|
|
195
|
+
typeAheadInsert: typeAheadInsert
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}];
|
|
199
|
+
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
200
|
+
quickInsertOptions.push({
|
|
201
|
+
id: 'custompanel',
|
|
202
|
+
title: formatMessage(blockTypeMessages.customPanel),
|
|
203
|
+
description: formatMessage(blockTypeMessages.customPanelDescription),
|
|
206
204
|
priority: 1000,
|
|
207
205
|
icon: function icon() {
|
|
208
|
-
return /*#__PURE__*/React.createElement(
|
|
206
|
+
return /*#__PURE__*/React.createElement(IconCustomPanel, null);
|
|
209
207
|
},
|
|
210
208
|
action: function action(typeAheadInsert, state) {
|
|
211
209
|
return createPanelAction({
|
|
212
210
|
state: state,
|
|
213
211
|
attributes: {
|
|
214
|
-
panelType: PanelType.
|
|
212
|
+
panelType: PanelType.CUSTOM,
|
|
213
|
+
panelIcon: ':rainbow:',
|
|
214
|
+
panelIconId: '1f308',
|
|
215
|
+
panelIconText: '🌈',
|
|
216
|
+
// Ignored via go/ees007
|
|
217
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
218
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
219
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
220
|
+
panelColor: T50
|
|
215
221
|
},
|
|
216
222
|
api: api,
|
|
217
223
|
typeAheadInsert: typeAheadInsert
|
|
218
224
|
});
|
|
219
225
|
}
|
|
220
|
-
}
|
|
221
|
-
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
222
|
-
quickInsertOptions.push({
|
|
223
|
-
id: 'custompanel',
|
|
224
|
-
title: formatMessage(blockTypeMessages.customPanel),
|
|
225
|
-
description: formatMessage(blockTypeMessages.customPanelDescription),
|
|
226
|
-
priority: 1000,
|
|
227
|
-
icon: function icon() {
|
|
228
|
-
return /*#__PURE__*/React.createElement(IconCustomPanel, null);
|
|
229
|
-
},
|
|
230
|
-
action: function action(typeAheadInsert, state) {
|
|
231
|
-
return createPanelAction({
|
|
232
|
-
state: state,
|
|
233
|
-
attributes: {
|
|
234
|
-
panelType: PanelType.CUSTOM,
|
|
235
|
-
panelIcon: ':rainbow:',
|
|
236
|
-
panelIconId: '1f308',
|
|
237
|
-
panelIconText: '🌈',
|
|
238
|
-
// Ignored via go/ees007
|
|
239
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
240
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
241
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
242
|
-
panelColor: T50
|
|
243
|
-
},
|
|
244
|
-
api: api,
|
|
245
|
-
typeAheadInsert: typeAheadInsert
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
return quickInsertOptions;
|
|
226
|
+
});
|
|
251
227
|
}
|
|
228
|
+
return quickInsertOptions;
|
|
252
229
|
},
|
|
253
230
|
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
254
231
|
return getToolbarConfig(state, intl, options, providerFactory, api);
|
|
@@ -12,25 +12,25 @@ var panelTitleAndIcon = _defineProperty(_defineProperty(_defineProperty(_defineP
|
|
|
12
12
|
title: messages.info,
|
|
13
13
|
icon: StatusInformationIcon({
|
|
14
14
|
label: 'info-icon',
|
|
15
|
-
color: "var(--ds-icon-information, #
|
|
15
|
+
color: "var(--ds-icon-information, #357DE8)"
|
|
16
16
|
})
|
|
17
17
|
}), PanelType.NOTE, {
|
|
18
18
|
title: messages.note,
|
|
19
19
|
icon: StatusDiscoveryIcon({
|
|
20
20
|
label: 'note-icon',
|
|
21
|
-
color: "var(--ds-icon-discovery, #
|
|
21
|
+
color: "var(--ds-icon-discovery, #AF59E1)"
|
|
22
22
|
})
|
|
23
23
|
}), PanelType.SUCCESS, {
|
|
24
24
|
title: messages.success,
|
|
25
25
|
icon: StatusSuccessIcon({
|
|
26
26
|
label: 'success-icon',
|
|
27
|
-
color: "var(--ds-icon-success, #
|
|
27
|
+
color: "var(--ds-icon-success, #6A9A23)"
|
|
28
28
|
})
|
|
29
29
|
}), PanelType.WARNING, {
|
|
30
30
|
title: messages.warning,
|
|
31
31
|
icon: StatusWarningIcon({
|
|
32
32
|
label: 'warning-icon',
|
|
33
|
-
color: "var(--ds-icon-warning, #
|
|
33
|
+
color: "var(--ds-icon-warning, #E06C00)"
|
|
34
34
|
})
|
|
35
35
|
}), PanelType.ERROR, {
|
|
36
36
|
title: messages.error,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.6",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,23 +32,23 @@
|
|
|
32
32
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
33
33
|
"@atlaskit/editor-plugin-block-menu": "^5.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
35
|
-
"@atlaskit/editor-plugin-emoji": "^7.
|
|
35
|
+
"@atlaskit/editor-plugin-emoji": "^7.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-toolbar": "^3.4.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^3.8.0",
|
|
40
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
40
|
+
"@atlaskit/editor-toolbar": "^0.17.0",
|
|
41
41
|
"@atlaskit/emoji": "^69.6.0",
|
|
42
42
|
"@atlaskit/icon": "^28.5.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/theme": "^21.0.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
46
|
-
"@atlaskit/tokens": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^13.32.0",
|
|
46
|
+
"@atlaskit/tokens": "^8.0.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"uuid": "^3.1.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^110.
|
|
51
|
+
"@atlaskit/editor-common": "^110.24.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-dom": "^18.2.0",
|
|
54
54
|
"react-intl-next": "npm:react-intl@^5.18.1"
|