@atlaskit/editor-plugin-text-color 2.3.9 → 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,17 @@
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
+
3
15
  ## 2.3.9
4
16
 
5
17
  ### 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 = {
@@ -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 = {
@@ -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 = {
@@ -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.9",
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,11 +34,11 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
- "@atlaskit/editor-common": "^106.6.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",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/theme": "^18.0.0",
48
48
  "@atlaskit/tmp-editor-statsig": "^7.0.0",
49
- "@atlaskit/tokens": "^5.1.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
  }