@atlaskit/editor-plugin-panel 6.0.3 → 6.0.5

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,23 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 6.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
8
+ [ux] ED-29120 add a new config option for default editor preset
9
+ (`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
10
+ for editors that can't be excluded at the experiment level.
11
+ - Updated dependencies
12
+
13
+ ## 6.0.4
14
+
15
+ ### Patch Changes
16
+
17
+ - [`db97eb262cc5a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/db97eb262cc5a) -
18
+ replace platform_editor_toolbar_aifc with separate experiements for jira and confluence
19
+ - Updated dependencies
20
+
3
21
  ## 6.0.3
4
22
 
5
23
  ### Patch Changes
@@ -28,7 +28,7 @@ var _statusSuccessEditorSuccess = _interopRequireDefault(require("@atlaskit/icon
28
28
  var _statusWarningEditorWarning = _interopRequireDefault(require("@atlaskit/icon/core/migration/status-warning--editor-warning"));
29
29
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
30
30
  var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove-emoji"));
31
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
31
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
32
32
  var _actions = require("../editor-actions/actions");
33
33
  var _utils2 = require("../pm-plugins/utils/utils");
34
34
  var _panelTypeDropdown = require("./panelTypeDropdown");
@@ -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 isNewEditorToolbarDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
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 = isNewEditorToolbarDisabled ? [{
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, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', 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 (isNewEditorToolbarDisabled) {
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);
@@ -18,7 +18,7 @@ import SuccessIcon from '@atlaskit/icon/core/migration/status-success--editor-su
18
18
  import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
19
19
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
20
20
  import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
21
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
22
  import { changePanelType, removePanel } from '../editor-actions/actions';
23
23
  import { findPanel } from '../pm-plugins/utils/utils';
24
24
  import { panelTypeDropdown } from './panelTypeDropdown';
@@ -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 isNewEditorToolbarDisabled = !areToolbarFlagsEnabled();
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 = isNewEditorToolbarDisabled ? [{
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
- }), ...(expValEquals('platform_editor_toolbar_aifc', 'isEnabled', 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 (isNewEditorToolbarDisabled) {
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);
@@ -22,7 +22,7 @@ import SuccessIcon from '@atlaskit/icon/core/migration/status-success--editor-su
22
22
  import WarningIcon from '@atlaskit/icon/core/migration/status-warning--editor-warning';
23
23
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
24
24
  import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
25
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
25
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
26
26
  import { changePanelType, removePanel } from '../editor-actions/actions';
27
27
  import { findPanel } from '../pm-plugins/utils/utils';
28
28
  import { panelTypeDropdown } from './panelTypeDropdown';
@@ -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 isNewEditorToolbarDisabled = !areToolbarFlagsEnabled();
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 = isNewEditorToolbarDisabled ? [{
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(expValEquals('platform_editor_toolbar_aifc', 'isEnabled', 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 (isNewEditorToolbarDisabled) {
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": "6.0.3",
3
+ "version": "6.0.5",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,6 +34,7 @@
34
34
  "@atlaskit/editor-plugin-decorations": "^4.0.0",
35
35
  "@atlaskit/editor-plugin-emoji": "^5.0.0",
36
36
  "@atlaskit/editor-plugin-selection": "^4.0.0",
37
+ "@atlaskit/editor-plugin-toolbar": "^1.2.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.4.0",
45
- "@atlaskit/tokens": "^6.2.0",
45
+ "@atlaskit/tmp-editor-statsig": "^12.8.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": "^108.2.0",
51
+ "@atlaskit/editor-common": "^108.6.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"