@atlaskit/editor-plugin-text-color 2.3.8 → 2.4.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,23 @@
1
1
  # @atlaskit/editor-plugin-text-color
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#158546](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158546)
8
+ [`b7fe4e6f226f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b7fe4e6f226f3) -
9
+ ED-27284 use user preferences plugin in editor preset.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 2.3.9
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 2.3.8
4
22
 
5
23
  ### Patch Changes
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.textColorPlugin = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
12
  var _changeColor2 = require("./pm-plugins/commands/change-color");
12
13
  var _main = require("./pm-plugins/main");
@@ -76,8 +77,9 @@ var textColorPlugin = exports.textColorPlugin = function textColorPlugin(_ref) {
76
77
  },
77
78
  pluginsOptions: {
78
79
  selectionToolbar: function selectionToolbar() {
79
- var _api$selectionToolbar;
80
- if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'none' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
80
+ var _api$userPreferences, _api$selectionToolbar;
81
+ var toolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.currentState()) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.preferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
82
+ if (toolbarDocking === 'none' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
81
83
  exposure: true
82
84
  })) {
83
85
  var toolbarCustom = {
@@ -23,8 +23,8 @@ var _uiColor = require("@atlaskit/editor-common/ui-color");
23
23
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
24
24
  var _editorPalette = require("@atlaskit/editor-palette");
25
25
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
26
+ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
26
27
  var _textStyle = _interopRequireDefault(require("@atlaskit/icon/core/text-style"));
27
- var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
28
28
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
29
29
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
30
30
  var _changeColor = require("../../pm-plugins/commands/change-color");
@@ -227,7 +227,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
227
227
  }, (0, _react2.jsx)(_chevronDown.default, {
228
228
  label: "",
229
229
  color: "currentColor",
230
- LEGACY_margin: "0 0 0 -8px"
230
+ LEGACY_margin: "0 0 0 -8px",
231
+ size: "small"
231
232
  })))
232
233
  })
233
234
  }, (0, _react2.jsx)("div", {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { textColor } from '@atlaskit/adf-schema';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
5
  import { changeColor } from './pm-plugins/commands/change-color';
5
6
  import { createPlugin, pluginKey as textColorPluginKey } from './pm-plugins/main';
@@ -70,8 +71,9 @@ export const textColorPlugin = ({
70
71
  },
71
72
  pluginsOptions: {
72
73
  selectionToolbar: () => {
73
- var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
74
- if ((api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking) === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
74
+ var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
75
+ const toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.currentState()) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.preferences.toolbarDockingPosition : api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking;
76
+ if (toolbarDocking === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
75
77
  exposure: true
76
78
  })) {
77
79
  const toolbarCustom = {
@@ -16,8 +16,8 @@ import { ColorPalette, getSelectedRowAndColumnFromPalette, textPaletteTooltipMes
16
16
  import { ArrowKeyNavigationType, DropdownContainer as Dropdown, TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
17
17
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
18
18
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
19
+ import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
19
20
  import TextStyleIcon from '@atlaskit/icon/core/text-style';
20
- import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
23
  import { changeColor as changeColorWithAnalytics } from '../../pm-plugins/commands/change-color';
@@ -207,7 +207,8 @@ export class ToolbarTextColor extends React.Component {
207
207
  }, jsx(ChevronDownIcon, {
208
208
  label: "",
209
209
  color: "currentColor",
210
- LEGACY_margin: "0 0 0 -8px"
210
+ LEGACY_margin: "0 0 0 -8px",
211
+ size: "small"
211
212
  })))
212
213
  })
213
214
  }, jsx("div", {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { textColor } from '@atlaskit/adf-schema';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
5
  import { changeColor as _changeColor } from './pm-plugins/commands/change-color';
5
6
  import { createPlugin, pluginKey as textColorPluginKey } from './pm-plugins/main';
@@ -69,8 +70,9 @@ export var textColorPlugin = function textColorPlugin(_ref) {
69
70
  },
70
71
  pluginsOptions: {
71
72
  selectionToolbar: function selectionToolbar() {
72
- var _api$selectionToolbar;
73
- if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
73
+ var _api$userPreferences, _api$selectionToolbar;
74
+ var toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.currentState()) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.preferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
75
+ if (toolbarDocking === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
74
76
  exposure: true
75
77
  })) {
76
78
  var toolbarCustom = {
@@ -26,8 +26,8 @@ import { ColorPalette, getSelectedRowAndColumnFromPalette, textPaletteTooltipMes
26
26
  import { ArrowKeyNavigationType, DropdownContainer as Dropdown, TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
27
27
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
28
28
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
29
+ import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
29
30
  import TextStyleIcon from '@atlaskit/icon/core/text-style';
30
- import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
31
31
  import { fg } from '@atlaskit/platform-feature-flags';
32
32
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
33
33
  import { changeColor as changeColorWithAnalytics } from '../../pm-plugins/commands/change-color';
@@ -223,7 +223,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
223
223
  }, jsx(ChevronDownIcon, {
224
224
  label: "",
225
225
  color: "currentColor",
226
- LEGACY_margin: "0 0 0 -8px"
226
+ LEGACY_margin: "0 0 0 -8px",
227
+ size: "small"
227
228
  })))
228
229
  })
229
230
  }, jsx("div", {
@@ -2,13 +2,15 @@ import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
4
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
5
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
5
6
  import type { TextColorPluginConfig, TextColorPluginState } from './pm-plugins/main';
6
7
  import type { TextColorInputMethod } from './types';
7
8
  export type TextColorPluginOptions = TextColorPluginConfig | boolean;
8
9
  export type Dependencies = [
9
10
  OptionalPlugin<AnalyticsPlugin>,
10
11
  OptionalPlugin<PrimaryToolbarPlugin>,
11
- OptionalPlugin<SelectionToolbarPlugin>
12
+ OptionalPlugin<SelectionToolbarPlugin>,
13
+ OptionalPlugin<UserPreferencesPlugin>
12
14
  ];
13
15
  export type TextColorPlugin = NextEditorPlugin<'textColor', {
14
16
  pluginConfiguration: TextColorPluginOptions | undefined;
@@ -2,13 +2,15 @@ import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
4
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
5
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
5
6
  import type { TextColorPluginConfig, TextColorPluginState } from './pm-plugins/main';
6
7
  import type { TextColorInputMethod } from './types';
7
8
  export type TextColorPluginOptions = TextColorPluginConfig | boolean;
8
9
  export type Dependencies = [
9
10
  OptionalPlugin<AnalyticsPlugin>,
10
11
  OptionalPlugin<PrimaryToolbarPlugin>,
11
- OptionalPlugin<SelectionToolbarPlugin>
12
+ OptionalPlugin<SelectionToolbarPlugin>,
13
+ OptionalPlugin<UserPreferencesPlugin>
12
14
  ];
13
15
  export type TextColorPlugin = NextEditorPlugin<'textColor', {
14
16
  pluginConfiguration: TextColorPluginOptions | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-color",
3
- "version": "2.3.8",
3
+ "version": "2.4.0",
4
4
  "description": "Text color plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,19 +34,19 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
- "@atlaskit/editor-common": "^106.5.0",
37
+ "@atlaskit/editor-common": "^106.7.0",
38
38
  "@atlaskit/editor-palette": "^2.1.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
40
40
  "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
41
- "@atlaskit/editor-plugin-selection-toolbar": "^3.6.0",
41
+ "@atlaskit/editor-plugin-selection-toolbar": "^3.7.0",
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/editor-shared-styles": "^3.4.0",
44
44
  "@atlaskit/editor-tables": "^2.9.0",
45
45
  "@atlaskit/icon": "^26.4.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/theme": "^18.0.0",
48
- "@atlaskit/tmp-editor-statsig": "^6.0.0",
49
- "@atlaskit/tokens": "^5.1.0",
48
+ "@atlaskit/tmp-editor-statsig": "^7.0.0",
49
+ "@atlaskit/tokens": "^5.2.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1"
52
52
  },
@@ -100,6 +100,9 @@
100
100
  }
101
101
  },
102
102
  "platform-feature-flags": {
103
+ "platform_editor_use_preferences_plugin": {
104
+ "type": "boolean"
105
+ },
103
106
  "platform-visual-refresh-icons": {
104
107
  "type": "boolean"
105
108
  }