@atlaskit/editor-plugin-text-formatting 2.2.19 → 2.3.1

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-formatting
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#158546](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158546)
14
+ [`b7fe4e6f226f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b7fe4e6f226f3) -
15
+ ED-27284 use user preferences plugin in editor preset.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 2.2.19
4
22
 
5
23
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.textFormattingPlugin = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
13
  var _clearFormatting = require("./pm-plugins/clear-formatting");
13
14
  var _clearFormattingKeymap = _interopRequireDefault(require("./pm-plugins/clear-formatting-keymap"));
@@ -149,8 +150,9 @@ var textFormattingPlugin = exports.textFormattingPlugin = function textFormattin
149
150
  },
150
151
  pluginsOptions: {
151
152
  selectionToolbar: function selectionToolbar() {
152
- var _api$selectionToolbar;
153
- 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', {
153
+ var _api$userPreferences, _api$selectionToolbar;
154
+ 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.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.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;
155
+ if (toolbarDocking === 'none' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
154
156
  exposure: true
155
157
  })) {
156
158
  var toolbarCustom = {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { code, em, strike, strong, subsup, underline } 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 { plugin as clearFormattingPlugin, pluginKey as clearFormattingPluginKey } from './pm-plugins/clear-formatting';
5
6
  import clearFormattingKeymapPlugin from './pm-plugins/clear-formatting-keymap';
@@ -143,8 +144,9 @@ export const textFormattingPlugin = ({
143
144
  },
144
145
  pluginsOptions: {
145
146
  selectionToolbar: () => {
146
- var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
147
- 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', {
147
+ var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
148
+ 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.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.preferences) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.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;
149
+ if (toolbarDocking === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
148
150
  exposure: true
149
151
  })) {
150
152
  const toolbarCustom = {
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import React from 'react';
5
5
  import { code, em, strike, strong, subsup, underline } from '@atlaskit/adf-schema';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  import { plugin as clearFormattingPlugin, pluginKey as clearFormattingPluginKey } from './pm-plugins/clear-formatting';
8
9
  import clearFormattingKeymapPlugin from './pm-plugins/clear-formatting-keymap';
@@ -143,8 +144,9 @@ export var textFormattingPlugin = function textFormattingPlugin(_ref) {
143
144
  },
144
145
  pluginsOptions: {
145
146
  selectionToolbar: function selectionToolbar() {
146
- var _api$selectionToolbar;
147
- 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', {
147
+ var _api$userPreferences, _api$selectionToolbar;
148
+ 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.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.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;
149
+ if (toolbarDocking === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
148
150
  exposure: true
149
151
  })) {
150
152
  var toolbarCustom = {
@@ -3,6 +3,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { BasePlugin } from '@atlaskit/editor-plugin-base';
4
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
5
5
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
6
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
6
7
  import type { ToggleMarkEditorCommand } from './pm-plugins/commands';
7
8
  export type TextFormattingPluginOptions = CommonTextFormattingOptions;
8
9
  export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
@@ -11,7 +12,8 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
11
12
  OptionalPlugin<AnalyticsPlugin>,
12
13
  OptionalPlugin<PrimaryToolbarPlugin>,
13
14
  OptionalPlugin<BasePlugin>,
14
- OptionalPlugin<SelectionToolbarPlugin>
15
+ OptionalPlugin<SelectionToolbarPlugin>,
16
+ OptionalPlugin<UserPreferencesPlugin>
15
17
  ];
16
18
  commands: {
17
19
  toggleSuperscript: ToggleMarkEditorCommand;
@@ -3,6 +3,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { BasePlugin } from '@atlaskit/editor-plugin-base';
4
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
5
5
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
6
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
6
7
  import type { ToggleMarkEditorCommand } from './pm-plugins/commands';
7
8
  export type TextFormattingPluginOptions = CommonTextFormattingOptions;
8
9
  export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
@@ -11,7 +12,8 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
11
12
  OptionalPlugin<AnalyticsPlugin>,
12
13
  OptionalPlugin<PrimaryToolbarPlugin>,
13
14
  OptionalPlugin<BasePlugin>,
14
- OptionalPlugin<SelectionToolbarPlugin>
15
+ OptionalPlugin<SelectionToolbarPlugin>,
16
+ OptionalPlugin<UserPreferencesPlugin>
15
17
  ];
16
18
  commands: {
17
19
  toggleSuperscript: ToggleMarkEditorCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "2.2.19",
3
+ "version": "2.3.1",
4
4
  "description": "Text-formatting 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.6.0",
37
+ "@atlaskit/editor-common": "^106.9.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
39
39
  "@atlaskit/editor-plugin-base": "^3.0.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
- "@atlaskit/icon": "^26.4.0",
45
+ "@atlaskit/icon": "^27.0.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
48
- "@atlaskit/tmp-editor-statsig": "^7.0.0",
49
- "@atlaskit/tokens": "^5.1.0",
48
+ "@atlaskit/tmp-editor-statsig": "^7.1.0",
49
+ "@atlaskit/tokens": "^5.2.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
52
52
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -125,6 +125,9 @@
125
125
  "platform_editor_controls_patch_4": {
126
126
  "type": "boolean"
127
127
  },
128
+ "platform_editor_use_preferences_plugin": {
129
+ "type": "boolean"
130
+ },
128
131
  "platform_editor_controls_patch_7": {
129
132
  "type": "boolean"
130
133
  }