@atlaskit/editor-plugin-panel 6.0.4 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.0.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
|
|
14
|
+
[ux] ED-29120 add a new config option for default editor preset
|
|
15
|
+
(`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
|
|
16
|
+
for editors that can't be excluded at the experiment level.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.0.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -55,9 +55,10 @@ var panelIconMap = exports.panelIconMap = (0, _defineProperty2.default)((0, _def
|
|
|
55
55
|
id: 'atlassian-tip'
|
|
56
56
|
});
|
|
57
57
|
var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, editorAnalyticsAPI, activePanelType, activePanelColor, activePanelIcon, state, api) {
|
|
58
|
-
var
|
|
58
|
+
var areAllNewToolbarFlagsDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
59
|
+
|
|
59
60
|
// TODO: ED-14403 - investigate why these titles are not getting translated for the tooltips
|
|
60
|
-
var items =
|
|
61
|
+
var items = areAllNewToolbarFlagsDisabled ? [{
|
|
61
62
|
id: 'editor.panel.info',
|
|
62
63
|
type: 'button',
|
|
63
64
|
icon: _statusInformationEditorInfo.default,
|
|
@@ -101,7 +102,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
101
102
|
activePanelType: activePanelType,
|
|
102
103
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
103
104
|
formatMessage: formatMessage
|
|
104
|
-
})].concat((0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) ? [] : [{
|
|
105
|
+
})].concat((0, _toConsumableArray2.default)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) ? [] : [{
|
|
105
106
|
type: 'separator'
|
|
106
107
|
}]));
|
|
107
108
|
if (isCustomPanelEnabled) {
|
|
@@ -250,7 +251,7 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
|
|
|
250
251
|
}, colorPicker);
|
|
251
252
|
}
|
|
252
253
|
}
|
|
253
|
-
if (
|
|
254
|
+
if (areAllNewToolbarFlagsDisabled) {
|
|
254
255
|
if (state) {
|
|
255
256
|
items.push({
|
|
256
257
|
type: 'separator'
|
|
@@ -345,7 +346,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
|
|
|
345
346
|
};
|
|
346
347
|
|
|
347
348
|
// force toolbar to be turned on
|
|
348
|
-
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state, (0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ? api : undefined);
|
|
349
|
+
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state, (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) ? api : undefined);
|
|
349
350
|
var getDomRef = function getDomRef(editorView) {
|
|
350
351
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
351
352
|
var element = (0, _utils.findDomRefAtPos)(panelObject.pos, domAtPos);
|
|
@@ -49,9 +49,10 @@ export const panelIconMap = {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, editorAnalyticsAPI, activePanelType, activePanelColor, activePanelIcon, state, api) => {
|
|
52
|
-
const
|
|
52
|
+
const areAllNewToolbarFlagsDisabled = !areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
53
|
+
|
|
53
54
|
// TODO: ED-14403 - investigate why these titles are not getting translated for the tooltips
|
|
54
|
-
const items =
|
|
55
|
+
const items = areAllNewToolbarFlagsDisabled ? [{
|
|
55
56
|
id: 'editor.panel.info',
|
|
56
57
|
type: 'button',
|
|
57
58
|
icon: InformationIcon,
|
|
@@ -95,7 +96,7 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
95
96
|
activePanelType,
|
|
96
97
|
editorAnalyticsAPI,
|
|
97
98
|
formatMessage
|
|
98
|
-
}), ...(editorExperiment('platform_editor_toolbar_aifc', true) ? [] : [{
|
|
99
|
+
}), ...(Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true) ? [] : [{
|
|
99
100
|
type: 'separator'
|
|
100
101
|
}])];
|
|
101
102
|
if (isCustomPanelEnabled) {
|
|
@@ -232,7 +233,7 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
232
233
|
}, colorPicker);
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
if (
|
|
236
|
+
if (areAllNewToolbarFlagsDisabled) {
|
|
236
237
|
if (state) {
|
|
237
238
|
items.push({
|
|
238
239
|
type: 'separator'
|
|
@@ -325,7 +326,7 @@ export const getToolbarConfig = (state, intl, options = {}, providerFactory, api
|
|
|
325
326
|
};
|
|
326
327
|
|
|
327
328
|
// force toolbar to be turned on
|
|
328
|
-
const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state, areToolbarFlagsEnabled() ? api : undefined);
|
|
329
|
+
const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state, areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) ? api : undefined);
|
|
329
330
|
const getDomRef = editorView => {
|
|
330
331
|
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
331
332
|
const element = findDomRefAtPos(panelObject.pos, domAtPos);
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -46,9 +46,10 @@ export var panelIconMap = _defineProperty(_defineProperty(_defineProperty(_defin
|
|
|
46
46
|
id: 'atlassian-tip'
|
|
47
47
|
});
|
|
48
48
|
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, editorAnalyticsAPI, activePanelType, activePanelColor, activePanelIcon, state, api) {
|
|
49
|
-
var
|
|
49
|
+
var areAllNewToolbarFlagsDisabled = !areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
50
|
+
|
|
50
51
|
// TODO: ED-14403 - investigate why these titles are not getting translated for the tooltips
|
|
51
|
-
var items =
|
|
52
|
+
var items = areAllNewToolbarFlagsDisabled ? [{
|
|
52
53
|
id: 'editor.panel.info',
|
|
53
54
|
type: 'button',
|
|
54
55
|
icon: InformationIcon,
|
|
@@ -92,7 +93,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
92
93
|
activePanelType: activePanelType,
|
|
93
94
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
94
95
|
formatMessage: formatMessage
|
|
95
|
-
})].concat(_toConsumableArray(editorExperiment('platform_editor_toolbar_aifc', true) ? [] : [{
|
|
96
|
+
})].concat(_toConsumableArray(Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true) ? [] : [{
|
|
96
97
|
type: 'separator'
|
|
97
98
|
}]));
|
|
98
99
|
if (isCustomPanelEnabled) {
|
|
@@ -241,7 +242,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
241
242
|
}, colorPicker);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
|
-
if (
|
|
245
|
+
if (areAllNewToolbarFlagsDisabled) {
|
|
245
246
|
if (state) {
|
|
246
247
|
items.push({
|
|
247
248
|
type: 'separator'
|
|
@@ -336,7 +337,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
336
337
|
};
|
|
337
338
|
|
|
338
339
|
// force toolbar to be turned on
|
|
339
|
-
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state, areToolbarFlagsEnabled() ? api : undefined);
|
|
340
|
+
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state, areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) ? api : undefined);
|
|
340
341
|
var getDomRef = function getDomRef(editorView) {
|
|
341
342
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
342
343
|
var element = findDomRefAtPos(panelObject.pos, domAtPos);
|
|
@@ -5,6 +5,7 @@ import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
|
5
5
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
6
|
import { type EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
7
7
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
8
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
10
|
export declare const pluginKey: PluginKey<any>;
|
|
10
11
|
export interface PanelPluginOptions extends LongPressSelectionPluginOptions, PanelPluginConfig {
|
|
@@ -30,6 +31,7 @@ export type EmojiInfo = {
|
|
|
30
31
|
export type PanelPluginDependencies = [
|
|
31
32
|
typeof decorationsPlugin,
|
|
32
33
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
34
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
33
35
|
EmojiPlugin,
|
|
34
36
|
OptionalPlugin<BlockMenuPlugin>,
|
|
35
37
|
OptionalPlugin<SelectionPlugin>
|
|
@@ -5,6 +5,7 @@ import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
|
5
5
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
6
|
import { type EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
7
7
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
8
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
10
|
export declare const pluginKey: PluginKey<any>;
|
|
10
11
|
export interface PanelPluginOptions extends LongPressSelectionPluginOptions, PanelPluginConfig {
|
|
@@ -30,6 +31,7 @@ export type EmojiInfo = {
|
|
|
30
31
|
export type PanelPluginDependencies = [
|
|
31
32
|
typeof decorationsPlugin,
|
|
32
33
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
34
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
33
35
|
EmojiPlugin,
|
|
34
36
|
OptionalPlugin<BlockMenuPlugin>,
|
|
35
37
|
OptionalPlugin<SelectionPlugin>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,13 +27,14 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^
|
|
30
|
+
"@atlaskit/adf-schema": "^51.0.0",
|
|
31
31
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
32
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
33
|
-
"@atlaskit/editor-plugin-block-menu": "^
|
|
34
|
-
"@atlaskit/editor-plugin-decorations": "^
|
|
35
|
-
"@atlaskit/editor-plugin-emoji": "^
|
|
36
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
32
|
+
"@atlaskit/editor-plugin-analytics": "^5.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-block-menu": "^2.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-decorations": "^5.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-emoji": "^6.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-selection": "^5.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-toolbar": "^2.0.0",
|
|
37
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
39
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
39
40
|
"@atlaskit/editor-toolbar": "^0.8.0",
|
|
@@ -41,13 +42,13 @@
|
|
|
41
42
|
"@atlaskit/icon": "^28.1.0",
|
|
42
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
44
|
"@atlaskit/theme": "^20.0.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
45
|
-
"@atlaskit/tokens": "^6.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^12.9.0",
|
|
46
|
+
"@atlaskit/tokens": "^6.3.0",
|
|
46
47
|
"@babel/runtime": "^7.0.0",
|
|
47
48
|
"uuid": "^3.1.0"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
|
-
"@atlaskit/editor-common": "^
|
|
51
|
+
"@atlaskit/editor-common": "^109.0.0",
|
|
51
52
|
"react": "^18.2.0",
|
|
52
53
|
"react-dom": "^18.2.0",
|
|
53
54
|
"react-intl-next": "npm:react-intl@^5.18.1"
|