@atlaskit/editor-plugin-floating-toolbar 24.0.9 → 25.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,15 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 25.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`281a2188b8d83`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/281a2188b8d83) -
8
+ [ux] [EDITOR-8348] this change adds a color picker to the divider floating toolbar behind
9
+ `platform_editor_lovability_dividers`. the selected color is applied behind
10
+ `platform_editor_lovability_dividers_attributes`.
11
+ - Updated dependencies
12
+
3
13
  ## 24.0.9
4
14
 
5
15
  ### Patch Changes
@@ -26,6 +26,7 @@ var _uiColor = require("@atlaskit/editor-common/ui-color");
26
26
  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
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
29
30
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
30
31
  var _forceFocus = require("../pm-plugins/force-focus");
31
32
  var _commands = require("../pm-plugins/toolbar-data/commands");
@@ -314,10 +315,12 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
314
315
  });
315
316
  }
316
317
  if (item.selectType === 'color') {
318
+ var _item$hexToPaletteCol, _item$paletteColorToo;
317
319
  return (0, _react2.jsx)(_uiMenu.ColorPickerButton, {
318
320
  skipFocusButtonAfterPick: true,
319
321
  key: idx,
320
322
  isAriaExpanded: item.isAriaExpanded,
323
+ hideExpandIcon: item.hideExpandIcon,
321
324
  title: item.title
322
325
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
323
326
  ,
@@ -329,18 +332,9 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
329
332
  currentColor: item.defaultValue ? item.defaultValue.value : undefined,
330
333
  placement: "Panels",
331
334
  mountPoint: emojiAndColourPickerMountPoint,
332
- setDisableParentScroll: scrollable ? setDisableScroll : undefined
333
- // Currently in floating toolbar, color picker is only
334
- // used in panel and table cell background color.
335
- // Both uses same color palette.
336
- // That's why hard-coding hexToEditorBackgroundPaletteColor
337
- // and paletteColorTooltipMessages.
338
- // When we need to support different color palette
339
- // in floating toolbar, we need to set hexToPaletteColor
340
- // and paletteColorTooltipMessages in item options.
341
- ,
342
- hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor,
343
- paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
335
+ setDisableParentScroll: scrollable ? setDisableScroll : undefined,
336
+ hexToPaletteColor: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers') ? (_item$hexToPaletteCol = item.hexToPaletteColor) !== null && _item$hexToPaletteCol !== void 0 ? _item$hexToPaletteCol : _editorPalette.hexToEditorBackgroundPaletteColor : _editorPalette.hexToEditorBackgroundPaletteColor,
337
+ paletteColorTooltipMessages: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers') ? (_item$paletteColorToo = item.paletteColorTooltipMessages) !== null && _item$paletteColorToo !== void 0 ? _item$paletteColorToo : _uiColor.backgroundPaletteTooltipMessages : _uiColor.backgroundPaletteTooltipMessages,
344
338
  returnEscToButton: item.returnEscToButton
345
339
  });
346
340
  }
@@ -20,6 +20,7 @@ import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-col
20
20
  import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
21
21
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
22
22
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
23
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
23
24
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
24
25
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
25
26
  import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
@@ -290,10 +291,12 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
290
291
  });
291
292
  }
292
293
  if (item.selectType === 'color') {
294
+ var _item$hexToPaletteCol, _item$paletteColorToo;
293
295
  return jsx(ColorPickerButton, {
294
296
  skipFocusButtonAfterPick: true,
295
297
  key: idx,
296
298
  isAriaExpanded: item.isAriaExpanded,
299
+ hideExpandIcon: item.hideExpandIcon,
297
300
  title: item.title
298
301
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
299
302
  ,
@@ -305,18 +308,9 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
305
308
  currentColor: item.defaultValue ? item.defaultValue.value : undefined,
306
309
  placement: "Panels",
307
310
  mountPoint: emojiAndColourPickerMountPoint,
308
- setDisableParentScroll: scrollable ? setDisableScroll : undefined
309
- // Currently in floating toolbar, color picker is only
310
- // used in panel and table cell background color.
311
- // Both uses same color palette.
312
- // That's why hard-coding hexToEditorBackgroundPaletteColor
313
- // and paletteColorTooltipMessages.
314
- // When we need to support different color palette
315
- // in floating toolbar, we need to set hexToPaletteColor
316
- // and paletteColorTooltipMessages in item options.
317
- ,
318
- hexToPaletteColor: hexToEditorBackgroundPaletteColor,
319
- paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
311
+ setDisableParentScroll: scrollable ? setDisableScroll : undefined,
312
+ hexToPaletteColor: isExperimentEnabled('platform_editor_lovability_dividers') ? (_item$hexToPaletteCol = item.hexToPaletteColor) !== null && _item$hexToPaletteCol !== void 0 ? _item$hexToPaletteCol : hexToEditorBackgroundPaletteColor : hexToEditorBackgroundPaletteColor,
313
+ paletteColorTooltipMessages: isExperimentEnabled('platform_editor_lovability_dividers') ? (_item$paletteColorToo = item.paletteColorTooltipMessages) !== null && _item$paletteColorToo !== void 0 ? _item$paletteColorToo : backgroundPaletteTooltipMessages : backgroundPaletteTooltipMessages,
320
314
  returnEscToButton: item.returnEscToButton
321
315
  });
322
316
  }
