@atlaskit/editor-plugin-panel 4.0.0 → 4.0.1
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 +9 -0
- package/dist/cjs/ui/toolbar.js +58 -24
- package/dist/es2019/ui/toolbar.js +58 -24
- package/dist/esm/ui/toolbar.js +58 -24
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 4.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#117485](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/117485)
|
|
8
|
+
[`e9a8d9ba26963`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e9a8d9ba26963) -
|
|
9
|
+
Reorder icons, and remove some based on new editor controls. Changes under
|
|
10
|
+
`editor_plugin_controls` experiment.
|
|
11
|
+
|
|
3
12
|
## 4.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -28,6 +28,7 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
|
|
|
28
28
|
var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove-emoji"));
|
|
29
29
|
var _success2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/success"));
|
|
30
30
|
var _warning2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/warning"));
|
|
31
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
31
32
|
var _actions = require("../editor-actions/actions");
|
|
32
33
|
var _utils2 = require("../pm-plugins/utils/utils");
|
|
33
34
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -242,36 +243,69 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
242
243
|
}, colorPicker);
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
|
-
if (
|
|
246
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'control')) {
|
|
247
|
+
if (state) {
|
|
248
|
+
items.push({
|
|
249
|
+
type: 'separator'
|
|
250
|
+
});
|
|
251
|
+
items.push({
|
|
252
|
+
type: 'copy-button',
|
|
253
|
+
items: [{
|
|
254
|
+
state: state,
|
|
255
|
+
formatMessage: formatMessage,
|
|
256
|
+
nodeType: panelNodeType
|
|
257
|
+
}]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
246
260
|
items.push({
|
|
247
261
|
type: 'separator'
|
|
262
|
+
}, {
|
|
263
|
+
id: 'editor.panel.delete',
|
|
264
|
+
type: 'button',
|
|
265
|
+
appearance: 'danger',
|
|
266
|
+
focusEditoronEnter: true,
|
|
267
|
+
icon: _delete.default,
|
|
268
|
+
iconFallback: _remove.default,
|
|
269
|
+
onClick: (0, _actions.removePanel)(editorAnalyticsAPI),
|
|
270
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
271
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
272
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
273
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
274
|
+
title: formatMessage(_messages.default.remove),
|
|
275
|
+
tabIndex: null
|
|
248
276
|
});
|
|
277
|
+
} else {
|
|
249
278
|
items.push({
|
|
250
|
-
type: '
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
279
|
+
type: 'separator'
|
|
280
|
+
}, {
|
|
281
|
+
id: 'editor.panel.delete',
|
|
282
|
+
type: 'button',
|
|
283
|
+
appearance: 'danger',
|
|
284
|
+
focusEditoronEnter: true,
|
|
285
|
+
icon: _delete.default,
|
|
286
|
+
iconFallback: _remove.default,
|
|
287
|
+
onClick: (0, _actions.removePanel)(editorAnalyticsAPI),
|
|
288
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
289
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
290
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
291
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
292
|
+
title: formatMessage(_messages.default.remove),
|
|
293
|
+
tabIndex: null
|
|
256
294
|
});
|
|
295
|
+
if (state) {
|
|
296
|
+
items.push({
|
|
297
|
+
type: 'separator'
|
|
298
|
+
});
|
|
299
|
+
items.push({
|
|
300
|
+
type: 'copy-button',
|
|
301
|
+
items: [{
|
|
302
|
+
state: state,
|
|
303
|
+
formatMessage: formatMessage,
|
|
304
|
+
nodeType: panelNodeType
|
|
305
|
+
}]
|
|
306
|
+
});
|
|
307
|
+
}
|
|
257
308
|
}
|
|
258
|
-
items.push({
|
|
259
|
-
type: 'separator'
|
|
260
|
-
}, {
|
|
261
|
-
id: 'editor.panel.delete',
|
|
262
|
-
type: 'button',
|
|
263
|
-
appearance: 'danger',
|
|
264
|
-
focusEditoronEnter: true,
|
|
265
|
-
icon: _delete.default,
|
|
266
|
-
iconFallback: _remove.default,
|
|
267
|
-
onClick: (0, _actions.removePanel)(editorAnalyticsAPI),
|
|
268
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
269
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
270
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
271
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
272
|
-
title: formatMessage(_messages.default.remove),
|
|
273
|
-
tabIndex: null
|
|
274
|
-
});
|
|
275
309
|
return items;
|
|
276
310
|
};
|
|
277
311
|
var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
@@ -19,6 +19,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
19
19
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
20
20
|
import LegacySuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
21
21
|
import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
22
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
23
|
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
23
24
|
import { findPanel } from '../pm-plugins/utils/utils';
|
|
24
25
|
export const panelIconMap = {
|
|
@@ -226,36 +227,69 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
226
227
|
}, colorPicker);
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
if (
|
|
230
|
+
if (editorExperiment('platform_editor_controls', 'control')) {
|
|
231
|
+
if (state) {
|
|
232
|
+
items.push({
|
|
233
|
+
type: 'separator'
|
|
234
|
+
});
|
|
235
|
+
items.push({
|
|
236
|
+
type: 'copy-button',
|
|
237
|
+
items: [{
|
|
238
|
+
state,
|
|
239
|
+
formatMessage,
|
|
240
|
+
nodeType: panelNodeType
|
|
241
|
+
}]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
230
244
|
items.push({
|
|
231
245
|
type: 'separator'
|
|
246
|
+
}, {
|
|
247
|
+
id: 'editor.panel.delete',
|
|
248
|
+
type: 'button',
|
|
249
|
+
appearance: 'danger',
|
|
250
|
+
focusEditoronEnter: true,
|
|
251
|
+
icon: DeleteIcon,
|
|
252
|
+
iconFallback: RemoveIcon,
|
|
253
|
+
onClick: removePanel(editorAnalyticsAPI),
|
|
254
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
255
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
256
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
257
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
258
|
+
title: formatMessage(commonMessages.remove),
|
|
259
|
+
tabIndex: null
|
|
232
260
|
});
|
|
261
|
+
} else {
|
|
233
262
|
items.push({
|
|
234
|
-
type: '
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
263
|
+
type: 'separator'
|
|
264
|
+
}, {
|
|
265
|
+
id: 'editor.panel.delete',
|
|
266
|
+
type: 'button',
|
|
267
|
+
appearance: 'danger',
|
|
268
|
+
focusEditoronEnter: true,
|
|
269
|
+
icon: DeleteIcon,
|
|
270
|
+
iconFallback: RemoveIcon,
|
|
271
|
+
onClick: removePanel(editorAnalyticsAPI),
|
|
272
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
273
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
274
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
275
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
276
|
+
title: formatMessage(commonMessages.remove),
|
|
277
|
+
tabIndex: null
|
|
240
278
|
});
|
|
279
|
+
if (state) {
|
|
280
|
+
items.push({
|
|
281
|
+
type: 'separator'
|
|
282
|
+
});
|
|
283
|
+
items.push({
|
|
284
|
+
type: 'copy-button',
|
|
285
|
+
items: [{
|
|
286
|
+
state,
|
|
287
|
+
formatMessage,
|
|
288
|
+
nodeType: panelNodeType
|
|
289
|
+
}]
|
|
290
|
+
});
|
|
291
|
+
}
|
|
241
292
|
}
|
|
242
|
-
items.push({
|
|
243
|
-
type: 'separator'
|
|
244
|
-
}, {
|
|
245
|
-
id: 'editor.panel.delete',
|
|
246
|
-
type: 'button',
|
|
247
|
-
appearance: 'danger',
|
|
248
|
-
focusEditoronEnter: true,
|
|
249
|
-
icon: DeleteIcon,
|
|
250
|
-
iconFallback: RemoveIcon,
|
|
251
|
-
onClick: removePanel(editorAnalyticsAPI),
|
|
252
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
253
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
254
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
255
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
256
|
-
title: formatMessage(commonMessages.remove),
|
|
257
|
-
tabIndex: null
|
|
258
|
-
});
|
|
259
293
|
return items;
|
|
260
294
|
};
|
|
261
295
|
export const getToolbarConfig = (state, intl, options = {}, providerFactory, api) => {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -22,6 +22,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
22
22
|
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
23
23
|
import LegacySuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
24
24
|
import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
25
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
26
|
import { changePanelType, removePanel } from '../editor-actions/actions';
|
|
26
27
|
import { findPanel } from '../pm-plugins/utils/utils';
|
|
27
28
|
export var panelIconMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, PanelType.INFO, {
|
|
@@ -232,36 +233,69 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
232
233
|
}, colorPicker);
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
if (
|
|
236
|
+
if (editorExperiment('platform_editor_controls', 'control')) {
|
|
237
|
+
if (state) {
|
|
238
|
+
items.push({
|
|
239
|
+
type: 'separator'
|
|
240
|
+
});
|
|
241
|
+
items.push({
|
|
242
|
+
type: 'copy-button',
|
|
243
|
+
items: [{
|
|
244
|
+
state: state,
|
|
245
|
+
formatMessage: formatMessage,
|
|
246
|
+
nodeType: panelNodeType
|
|
247
|
+
}]
|
|
248
|
+
});
|
|
249
|
+
}
|
|
236
250
|
items.push({
|
|
237
251
|
type: 'separator'
|
|
252
|
+
}, {
|
|
253
|
+
id: 'editor.panel.delete',
|
|
254
|
+
type: 'button',
|
|
255
|
+
appearance: 'danger',
|
|
256
|
+
focusEditoronEnter: true,
|
|
257
|
+
icon: DeleteIcon,
|
|
258
|
+
iconFallback: RemoveIcon,
|
|
259
|
+
onClick: removePanel(editorAnalyticsAPI),
|
|
260
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
261
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
262
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
263
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
264
|
+
title: formatMessage(commonMessages.remove),
|
|
265
|
+
tabIndex: null
|
|
238
266
|
});
|
|
267
|
+
} else {
|
|
239
268
|
items.push({
|
|
240
|
-
type: '
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
269
|
+
type: 'separator'
|
|
270
|
+
}, {
|
|
271
|
+
id: 'editor.panel.delete',
|
|
272
|
+
type: 'button',
|
|
273
|
+
appearance: 'danger',
|
|
274
|
+
focusEditoronEnter: true,
|
|
275
|
+
icon: DeleteIcon,
|
|
276
|
+
iconFallback: RemoveIcon,
|
|
277
|
+
onClick: removePanel(editorAnalyticsAPI),
|
|
278
|
+
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
279
|
+
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
280
|
+
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
281
|
+
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
282
|
+
title: formatMessage(commonMessages.remove),
|
|
283
|
+
tabIndex: null
|
|
246
284
|
});
|
|
285
|
+
if (state) {
|
|
286
|
+
items.push({
|
|
287
|
+
type: 'separator'
|
|
288
|
+
});
|
|
289
|
+
items.push({
|
|
290
|
+
type: 'copy-button',
|
|
291
|
+
items: [{
|
|
292
|
+
state: state,
|
|
293
|
+
formatMessage: formatMessage,
|
|
294
|
+
nodeType: panelNodeType
|
|
295
|
+
}]
|
|
296
|
+
});
|
|
297
|
+
}
|
|
247
298
|
}
|
|
248
|
-
items.push({
|
|
249
|
-
type: 'separator'
|
|
250
|
-
}, {
|
|
251
|
-
id: 'editor.panel.delete',
|
|
252
|
-
type: 'button',
|
|
253
|
-
appearance: 'danger',
|
|
254
|
-
focusEditoronEnter: true,
|
|
255
|
-
icon: DeleteIcon,
|
|
256
|
-
iconFallback: RemoveIcon,
|
|
257
|
-
onClick: removePanel(editorAnalyticsAPI),
|
|
258
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
259
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
260
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
261
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
262
|
-
title: formatMessage(commonMessages.remove),
|
|
263
|
-
tabIndex: null
|
|
264
|
-
});
|
|
265
299
|
return items;
|
|
266
300
|
};
|
|
267
301
|
export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.2.1",
|
|
35
|
-
"@atlaskit/editor-common": "^100.
|
|
35
|
+
"@atlaskit/editor-common": "^100.1.0",
|
|
36
36
|
"@atlaskit/editor-palette": "2.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.3.0",
|
|
42
42
|
"@atlaskit/emoji": "^68.0.0",
|
|
43
|
-
"@atlaskit/icon": "^24.
|
|
43
|
+
"@atlaskit/icon": "^24.1.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/theme": "^17.0.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^3.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^3.2.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"uuid": "^3.1.0"
|
|
49
49
|
},
|