@atlaskit/editor-plugin-highlight 1.20.1 → 1.22.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,29 @@
1
1
  # @atlaskit/editor-plugin-highlight
2
2
 
3
+ ## 1.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#116949](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116949)
8
+ [`9154f7b89e3d2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9154f7b89e3d2) -
9
+ [ux] ED-26674 Hiding contextual toolbar menu items when the menu is docked to top
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.21.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#116013](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116013)
20
+ [`18e022766bfd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18e022766bfd3) -
21
+ [ux] ED-26464 Hiding primary toolbar and docking contextual toolbar items to top
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 1.20.1
4
28
 
5
29
  ### Patch Changes
@@ -24,7 +24,16 @@ var highlightPlugin = exports.highlightPlugin = function highlightPlugin(_ref) {
24
24
  popupsScrollableElement = _ref2.popupsScrollableElement,
25
25
  disabled = _ref2.disabled,
26
26
  isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
27
- editorView = _ref2.editorView;
27
+ editorView = _ref2.editorView,
28
+ dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
29
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
30
+ exposure: true
31
+ })) {
32
+ return /*#__PURE__*/_react.default.createElement(_FloatingToolbarHighlightColor.FloatingToolbarHighlightColorWithIntl, {
33
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
34
+ pluginInjectionApi: api
35
+ });
36
+ }
28
37
  return /*#__PURE__*/_react.default.createElement(_PrimaryToolbarHighlightColor.PrimaryToolbarHighlightColorWithIntl, {
29
38
  popupsMountPoint: popupsMountPoint,
30
39
  popupsBoundariesElement: popupsBoundariesElement,
@@ -75,6 +84,12 @@ var highlightPlugin = exports.highlightPlugin = function highlightPlugin(_ref) {
75
84
  },
76
85
  pluginsOptions: {
77
86
  selectionToolbar: function selectionToolbar() {
87
+ var _api$selectionToolbar;
88
+ 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) === 'top' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
89
+ exposure: true
90
+ })) {
91
+ return undefined;
92
+ }
78
93
  if (!(options !== null && options !== void 0 && options.textHighlightingFloatingToolbarExperiment) && (0, _experiments.editorExperiment)('contextual_formatting_toolbar', false, {
79
94
  exposure: true
80
95
  }) && (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'control', {
@@ -18,16 +18,27 @@ export const highlightPlugin = ({
18
18
  popupsScrollableElement,
19
19
  disabled,
20
20
  isToolbarReducedSpacing,
21
- editorView
22
- }) => /*#__PURE__*/React.createElement(PrimaryToolbarHighlightColor, {
23
- popupsMountPoint: popupsMountPoint,
24
- popupsBoundariesElement: popupsBoundariesElement,
25
- popupsScrollableElement: popupsScrollableElement,
26
- disabled: disabled,
27
- isToolbarReducedSpacing: isToolbarReducedSpacing,
28
- pluginInjectionApi: api,
29
- editorView: editorView
30
- });
21
+ editorView,
22
+ dispatchAnalyticsEvent
23
+ }) => {
24
+ if (editorExperiment('platform_editor_controls', 'variant1', {
25
+ exposure: true
26
+ })) {
27
+ return /*#__PURE__*/React.createElement(FloatingToolbarHighlightColor, {
28
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
29
+ pluginInjectionApi: api
30
+ });
31
+ }
32
+ return /*#__PURE__*/React.createElement(PrimaryToolbarHighlightColor, {
33
+ popupsMountPoint: popupsMountPoint,
34
+ popupsBoundariesElement: popupsBoundariesElement,
35
+ popupsScrollableElement: popupsScrollableElement,
36
+ disabled: disabled,
37
+ isToolbarReducedSpacing: isToolbarReducedSpacing,
38
+ pluginInjectionApi: api,
39
+ editorView: editorView
40
+ });
41
+ };
31
42
  api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
32
43
  name: 'highlight',
33
44
  component: primaryToolbarComponent
@@ -62,6 +73,12 @@ export const highlightPlugin = ({
62
73
  },
63
74
  pluginsOptions: {
64
75
  selectionToolbar() {
76
+ var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
77
+ 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) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
78
+ exposure: true
79
+ })) {
80
+ return undefined;
81
+ }
65
82
  if (!(options !== null && options !== void 0 && options.textHighlightingFloatingToolbarExperiment) && editorExperiment('contextual_formatting_toolbar', false, {
66
83
  exposure: true
67
84
  }) && editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'control', {
@@ -17,7 +17,16 @@ export var highlightPlugin = function highlightPlugin(_ref) {
17
17
  popupsScrollableElement = _ref2.popupsScrollableElement,
18
18
  disabled = _ref2.disabled,
19
19
  isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
20
- editorView = _ref2.editorView;
20
+ editorView = _ref2.editorView,
21
+ dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
22
+ if (editorExperiment('platform_editor_controls', 'variant1', {
23
+ exposure: true
24
+ })) {
25
+ return /*#__PURE__*/React.createElement(FloatingToolbarHighlightColor, {
26
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
27
+ pluginInjectionApi: api
28
+ });
29
+ }
21
30
  return /*#__PURE__*/React.createElement(PrimaryToolbarHighlightColor, {
22
31
  popupsMountPoint: popupsMountPoint,
23
32
  popupsBoundariesElement: popupsBoundariesElement,
@@ -68,6 +77,12 @@ export var highlightPlugin = function highlightPlugin(_ref) {
68
77
  },
69
78
  pluginsOptions: {
70
79
  selectionToolbar: function selectionToolbar() {
80
+ var _api$selectionToolbar;
81
+ 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) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
82
+ exposure: true
83
+ })) {
84
+ return undefined;
85
+ }
71
86
  if (!(options !== null && options !== void 0 && options.textHighlightingFloatingToolbarExperiment) && editorExperiment('contextual_formatting_toolbar', false, {
72
87
  exposure: true
73
88
  }) && editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'control', {
@@ -2,6 +2,7 @@ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
5
+ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
5
6
  import type { TextFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
6
7
  import type { HighlightPluginState } from './pm-plugins/main';
7
8
  export type HighlightPluginOptions = {
@@ -12,7 +13,8 @@ export type HighlightPlugin = NextEditorPlugin<'highlight', {
12
13
  dependencies: [
13
14
  OptionalPlugin<AnalyticsPlugin>,
14
15
  OptionalPlugin<TextFormattingPlugin>,
15
- OptionalPlugin<PrimaryToolbarPlugin>
16
+ OptionalPlugin<PrimaryToolbarPlugin>,
17
+ OptionalPlugin<SelectionToolbarPlugin>
16
18
  ];
17
19
  sharedState: HighlightPluginState | undefined;
18
20
  commands: {
@@ -2,6 +2,7 @@ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
5
+ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
5
6
  import type { TextFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
6
7
  import type { HighlightPluginState } from './pm-plugins/main';
7
8
  export type HighlightPluginOptions = {
@@ -12,7 +13,8 @@ export type HighlightPlugin = NextEditorPlugin<'highlight', {
12
13
  dependencies: [
13
14
  OptionalPlugin<AnalyticsPlugin>,
14
15
  OptionalPlugin<TextFormattingPlugin>,
15
- OptionalPlugin<PrimaryToolbarPlugin>
16
+ OptionalPlugin<PrimaryToolbarPlugin>,
17
+ OptionalPlugin<SelectionToolbarPlugin>
16
18
  ];
17
19
  sharedState: HighlightPluginState | undefined;
18
20
  commands: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-highlight",
3
- "version": "1.20.1",
3
+ "version": "1.22.0",
4
4
  "description": "Highlight plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,18 +37,19 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@atlaskit/adf-schema": "^47.2.1",
40
- "@atlaskit/editor-common": "^99.14.0",
40
+ "@atlaskit/editor-common": "^99.18.0",
41
41
  "@atlaskit/editor-palette": "1.7.0",
42
42
  "@atlaskit/editor-plugin-analytics": "^1.12.0",
43
- "@atlaskit/editor-plugin-primary-toolbar": "^2.2.0",
44
- "@atlaskit/editor-plugin-text-formatting": "^1.18.0",
43
+ "@atlaskit/editor-plugin-primary-toolbar": "^2.3.0",
44
+ "@atlaskit/editor-plugin-selection-toolbar": "^1.9.0",
45
+ "@atlaskit/editor-plugin-text-formatting": "^1.20.0",
45
46
  "@atlaskit/editor-prosemirror": "7.0.0",
46
- "@atlaskit/editor-shared-styles": "^3.2.0",
47
+ "@atlaskit/editor-shared-styles": "^3.3.0",
47
48
  "@atlaskit/editor-tables": "^2.9.0",
48
- "@atlaskit/icon": "^23.9.0",
49
- "@atlaskit/platform-feature-flags": "^1.0.0",
50
- "@atlaskit/primitives": "^13.5.0",
51
- "@atlaskit/tmp-editor-statsig": "^2.46.0",
49
+ "@atlaskit/icon": "^23.11.0",
50
+ "@atlaskit/platform-feature-flags": "^1.1.0",
51
+ "@atlaskit/primitives": "^13.6.0",
52
+ "@atlaskit/tmp-editor-statsig": "^2.47.0",
52
53
  "@atlaskit/tokens": "^3.3.0",
53
54
  "@babel/runtime": "^7.0.0",
54
55
  "@emotion/react": "^11.7.1"