@atlaskit/editor-plugin-highlight 6.2.1 → 6.2.2

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,15 @@
1
1
  # @atlaskit/editor-plugin-highlight
2
2
 
3
+ ## 6.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ef001bf65d48f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef001bf65d48f) -
8
+ Remove usage of `platform_editor_toolbar_aifc` inside editor packages - instead rely on checking
9
+ for new toolbar plugin option, make `enableNewToolbarExperience` mandatory for consumers to opt in
10
+ to new toolbar experience
11
+ - Updated dependencies
12
+
3
13
  ## 6.2.1
4
14
 
5
15
  ### Patch Changes
@@ -22,9 +22,7 @@ var highlightPlugin = exports.highlightPlugin = function highlightPlugin(_ref) {
22
22
  var api = _ref.api,
23
23
  options = _ref.config;
24
24
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
25
- var isToolbarAifcEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
26
- exposure: true
27
- });
25
+ var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
28
26
  var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
29
27
  var popupsMountPoint = _ref2.popupsMountPoint,
30
28
  popupsBoundariesElement = _ref2.popupsBoundariesElement,
@@ -45,7 +43,7 @@ var highlightPlugin = exports.highlightPlugin = function highlightPlugin(_ref) {
45
43
  editorView: editorView
46
44
  });
47
45
  };
