@atlaskit/editor-plugin-selection-toolbar 3.2.0 → 3.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,26 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 3.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139139](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139139)
8
+ [`7f6b665d778dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f6b665d778dd) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27499](ED-27499) - the new
10
+ `@atlassian/confluence-presets` package with Confluence `full-page` preset is created
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 3.3.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [#138841](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138841)
21
+ [`d71cc65fae381`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d71cc65fae381) -
22
+ ED-27489 fix toolbar docking pref
23
+
3
24
  ## 3.2.0
4
25
 
5
26
  ### Minor Changes
@@ -112,7 +112,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
112
112
 
113
113
  // if the toolbarDockingInitialPosition preference has changed
114
114
  // update the toolbarDocking state
115
- if (!previousToolbarDocking && !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_2')) {
115
+ if (!previousToolbarDocking && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
116
116
  // we currently only check for the initial value
117
117
  var toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
118
118
  if (toolbarDockingPreference && toolbarDockingPreference !== previousToolbarDocking) {
@@ -166,9 +166,12 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
166
166
  var _api$analytics2;
167
167
  isPreferenceInitialized = true;
168
168
  var userToolbarDockingPref = getInitialToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
169
- var tr = newState.tr.setMeta(_pluginKey.selectionToolbarPluginKey, {
170
- toolbarDocking: userToolbarDockingPref
171
- });
169
+ var tr = newState.tr;
170
+ if (!(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
171
+ tr.setMeta(_pluginKey.selectionToolbarPluginKey, {
172
+ toolbarDocking: userToolbarDockingPref
173
+ });
174
+ }
172
175
  api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
173
176
  action: _analytics.ACTION.INITIALISED,
174
177
  actionSubject: _analytics.ACTION_SUBJECT.USER_PREFERENCES,
@@ -106,7 +106,7 @@ export const selectionToolbarPlugin = ({
106
106
 
107
107
  // if the toolbarDockingInitialPosition preference has changed
108
108
  // update the toolbarDocking state
109
- if (!previousToolbarDocking && !fg('platform_editor_controls_patch_2')) {
109
+ if (!previousToolbarDocking && fg('platform_editor_controls_patch_4')) {
110
110
  // we currently only check for the initial value
111
111
  const toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
112
112
  if (toolbarDockingPreference && toolbarDockingPreference !== previousToolbarDocking) {
@@ -161,9 +161,12 @@ export const selectionToolbarPlugin = ({
161
161
  var _api$analytics2;
162
162
  isPreferenceInitialized = true;
163
163
  const userToolbarDockingPref = getInitialToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
164
- const tr = newState.tr.setMeta(selectionToolbarPluginKey, {
165
- toolbarDocking: userToolbarDockingPref
166
- });
164
+ const tr = newState.tr;
165
+ if (!fg('platform_editor_controls_patch_4')) {
166
+ tr.setMeta(selectionToolbarPluginKey, {
167
+ toolbarDocking: userToolbarDockingPref
168
+ });
169
+ }
167
170
  api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
168
171
  action: ACTION.INITIALISED,
169
172
  actionSubject: ACTION_SUBJECT.USER_PREFERENCES,
@@ -105,7 +105,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
105
105
 
106
106
  // if the toolbarDockingInitialPosition preference has changed
107
107
  // update the toolbarDocking state
108
- if (!previousToolbarDocking && !fg('platform_editor_controls_patch_2')) {
108
+ if (!previousToolbarDocking && fg('platform_editor_controls_patch_4')) {
109
109
  // we currently only check for the initial value
110
110
  var toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
111
111
  if (toolbarDockingPreference && toolbarDockingPreference !== previousToolbarDocking) {
@@ -159,9 +159,12 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
159
159
  var _api$analytics2;
160
160
  isPreferenceInitialized = true;
161
161
  var userToolbarDockingPref = getInitialToolbarDocking(contextualFormattingEnabled, userPreferencesProvider);
162
- var tr = newState.tr.setMeta(selectionToolbarPluginKey, {
163
- toolbarDocking: userToolbarDockingPref
164
- });
162
+ var tr = newState.tr;
163
+ if (!fg('platform_editor_controls_patch_4')) {
164
+ tr.setMeta(selectionToolbarPluginKey, {
165
+ toolbarDocking: userToolbarDockingPref
166
+ });
167
+ }
165
168
  api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
166
169
  action: ACTION.INITIALISED,
167
170
  actionSubject: ACTION_SUBJECT.USER_PREFERENCES,
@@ -1,2 +1,2 @@
1
1
  export { selectionToolbarPlugin } from './selectionToolbarPlugin';
2
- export type { SelectionToolbarPlugin } from './selectionToolbarPluginType';
2
+ export type { SelectionToolbarPlugin, SelectionToolbarPluginOptions, } from './selectionToolbarPluginType';
@@ -3,18 +3,17 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
4
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
5
5
  import type { ToolbarDocking } from './types';
6
+ export type SelectionToolbarPluginOptions = {
7
+ /** @defaults false */
8
+ preferenceToolbarAboveSelection?: boolean;
9
+ userPreferencesProvider?: UserPreferencesProvider;
10
+ contextualFormattingEnabled?: boolean;
11
+ };
6
12
  export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
7
13
  sharedState: {
8
14
  toolbarDocking: ToolbarDocking;
9
15
  };
10
- pluginConfiguration: {
11
- /**
12
- * Defaults to false
13
- */
14
- preferenceToolbarAboveSelection?: boolean;
15
- userPreferencesProvider?: UserPreferencesProvider;
16
- contextualFormattingEnabled?: boolean;
17
- };
16
+ pluginConfiguration: SelectionToolbarPluginOptions;
18
17
  dependencies: [
19
18
  OptionalPlugin<EditorViewModePlugin>,
20
19
  OptionalPlugin<PrimaryToolbarPlugin>,
@@ -1,2 +1,2 @@
1
1
  export { selectionToolbarPlugin } from './selectionToolbarPlugin';
2
- export type { SelectionToolbarPlugin } from './selectionToolbarPluginType';
2
+ export type { SelectionToolbarPlugin, SelectionToolbarPluginOptions, } from './selectionToolbarPluginType';
@@ -3,18 +3,17 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
4
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
5
5
  import type { ToolbarDocking } from './types';
6
+ export type SelectionToolbarPluginOptions = {
7
+ /** @defaults false */
8
+ preferenceToolbarAboveSelection?: boolean;
9
+ userPreferencesProvider?: UserPreferencesProvider;
10
+ contextualFormattingEnabled?: boolean;
11
+ };
6
12
  export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
7
13
  sharedState: {
8
14
  toolbarDocking: ToolbarDocking;
9
15
  };
10
- pluginConfiguration: {
11
- /**
12
- * Defaults to false
13
- */
14
- preferenceToolbarAboveSelection?: boolean;
15
- userPreferencesProvider?: UserPreferencesProvider;
16
- contextualFormattingEnabled?: boolean;
17
- };
16
+ pluginConfiguration: SelectionToolbarPluginOptions;
18
17
  dependencies: [
19
18
  OptionalPlugin<EditorViewModePlugin>,
20
19
  OptionalPlugin<PrimaryToolbarPlugin>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,10 +34,10 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/css": "^0.10.0",
37
- "@atlaskit/editor-common": "^103.1.0",
37
+ "@atlaskit/editor-common": "^103.4.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
39
- "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
40
- "@atlaskit/editor-plugin-primary-toolbar": "^3.1.0",
39
+ "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
40
+ "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
42
  "@atlaskit/icon": "^25.5.0",
43
43
  "@atlaskit/icon-lab": "^4.6.0",
@@ -96,6 +96,9 @@
96
96
  "platform-feature-flags": {
97
97
  "platform_editor_controls_patch_2": {
98
98
  "type": "boolean"
99
+ },
100
+ "platform_editor_controls_patch_4": {
101
+ "type": "boolean"
99
102
  }
100
103
  }
101
104
  }