@atlaskit/editor-plugin-toolbar 4.1.5 → 4.1.7

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,22 @@
1
1
  # @atlaskit/editor-plugin-toolbar
2
2
 
3
+ ## 4.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`38dee2c85c456`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38dee2c85c456) -
8
+ [ux] [EDITOR-4486] render tooltips for ToolbarDropdownMenu using new TooltipComponent prop behind
9
+ platform_editor_hide_toolbar_tooltips_fix
10
+ - Updated dependencies
11
+
12
+ ## 4.1.6
13
+
14
+ ### Patch Changes
15
+
16
+ - [`e504eea6e1d3f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e504eea6e1d3f) -
17
+ EDITOR-4665: Clean up platform_editor_toolbar_aifc_responsive_improve feature flag
18
+ - Updated dependencies
19
+
3
20
  ## 4.1.5
4
21
 
5
22
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getSelectionToolbarOpenExperiencePlugin = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _analytics = require("@atlaskit/editor-common/analytics");
9
10
  var _experiences = require("@atlaskit/editor-common/experiences");
10
11
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
11
12
  var _state = require("@atlaskit/editor-prosemirror/state");
@@ -44,7 +45,7 @@ var getSelectionToolbarOpenExperiencePlugin = exports.getSelectionToolbarOpenExp
44
45
  return targetEl;
45
46
  };
46
47
  var experience = new _experiences.Experience(_experiences.EXPERIENCE_ID.TOOLBAR_OPEN, {
47
- actionSubjectId: 'selectionToolbar',
48
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.SELECTION_TOOLBAR,
48
49
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
49
50
  checks: [new _experiences.ExperienceCheckTimeout({
50
51
  durationMs: 1000,
@@ -14,7 +14,6 @@ var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
16
16
  var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
18
  var _selectionToolbarOpenExperience = require("./pm-plugins/experiences/selection-toolbar-open-experience");
20
19
  var _pluginKey = require("./pm-plugins/plugin-key");
@@ -103,7 +102,7 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
103
102
  return contextualFormattingEnabled !== null && contextualFormattingEnabled !== void 0 ? contextualFormattingEnabled : 'always-pinned';
104
103
  },
105
104
  getBreakpointPreset: function getBreakpointPreset() {
106
- return (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_responsive_improve') ? breakpointPreset : undefined;
105
+ return breakpointPreset;
107
106
  }
108
107
  },
109
108
  getSharedState: function getSharedState(editorState) {
@@ -9,10 +9,23 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _messages = require("@atlaskit/editor-common/messages");
11
11
  var _editorToolbar = require("@atlaskit/editor-toolbar");
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  var OverflowMenu = exports.OverflowMenu = function OverflowMenu(_ref) {
13
14
  var children = _ref.children;
14
15
  var intl = (0, _reactIntlNext.useIntl)();
15
16
  var tooltipContent = intl.formatMessage(_messages.toolbarMessages.selectionToolbarOverflowMenuTooltip);
17
+ if ((0, _expValEquals.expValEquals)('platform_editor_hide_toolbar_tooltips_fix', 'isEnabled', true)) {
18
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
19
+ label: tooltipContent,
20
+ iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.ShowMoreHorizontalIcon, {
21
+ label: ""
22
+ }),
23
+ tooltipComponent: /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
24
+ content: tooltipContent,
25
+ position: "top"
26
+ })
27
+ }, children);
28
+ }
16
29
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
17
30
  content: tooltipContent,
18
31
  position: "top"
@@ -24,7 +24,6 @@ var PrimaryToolbar = exports.PrimaryToolbar = function PrimaryToolbar(_ref) {
24
24
  editorAppearance = _useEditorToolbar.editorAppearance;
25
25
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.PrimaryToolbar, {
26
26
  label: "Primary Toolbar",
27
- reducedBreakpoints: editorAppearance !== 'full-page',
28
27
  breakpointPreset: getBreakpointPreset(breakpointPreset, editorAppearance)
29
28
  }, children);
30
29
  };
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _messages = require("@atlaskit/editor-common/messages");
11
11
  var _editorToolbar = require("@atlaskit/editor-toolbar");
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  /**
13
14
  * Basic version of existing 'Text Styles' Menu - which doesn't dynamically change icon
14
15
  * and is also placeholder to render all other menus in the collapsed state.
@@ -17,6 +18,18 @@ var TextCollapsedMenu = exports.TextCollapsedMenu = function TextCollapsedMenu(_
17
18
  var children = _ref.children;
18
19
  var _useIntl = (0, _reactIntlNext.useIntl)(),
19
20
  formatMessage = _useIntl.formatMessage;
21
+ if ((0, _expValEquals.expValEquals)('platform_editor_hide_toolbar_tooltips_fix', 'isEnabled', true)) {
22
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
23
+ iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.TextIcon, {
24
+ label: formatMessage(_messages.toolbarMessages.textStylesTooltip),
25
+ size: "small"
26
+ }),
27
+ enableMaxHeight: true,
28
+ tooltipComponent: /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
29
+ content: formatMessage(_messages.toolbarMessages.textStylesTooltip)
30
+ })
31
+ }, children);
32
+ }
20
33
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
21
34
  content: formatMessage(_messages.toolbarMessages.textStylesTooltip)
22
35
  }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
@@ -1,4 +1,5 @@
1
- import { Experience, EXPERIENCE_ID, ExperienceCheckDomMutation, ExperienceCheckTimeout, containsPopupWithNestedElement, getPopupContainerFromEditorView } from '@atlaskit/editor-common/experiences';
1
+ import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
2
+ import { containsPopupWithNestedElement, Experience, EXPERIENCE_ID, ExperienceCheckDomMutation, ExperienceCheckTimeout, getPopupContainerFromEditorView } from '@atlaskit/editor-common/experiences';
2
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
4
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
5
  const pluginKey = new PluginKey('selectionToolbarOpenExperience');
@@ -37,7 +38,7 @@ export const getSelectionToolbarOpenExperiencePlugin = ({
37
38
  return targetEl;
38
39
  };
39
40
  const experience = new Experience(EXPERIENCE_ID.TOOLBAR_OPEN, {
40
- actionSubjectId: 'selectionToolbar',
41
+ actionSubjectId: ACTION_SUBJECT_ID.SELECTION_TOOLBAR,
41
42
  dispatchAnalyticsEvent,
42
43
  checks: [new ExperienceCheckTimeout({
43
44
  durationMs: 1000,
@@ -5,7 +5,6 @@ import { calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils
5
5
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
9
  import { getSelectionToolbarOpenExperiencePlugin } from './pm-plugins/experiences/selection-toolbar-open-experience';
11
10
  import { editorToolbarPluginKey } from './pm-plugins/plugin-key';
@@ -88,7 +87,7 @@ export const toolbarPlugin = ({
88
87
  return contextualFormattingEnabled !== null && contextualFormattingEnabled !== void 0 ? contextualFormattingEnabled : 'always-pinned';
89
88
  },
90
89
  getBreakpointPreset: () => {
91
- return fg('platform_editor_toolbar_aifc_responsive_improve') ? breakpointPreset : undefined;
90
+ return breakpointPreset;
92
91
  }
93
92
  },
94
93
  getSharedState(editorState) {
@@ -2,11 +2,24 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
4
4
  import { ShowMoreHorizontalIcon, ToolbarDropdownMenu, ToolbarTooltip } from '@atlaskit/editor-toolbar';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  export const OverflowMenu = ({
6
7
  children
7
8
  }) => {
8
9
  const intl = useIntl();
9
10
  const tooltipContent = intl.formatMessage(toolbarMessages.selectionToolbarOverflowMenuTooltip);
11
+ if (expValEquals('platform_editor_hide_toolbar_tooltips_fix', 'isEnabled', true)) {
12
+ return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
13
+ label: tooltipContent,
14
+ iconBefore: /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
15
+ label: ""
16
+ }),
17
+ tooltipComponent: /*#__PURE__*/React.createElement(ToolbarTooltip, {
18
+ content: tooltipContent,
19
+ position: "top"
20
+ })
21
+ }, children);
22
+ }
10
23
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
11
24
  content: tooltipContent,
12
25
  position: "top"
@@ -19,7 +19,6 @@ export const PrimaryToolbar = ({
19
19
  } = useEditorToolbar();
20
20
  return /*#__PURE__*/React.createElement(PrimaryToolbarBase, {
21
21
  label: "Primary Toolbar",
22
- reducedBreakpoints: editorAppearance !== 'full-page',
23
22
  breakpointPreset: getBreakpointPreset(breakpointPreset, editorAppearance)
24
23
  }, children);
25
24
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
4
4
  import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  /**
6
7
  * Basic version of existing 'Text Styles' Menu - which doesn't dynamically change icon
7
8
  * and is also placeholder to render all other menus in the collapsed state.
@@ -12,6 +13,18 @@ export const TextCollapsedMenu = ({
12
13
  const {
13
14
  formatMessage
14
15
  } = useIntl();
16
+ if (expValEquals('platform_editor_hide_toolbar_tooltips_fix', 'isEnabled', true)) {
17
+ return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
18
+ iconBefore: /*#__PURE__*/React.createElement(TextIcon, {
19
+ label: formatMessage(toolbarMessages.textStylesTooltip),
20
+ size: "small"
21
+ }),
22
+ enableMaxHeight: true,
23
+ tooltipComponent: /*#__PURE__*/React.createElement(ToolbarTooltip, {
24
+ content: formatMessage(toolbarMessages.textStylesTooltip)
25
+ })
26
+ }, children);
27
+ }
15
28
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
16
29
  content: formatMessage(toolbarMessages.textStylesTooltip)
17
30
  }, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
@@ -1,5 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import { Experience, EXPERIENCE_ID, ExperienceCheckDomMutation, ExperienceCheckTimeout, containsPopupWithNestedElement, getPopupContainerFromEditorView } from '@atlaskit/editor-common/experiences';
2
+ import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
3
+ import { containsPopupWithNestedElement, Experience, EXPERIENCE_ID, ExperienceCheckDomMutation, ExperienceCheckTimeout, getPopupContainerFromEditorView } from '@atlaskit/editor-common/experiences';
3
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
5
6
  var pluginKey = new PluginKey('selectionToolbarOpenExperience');
@@ -37,7 +38,7 @@ export var getSelectionToolbarOpenExperiencePlugin = function getSelectionToolba
37
38
  return targetEl;
38
39
  };
39
40
  var experience = new Experience(EXPERIENCE_ID.TOOLBAR_OPEN, {
40
- actionSubjectId: 'selectionToolbar',
41
+ actionSubjectId: ACTION_SUBJECT_ID.SELECTION_TOOLBAR,
41
42
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
42
43
  checks: [new ExperienceCheckTimeout({
43
44
  durationMs: 1000,
@@ -9,7 +9,6 @@ import { calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils
9
9
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
11
11
  import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import { getSelectionToolbarOpenExperiencePlugin } from './pm-plugins/experiences/selection-toolbar-open-experience';
15
14
  import { editorToolbarPluginKey } from './pm-plugins/plugin-key';
@@ -96,7 +95,7 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
96
95
  return contextualFormattingEnabled !== null && contextualFormattingEnabled !== void 0 ? contextualFormattingEnabled : 'always-pinned';
97
96
  },
98
97
  getBreakpointPreset: function getBreakpointPreset() {
99
- return fg('platform_editor_toolbar_aifc_responsive_improve') ? breakpointPreset : undefined;
98
+ return breakpointPreset;
100
99
  }
101
100
  },
102
101
  getSharedState: function getSharedState(editorState) {
@@ -2,10 +2,23 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
4
4
  import { ShowMoreHorizontalIcon, ToolbarDropdownMenu, ToolbarTooltip } from '@atlaskit/editor-toolbar';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  export var OverflowMenu = function OverflowMenu(_ref) {
6
7
  var children = _ref.children;
7
8
  var intl = useIntl();
8
9
  var tooltipContent = intl.formatMessage(toolbarMessages.selectionToolbarOverflowMenuTooltip);
10
+ if (expValEquals('platform_editor_hide_toolbar_tooltips_fix', 'isEnabled', true)) {
11
+ return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
12
+ label: tooltipContent,
13
+ iconBefore: /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
14
+ label: ""
15
+ }),
16
+ tooltipComponent: /*#__PURE__*/React.createElement(ToolbarTooltip, {
17
+ content: tooltipContent,
18
+ position: "top"
19
+ })
20
+ }, children);
21
+ }
9
22
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
10
23
  content: tooltipContent,
11
24
  position: "top"
@@ -17,7 +17,6 @@ export var PrimaryToolbar = function PrimaryToolbar(_ref) {
17
17
  editorAppearance = _useEditorToolbar.editorAppearance;
18
18
  return /*#__PURE__*/React.createElement(PrimaryToolbarBase, {
19
19
  label: "Primary Toolbar",
20
- reducedBreakpoints: editorAppearance !== 'full-page',
21
20
  breakpointPreset: getBreakpointPreset(breakpointPreset, editorAppearance)
22
21
  }, children);
23
22
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
4
4
  import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  /**
6
7
  * Basic version of existing 'Text Styles' Menu - which doesn't dynamically change icon
7
8
  * and is also placeholder to render all other menus in the collapsed state.
@@ -10,6 +11,18 @@ export var TextCollapsedMenu = function TextCollapsedMenu(_ref) {
10
11
  var children = _ref.children;
11
12
  var _useIntl = useIntl(),
12
13
  formatMessage = _useIntl.formatMessage;
14
+ if (expValEquals('platform_editor_hide_toolbar_tooltips_fix', 'isEnabled', true)) {
15
+ return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
16
+ iconBefore: /*#__PURE__*/React.createElement(TextIcon, {
17
+ label: formatMessage(toolbarMessages.textStylesTooltip),
18
+ size: "small"
19
+ }),
20
+ enableMaxHeight: true,
21
+ tooltipComponent: /*#__PURE__*/React.createElement(ToolbarTooltip, {
22
+ content: formatMessage(toolbarMessages.textStylesTooltip)
23
+ })
24
+ }, children);
25
+ }
13
26
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
14
27
  content: formatMessage(toolbarMessages.textStylesTooltip)
15
28
  }, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
@@ -1,4 +1,4 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
1
+ import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  type SelectionToolbarOpenExperienceOptions = {
4
4
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
@@ -1,4 +1,4 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
1
+ import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  type SelectionToolbarOpenExperienceOptions = {
4
4
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "4.1.5",
3
+ "version": "4.1.7",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,26 +35,23 @@
35
35
  "@atlaskit/editor-plugin-selection": "^7.0.0",
36
36
  "@atlaskit/editor-plugin-user-intent": "^5.0.0",
37
37
  "@atlaskit/editor-plugin-user-preferences": "^5.0.0",
38
- "@atlaskit/editor-prosemirror": "^7.2.0",
38
+ "@atlaskit/editor-prosemirror": "^7.3.0",
39
39
  "@atlaskit/editor-toolbar": "^0.19.0",
40
40
  "@atlaskit/editor-toolbar-model": "^0.3.0",
41
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
- "@atlaskit/tmp-editor-statsig": "^17.1.0",
42
+ "@atlaskit/tmp-editor-statsig": "^17.13.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "bind-event-listener": "^3.0.0",
45
45
  "react-intl-next": "npm:react-intl@^5.18.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^111.9.0",
48
+ "@atlaskit/editor-common": "^111.11.0",
49
49
  "react": "^18.2.0"
50
50
  },
51
51
  "platform-feature-flags": {
52
52
  "platform_editor_toolbar_aifc_placement_overridden": {
53
53
  "type": "boolean"
54
54
  },
55
- "platform_editor_toolbar_aifc_responsive_improve": {
56
- "type": "boolean"
57
- },
58
55
  "platform_editor_toolbar_aifc_undo_redo_confluence": {
59
56
  "type": "boolean"
60
57
  }