48
- if (!isToolbarAifcEnabled) {
46
+ if (!isToolbarAIFCEnabled) {
49
47
  var _api$primaryToolbar;
50
48
  api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
51
49
  name: 'highlight',
@@ -98,7 +96,7 @@ var highlightPlugin = exports.highlightPlugin = function highlightPlugin(_ref) {
98
96
  }
99
97
  return _main.highlightPluginKey.getState(editorState);
100
98
  },
101
- pluginsOptions: !isToolbarAifcEnabled ? {
99
+ pluginsOptions: !isToolbarAIFCEnabled ? {
102
100
  selectionToolbar: function selectionToolbar() {
103
101
  var _api$userPreferences, _api$selectionToolbar;
104
102
  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;
@@ -9,14 +9,14 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
9
9
  var _preset = require("@atlaskit/editor-common/preset");
10
10
  var _uiColor = require("@atlaskit/editor-common/ui-color");
11
11
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
12
  var _changeColor = require("../editor-commands/change-color");
14
13
  var _palette = require("../editor-commands/palette");
15
14
  function keymapPlugin(_ref) {
16
15
  var _api$analytics;
17
16
  var api = _ref.api;
18
17
  var list = {};
19
- if (!((0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true))) {
18
+ var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
19
+ if (!(isToolbarAIFCEnabled && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true))) {
20
20
  (0, _keymaps.bindKeymapWithCommand)(
21
21
  // Ignored via go/ees005
22
22
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -117,9 +117,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
117
117
  onClick: handleClick,
118
118
  onKeyDown: handleKeyDown,
119
119
  ref: toolbarItemRef,
120
- iconBefore:
121
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
122
- (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ?
120
+ iconBefore: (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ?
123
121
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
124
122
  (0, _react2.jsx)("div", {
125
123
  css: _styles.triggerWrapperStylesWithPadding
@@ -145,9 +143,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
145
143
  selectedColor: activeColorToken,
146
144
  disabled: disabled
147
145
  })),
148
- iconAfter:
149
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
150
- (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? undefined : (0, _react2.jsx)("span", {
146
+ iconAfter: (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? undefined : (0, _react2.jsx)("span", {
151
147
  css: expandIconContainerHighlightStyle
152
148
  }, (0, _react2.jsx)(_chevronDown.default, {
153
149
  label: "",
@@ -112,9 +112,7 @@ var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
112
112
  onClick: handleClick,
113
113
  onKeyDown: handleKeyDown,
114
114
  ref: toolbarItemRef,
115
- iconBefore:
116
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
117
- (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ?
115
+ iconBefore: (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ?
118
116
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
119
117
  (0, _react2.jsx)("div", {
120
118
  css: _styles.triggerWrapperStylesWithPadding
@@ -16,9 +16,7 @@ export const highlightPlugin = ({
16
16
  }) => {
17
17
  var _api$analytics;
18
18
  const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
19
- const isToolbarAifcEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true, {
20
- exposure: true
21
- });
19
+ const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
22
20
  const primaryToolbarComponent = ({
23
21
  popupsMountPoint,
24
22
  popupsBoundariesElement,
@@ -40,7 +38,7 @@ export const highlightPlugin = ({
40
38
  editorView: editorView
41
39
  });
42
40
  };
43
- if (!isToolbarAifcEnabled) {
41
+ if (!isToolbarAIFCEnabled) {
44
42
  var _api$primaryToolbar;
45
43
  api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
46
44
  name: 'highlight',
@@ -87,7 +85,7 @@ export const highlightPlugin = ({
87
85
  }
88
86
  return highlightPluginKey.getState(editorState);
89
87
  },
90
- pluginsOptions: !isToolbarAifcEnabled ? {
88
+ pluginsOptions: !isToolbarAIFCEnabled ? {
91
89
  selectionToolbar() {
92
90
  var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
93
91
  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;
@@ -3,7 +3,6 @@ import { bindKeymapWithCommand, keymap, toggleHighlightPalette, applyYellowHighl
3
3
  import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
4
4
  import { highlightColorPalette, highlightColorPaletteNext } from '@atlaskit/editor-common/ui-color';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
6
  import { changeColor } from '../editor-commands/change-color';
8
7
  import { togglePalette } from '../editor-commands/palette';
9
8
  export function keymapPlugin({
@@ -11,7 +10,8 @@ export function keymapPlugin({
11
10
  }) {
12
11
  var _api$analytics;
13
12
  const list = {};
14
- if (!(editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true))) {
13
+ const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
14
+ if (!(isToolbarAIFCEnabled && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true))) {
15
15
  bindKeymapWithCommand(
16
16
  // Ignored via go/ees005
17
17
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -116,9 +116,7 @@ const FloatingToolbarHighlightColor = ({
116
116
  onClick: handleClick,
117
117
  onKeyDown: handleKeyDown,
118
118
  ref: toolbarItemRef,
119
- iconBefore:
120
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
121
- fg('platform-visual-refresh-icons') ?
119
+ iconBefore: fg('platform-visual-refresh-icons') ?
122
120
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
123
121
  jsx("div", {
124
122
  css: triggerWrapperStylesWithPadding
@@ -144,9 +142,7 @@ const FloatingToolbarHighlightColor = ({
144
142
  selectedColor: activeColorToken,
145
143
  disabled: disabled
146
144
  })),
147
- iconAfter:
148
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
149
- fg('platform-visual-refresh-icons') ? undefined : jsx("span", {
145
+ iconAfter: fg('platform-visual-refresh-icons') ? undefined : jsx("span", {
150
146
  css: expandIconContainerHighlightStyle
151
147
  }, jsx(ChevronDownIcon, {
152
148
  label: "",
@@ -111,9 +111,7 @@ const PrimaryToolbarHighlightColor = ({
111
111
  onClick: handleClick,
112
112
  onKeyDown: handleKeyDown,
113
113
  ref: toolbarItemRef,
114
- iconBefore:
115
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
116
- fg('platform-visual-refresh-icons') ?
114
+ iconBefore: fg('platform-visual-refresh-icons') ?
117
115
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
118
116
  jsx("div", {
119
117
  css: triggerWrapperStylesWithPadding
@@ -15,9 +15,7 @@ export var highlightPlugin = function highlightPlugin(_ref) {
15
15
  var api = _ref.api,
16
16
  options = _ref.config;
17
17
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
18
- var isToolbarAifcEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true, {
19
- exposure: true
20
- });
18
+ var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
21
19
  var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
22
20
  var popupsMountPoint = _ref2.popupsMountPoint,
23
21
  popupsBoundariesElement = _ref2.popupsBoundariesElement,
@@ -38,7 +36,7 @@ export var highlightPlugin = function highlightPlugin(_ref) {
38
36
  editorView: editorView
39
37
  });
40
38
  };
41
- if (!isToolbarAifcEnabled) {
39
+ if (!isToolbarAIFCEnabled) {
42
40
  var _api$primaryToolbar;
43
41
  api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
44
42
  name: 'highlight',
@@ -91,7 +89,7 @@ export var highlightPlugin = function highlightPlugin(_ref) {
91
89
  }
92
90
  return highlightPluginKey.getState(editorState);
93
91
  },
94
- pluginsOptions: !isToolbarAifcEnabled ? {
92
+ pluginsOptions: !isToolbarAIFCEnabled ? {
95
93
  selectionToolbar: function selectionToolbar() {
96
94
  var _api$userPreferences, _api$selectionToolbar;
97
95
  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;
@@ -3,14 +3,14 @@ import { bindKeymapWithCommand, keymap, toggleHighlightPalette, applyYellowHighl
3
3
  import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
4
4
  import { highlightColorPalette, highlightColorPaletteNext } from '@atlaskit/editor-common/ui-color';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
6
  import { changeColor } from '../editor-commands/change-color';
8
7
  import { togglePalette } from '../editor-commands/palette';
9
8
  export function keymapPlugin(_ref) {
10
9
  var _api$analytics;
11
10
  var api = _ref.api;
12
11
  var list = {};
13
- if (!(editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true))) {
12
+ var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
13
+ if (!(isToolbarAIFCEnabled && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true))) {
14
14
  bindKeymapWithCommand(
15
15
  // Ignored via go/ees005
16
16
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -109,9 +109,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
109
109
  onClick: handleClick,
110
110
  onKeyDown: handleKeyDown,
111
111
  ref: toolbarItemRef,
112
- iconBefore:
113
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
114
- fg('platform-visual-refresh-icons') ?
112
+ iconBefore: fg('platform-visual-refresh-icons') ?
115
113
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
116
114
  jsx("div", {
117
115
  css: triggerWrapperStylesWithPadding
@@ -137,9 +135,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
137
135
  selectedColor: activeColorToken,
138
136
  disabled: disabled
139
137
  })),
140
- iconAfter:
141
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
142
- fg('platform-visual-refresh-icons') ? undefined : jsx("span", {
138
+ iconAfter: fg('platform-visual-refresh-icons') ? undefined : jsx("span", {
143
139
  css: expandIconContainerHighlightStyle
144
140
  }, jsx(ChevronDownIcon, {
145
141
  label: "",
@@ -104,9 +104,7 @@ var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
104
104
  onClick: handleClick,
105
105
  onKeyDown: handleKeyDown,
106
106
  ref: toolbarItemRef,
107
- iconBefore:
108
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
109
- fg('platform-visual-refresh-icons') ?
107
+ iconBefore: fg('platform-visual-refresh-icons') ?
110
108
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
111
109
  jsx("div", {
112
110
  css: triggerWrapperStylesWithPadding
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-highlight",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "Highlight plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/editor-plugin-text-formatting": "^6.0.0",
43
43
  "@atlaskit/editor-plugin-toolbar": "^3.2.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
45
- "@atlaskit/editor-shared-styles": "^3.6.0",
45
+ "@atlaskit/editor-shared-styles": "^3.7.0",
46
46
  "@atlaskit/editor-tables": "^2.9.0",
47
47
  "@atlaskit/editor-toolbar": "^0.15.0",
48
48
  "@atlaskit/editor-toolbar-model": "^0.2.0",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/icon": "^28.5.0",
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/primitives": "^14.15.0",
53
- "@atlaskit/tmp-editor-statsig": "^13.8.0",
53
+ "@atlaskit/tmp-editor-statsig": "^13.10.0",
54
54
  "@atlaskit/tokens": "^6.4.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@emotion/react": "^11.7.1"