@atlaskit/editor-plugin-floating-toolbar 5.1.2 → 5.1.4

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-floating-toolbar
2
2
 
3
+ ## 5.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e8620c2d72167`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8620c2d72167) -
8
+ [ux] [ED-28572] Explicitly set overflow dropdown to right aligned with main floating toolbar to
9
+ ensure consistency position across products
10
+ - Updated dependencies
11
+
12
+ ## 5.1.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [#192710](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192710)
17
+ [`b3b30f3bc4453`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3b30f3bc4453) -
18
+ Internal changes to how border radius and border width values are applied. No visual change.
19
+
3
20
  ## 5.1.2
4
21
 
5
22
  ### Patch Changes
@@ -157,7 +157,8 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
157
157
  onMount = _this$props2.onMount,
158
158
  pulse = _this$props2.pulse,
159
159
  spotlightConfig = _this$props2.spotlightConfig,
160
- shouldFitContainer = _this$props2.shouldFitContainer;
160
+ shouldFitContainer = _this$props2.shouldFitContainer,
161
+ alignX = _this$props2.alignX;
161
162
  var trigger;
162
163
  if (icon) {
163
164
  var TriggerIcon = hideExpandIcon ? icon : (0, _react2.jsx)(CompositeIcon, {
@@ -218,6 +219,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
218
219
  * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/137394/overview?commentId=8130003
219
220
  */
220
221
  (0, _react2.jsx)(_uiMenu.DropdownContainer, {
222
+ alignX: alignX,
221
223
  mountTo: mountPoint,
222
224
  boundariesElement: boundariesElement,
223
225
  scrollableElement: scrollableElement,
@@ -21,14 +21,14 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
21
21
  var rightSideStyles = (0, _primitives.xcss)({
22
22
  borderLeft: "solid ".concat("var(--ds-border, #091E4224)", " 1px"),
23
23
  right: 'space.0',
24
- borderTopRightRadius: '3px',
25
- borderBottomRightRadius: '3px'
24
+ borderTopRightRadius: 'border.radius.100',
25
+ borderBottomRightRadius: 'border.radius.100'
26
26
  });
27
27
  var leftSideStyles = (0, _primitives.xcss)({
28
28
  borderRight: "solid ".concat("var(--ds-border, #091E4224)", " 1px"),
29
29
  left: 'space.0',
30
- borderTopLeftRadius: '3px',
31
- borderBottomLeftRadius: '3px'
30
+ borderTopLeftRadius: 'border.radius.100',
31
+ borderBottomLeftRadius: 'border.radius.100'
32
32
  });
33
33
  var buttonCommonStyles = (0, _primitives.xcss)({
34
34
  backgroundColor: 'elevation.surface.overlay',
@@ -27,6 +27,7 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
27
27
  var _editorPalette = require("@atlaskit/editor-palette");
28
28
  var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
29
29
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
30
31
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
31
32
  var _forceFocus = require("../pm-plugins/force-focus");
32
33
  var _commands = require("../pm-plugins/toolbar-data/commands");
@@ -96,6 +97,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
96
97
  api = _ref.api,
97
98
  intl = _ref.intl;
98
99
  var emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
100
+ var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
99
101
  var renderItem = function renderItem(item, idx) {
100
102
  var _api$contextPanel, _api$extension;
101
103
  switch (item.type) {
@@ -194,6 +196,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
194
196
  }
195
197
  case 'overflow-dropdown':
196
198
  return (0, _react2.jsx)(_Dropdown.default, {
199
+ alignX: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_toolbar_aifc', 'isEnabled', true) ? 'right' : undefined,
197
200
  key: idx,
198
201
  title: intl.formatMessage(_messages.default.viewMore),
199
202
  icon: (0, _react2.jsx)(_showMoreHorizontal.default, {
@@ -341,7 +344,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
341
344
  scrollable: scrollable
342
345
  });
343
346
  case 'separator':
344
- if ((0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
347
+ if (isNewEditorToolbarEnabled) {
345
348
  return item.fullHeight ? (0, _react2.jsx)(_ui.FloatingToolbarSeparator, {
346
349
  key: idx,
347
350
  fullHeight: true
@@ -365,7 +368,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
365
368
  // Ignored via go/ees005
366
369
  // eslint-disable-next-line react/no-array-index-key
367
370
  key: index,
368
- css: (0, _toolbarFlagCheck.areToolbarFlagsEnabled)() ? buttonGroupStylesNew : buttonGroupStyles,
371
+ css: isNewEditorToolbarEnabled ? buttonGroupStylesNew : buttonGroupStyles,
369
372
  role: "radiogroup",
370
373
  "aria-label": groupLabel !== null && groupLabel !== void 0 ? groupLabel : undefined,
371
374
  "data-testid": "editor-floating-toolbar-grouped-buttons"
@@ -138,7 +138,8 @@ export default class Dropdown extends Component {
138
138
  onMount,
139
139
  pulse,
140
140
  spotlightConfig,
141
- shouldFitContainer
141
+ shouldFitContainer,
142
+ alignX
142
143
  } = this.props;
143
144
  let trigger;
144
145
  if (icon) {
@@ -200,6 +201,7 @@ export default class Dropdown extends Component {
200
201
  * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/137394/overview?commentId=8130003
201
202
  */
202
203
  jsx(UiDropdown, {
204
+ alignX: alignX,
203
205
  mountTo: mountPoint,
204
206
  boundariesElement: boundariesElement,
205
207
  scrollableElement: scrollableElement,
@@ -10,14 +10,14 @@ import { Box, xcss } from '@atlaskit/primitives';
10
10
  const rightSideStyles = xcss({
11
11
  borderLeft: `solid ${"var(--ds-border, #091E4224)"} 1px`,
12
12
  right: 'space.0',
13
- borderTopRightRadius: '3px',
14
- borderBottomRightRadius: '3px'
13
+ borderTopRightRadius: 'border.radius.100',
14
+ borderBottomRightRadius: 'border.radius.100'
15
15
  });
16
16
  const leftSideStyles = xcss({
17
17
  borderRight: `solid ${"var(--ds-border, #091E4224)"} 1px`,
18
18
  left: 'space.0',
19
- borderTopLeftRadius: '3px',
20
- borderBottomLeftRadius: '3px'
19
+ borderTopLeftRadius: 'border.radius.100',
20
+ borderBottomLeftRadius: 'border.radius.100'
21
21
  });
22
22
  const buttonCommonStyles = xcss({
23
23
  backgroundColor: 'elevation.surface.overlay',
@@ -20,6 +20,7 @@ import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/
20
20
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
21
21
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
22
22
  import { fg } from '@atlaskit/platform-feature-flags';
23
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
23
24
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
24
25
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
25
26
  import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
@@ -86,6 +87,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
86
87
  intl
87
88
  }) => {
88
89
  const emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
90
+ const isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
89
91
  const renderItem = (item, idx) => {
90
92
  var _api$contextPanel, _api$extension;
91
93
  switch (item.type) {
@@ -172,6 +174,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
172
174
  }
173
175
  case 'overflow-dropdown':
174
176
  return jsx(Dropdown, {
177
+ alignX: expValEqualsNoExposure('platform_editor_toolbar_aifc', 'isEnabled', true) ? 'right' : undefined,
175
178
  key: idx,
176
179
  title: intl.formatMessage(commonMessages.viewMore),
177
180
  icon: jsx(ShowMoreHorizontalIcon, {
@@ -315,7 +318,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
315
318
  scrollable: scrollable
316
319
  });
317
320
  case 'separator':
318
- if (areToolbarFlagsEnabled()) {
321
+ if (isNewEditorToolbarEnabled) {
319
322
  return item.fullHeight ? jsx(Separator, {
320
323
  key: idx,
321
324
  fullHeight: true
@@ -337,7 +340,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
337
340
  // Ignored via go/ees005
338
341
  // eslint-disable-next-line react/no-array-index-key
339
342
  key: index,
340
- css: areToolbarFlagsEnabled() ? buttonGroupStylesNew : buttonGroupStyles,
343
+ css: isNewEditorToolbarEnabled ? buttonGroupStylesNew : buttonGroupStyles,
341
344
  role: "radiogroup",
342
345
  "aria-label": groupLabel !== null && groupLabel !== void 0 ? groupLabel : undefined,
343
346
  "data-testid": "editor-floating-toolbar-grouped-buttons"
@@ -153,7 +153,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
153
153
  onMount = _this$props2.onMount,
154
154
  pulse = _this$props2.pulse,
155
155
  spotlightConfig = _this$props2.spotlightConfig,
156
- shouldFitContainer = _this$props2.shouldFitContainer;
156
+ shouldFitContainer = _this$props2.shouldFitContainer,
157
+ alignX = _this$props2.alignX;
157
158
  var trigger;
158
159
  if (icon) {
159
160
  var TriggerIcon = hideExpandIcon ? icon : jsx(CompositeIcon, {
@@ -214,6 +215,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
214
215
  * https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/137394/overview?commentId=8130003
215
216
  */
216
217
  jsx(UiDropdown, {
218
+ alignX: alignX,
217
219
  mountTo: mountPoint,
218
220
  boundariesElement: boundariesElement,
219
221
  scrollableElement: scrollableElement,
@@ -11,14 +11,14 @@ import { Box, xcss } from '@atlaskit/primitives';
11
11
  var rightSideStyles = xcss({
12
12
  borderLeft: "solid ".concat("var(--ds-border, #091E4224)", " 1px"),
13
13
  right: 'space.0',
14
- borderTopRightRadius: '3px',
15
- borderBottomRightRadius: '3px'
14
+ borderTopRightRadius: 'border.radius.100',
15
+ borderBottomRightRadius: 'border.radius.100'
16
16
  });
17
17
  var leftSideStyles = xcss({
18
18
  borderRight: "solid ".concat("var(--ds-border, #091E4224)", " 1px"),
19
19
  left: 'space.0',
20
- borderTopLeftRadius: '3px',
21
- borderBottomLeftRadius: '3px'
20
+ borderTopLeftRadius: 'border.radius.100',
21
+ borderBottomLeftRadius: 'border.radius.100'
22
22
  });
23
23
  var buttonCommonStyles = xcss({
24
24
  backgroundColor: 'elevation.surface.overlay',
@@ -27,6 +27,7 @@ import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/
27
27
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
28
28
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
29
29
  import { fg } from '@atlaskit/platform-feature-flags';
30
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
30
31
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
31
32
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
32
33
  import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
@@ -90,6 +91,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
90
91
  api = _ref.api,
91
92
  intl = _ref.intl;
92
93
  var emojiAndColourPickerMountPoint = scrollable ? popupsMountPoint || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.fabric-editor-popup-scroll-parent')) || (editorView === null || editorView === void 0 ? void 0 : editorView.dom.closest('.ak-editor-content-area')) || undefined : popupsMountPoint;
94
+ var isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
93
95
  var renderItem = function renderItem(item, idx) {
94
96
  var _api$contextPanel, _api$extension;
95
97
  switch (item.type) {
@@ -188,6 +190,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
188
190
  }
189
191
  case 'overflow-dropdown':
190
192
  return jsx(Dropdown, {
193
+ alignX: expValEqualsNoExposure('platform_editor_toolbar_aifc', 'isEnabled', true) ? 'right' : undefined,
191
194
  key: idx,
192
195
  title: intl.formatMessage(commonMessages.viewMore),
193
196
  icon: jsx(ShowMoreHorizontalIcon, {
@@ -335,7 +338,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
335
338
  scrollable: scrollable
336
339
  });
337
340
  case 'separator':
338
- if (areToolbarFlagsEnabled()) {
341
+ if (isNewEditorToolbarEnabled) {
339
342
  return item.fullHeight ? jsx(Separator, {
340
343
  key: idx,
341
344
  fullHeight: true
@@ -359,7 +362,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
359
362
  // Ignored via go/ees005
360
363
  // eslint-disable-next-line react/no-array-index-key
361
364
  key: index,
362
- css: areToolbarFlagsEnabled() ? buttonGroupStylesNew : buttonGroupStyles,
365
+ css: isNewEditorToolbarEnabled ? buttonGroupStylesNew : buttonGroupStyles,
363
366
  role: "radiogroup",
364
367
  "aria-label": groupLabel !== null && groupLabel !== void 0 ? groupLabel : undefined,
365
368
  "data-testid": "editor-floating-toolbar-grouped-buttons"
@@ -36,6 +36,7 @@ export interface Props {
36
36
  pulse?: boolean;
37
37
  spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
38
38
  shouldFitContainer?: boolean;
39
+ alignX?: 'left' | 'right' | 'center';
39
40
  }
40
41
  export interface State {
41
42
  isOpen: boolean;
@@ -36,6 +36,7 @@ export interface Props {
36
36
  pulse?: boolean;
37
37
  spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
38
38
  shouldFitContainer?: boolean;
39
+ alignX?: 'left' | 'right' | 'center';
39
40
  }
40
41
  export interface State {
41
42
  isOpen: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@atlaskit/adf-utils": "^19.20.0",
28
- "@atlaskit/button": "^23.2.0",
28
+ "@atlaskit/button": "^23.3.0",
29
29
  "@atlaskit/checkbox": "^17.1.0",
30
30
  "@atlaskit/editor-palette": "^2.1.0",
31
31
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
@@ -41,16 +41,16 @@
41
41
  "@atlaskit/editor-plugin-user-intent": "^1.1.0",
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/emoji": "^69.3.0",
44
- "@atlaskit/icon": "^27.6.0",
45
- "@atlaskit/menu": "^8.0.0",
44
+ "@atlaskit/icon": "^27.8.0",
45
+ "@atlaskit/menu": "^8.1.0",
46
46
  "@atlaskit/modal-dialog": "^14.3.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
- "@atlaskit/primitives": "^14.10.0",
48
+ "@atlaskit/primitives": "^14.11.0",
49
49
  "@atlaskit/select": "^21.2.0",
50
50
  "@atlaskit/theme": "^19.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^9.10.0",
51
+ "@atlaskit/tmp-editor-statsig": "^9.21.0",
52
52
  "@atlaskit/tokens": "^5.6.0",
53
- "@atlaskit/tooltip": "^20.3.0",
53
+ "@atlaskit/tooltip": "^20.4.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
56
56
  "bind-event-listener": "^3.0.0",
@@ -60,7 +60,7 @@
60
60
  "react-loadable": "^5.1.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^107.12.0",
63
+ "@atlaskit/editor-common": "^107.16.0",
64
64
  "react": "^18.2.0",
65
65
  "react-dom": "^18.2.0"
66
66
  },