@@ -29,6 +29,7 @@ import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-col
29
29
  import { ColorPickerButton, ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
30
30
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
31
31
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
32
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
32
33
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
33
34
  import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
34
35
  import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
@@ -309,10 +310,12 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
309
310
  });
310
311
  }
311
312
  if (item.selectType === 'color') {
313
+ var _item$hexToPaletteCol, _item$paletteColorToo;
312
314
  return jsx(ColorPickerButton, {
313
315
  skipFocusButtonAfterPick: true,
314
316
  key: idx,
315
317
  isAriaExpanded: item.isAriaExpanded,
318
+ hideExpandIcon: item.hideExpandIcon,
316
319
  title: item.title
317
320
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
318
321
  ,
@@ -324,18 +327,9 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
324
327
  currentColor: item.defaultValue ? item.defaultValue.value : undefined,
325
328
  placement: "Panels",
326
329
  mountPoint: emojiAndColourPickerMountPoint,
327
- setDisableParentScroll: scrollable ? setDisableScroll : undefined
328
- // Currently in floating toolbar, color picker is only
329
- // used in panel and table cell background color.
330
- // Both uses same color palette.
331
- // That's why hard-coding hexToEditorBackgroundPaletteColor
332
- // and paletteColorTooltipMessages.
333
- // When we need to support different color palette
334
- // in floating toolbar, we need to set hexToPaletteColor
335
- // and paletteColorTooltipMessages in item options.
336
- ,
337
- hexToPaletteColor: hexToEditorBackgroundPaletteColor,
338
- paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
330
+ setDisableParentScroll: scrollable ? setDisableScroll : undefined,
331
+ hexToPaletteColor: isExperimentEnabled('platform_editor_lovability_dividers') ? (_item$hexToPaletteCol = item.hexToPaletteColor) !== null && _item$hexToPaletteCol !== void 0 ? _item$hexToPaletteCol : hexToEditorBackgroundPaletteColor : hexToEditorBackgroundPaletteColor,
332
+ paletteColorTooltipMessages: isExperimentEnabled('platform_editor_lovability_dividers') ? (_item$paletteColorToo = item.paletteColorTooltipMessages) !== null && _item$paletteColorToo !== void 0 ? _item$paletteColorToo : backgroundPaletteTooltipMessages : backgroundPaletteTooltipMessages,
339
333
  returnEscToButton: item.returnEscToButton
340
334
  });
341
335
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "24.0.9",
3
+ "version": "25.0.0",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -25,16 +25,16 @@
25
25
  "@atlaskit/button": "^25.4.0",
26
26
  "@atlaskit/checkbox": "^19.2.0",
27
27
  "@atlaskit/editor-palette": "^3.5.0",
28
- "@atlaskit/editor-plugin-analytics": "^22.0.0",
29
- "@atlaskit/editor-plugin-context-panel": "^24.0.0",
30
- "@atlaskit/editor-plugin-copy-button": "^22.0.0",
31
- "@atlaskit/editor-plugin-decorations": "^22.0.0",
32
- "@atlaskit/editor-plugin-editor-disabled": "^22.0.0",
33
- "@atlaskit/editor-plugin-editor-viewmode": "^24.0.0",
34
- "@atlaskit/editor-plugin-emoji": "^23.1.0",
35
- "@atlaskit/editor-plugin-extension": "^25.0.0",
36
- "@atlaskit/editor-plugin-interaction": "^36.0.0",
37
- "@atlaskit/editor-plugin-user-intent": "^20.0.0",
28
+ "@atlaskit/editor-plugin-analytics": "^23.0.0",
29
+ "@atlaskit/editor-plugin-context-panel": "^25.0.0",
30
+ "@atlaskit/editor-plugin-copy-button": "^23.0.0",
31
+ "@atlaskit/editor-plugin-decorations": "^23.0.0",
32
+ "@atlaskit/editor-plugin-editor-disabled": "^23.0.0",
33
+ "@atlaskit/editor-plugin-editor-viewmode": "^25.0.0",
34
+ "@atlaskit/editor-plugin-emoji": "^24.0.0",
35
+ "@atlaskit/editor-plugin-extension": "^26.0.0",
36
+ "@atlaskit/editor-plugin-interaction": "^37.0.0",
37
+ "@atlaskit/editor-plugin-user-intent": "^21.0.0",
38
38
  "@atlaskit/editor-prosemirror": "^9.0.0",
39
39
  "@atlaskit/emoji": "^72.4.0",
40
40
  "@atlaskit/icon": "^38.0.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/platform-feature-flags": "^2.2.0",
45
45
  "@atlaskit/primitives": "^22.5.0",
46
46
  "@atlaskit/select": "^23.1.0",
47
- "@atlaskit/tmp-editor-statsig": "^218.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^219.0.0",
48
48
  "@atlaskit/tokens": "^20.1.0",
49
49
  "@atlaskit/tooltip": "^24.3.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -56,7 +56,7 @@
56
56
  "react-loosely-lazy": "^1.0.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^126.4.0",
59
+ "@atlaskit/editor-common": "^127.0.0",
60
60
  "react": "^18.2.0 || ^19.2.0",
61
61
  "react-dom": "^18.2.0 || ^19.2.0",
62
62
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"