@atlaskit/editor-plugin-selection-toolbar 1.5.4 → 1.5.6

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
+ ## 1.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#107473](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107473)
8
+ [`962b3297548df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/962b3297548df) -
9
+ [ux] Implement variation 2 for editor contextual toolbar formatting experiment
10
+
11
+ ## 1.5.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [#105009](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105009)
16
+ [`a4039ebf7ed11`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a4039ebf7ed11) -
17
+ [ux] Implement variant 2 cohorts experience for platform_editor_contextual_formatting_toolbar_v2
18
+ experiment
19
+ - [#104136](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/104136)
20
+ [`4eb4cb77cc4f4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4eb4cb77cc4f4) -
21
+ EDF-1999 Cleaned up platform_editor_ai_definitions_live_page_view_mode to default to true.
22
+ - Updated dependencies
23
+
3
24
  ## 1.5.4
4
25
 
5
26
  ### Patch Changes
@@ -5,13 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.selectionToolbarPlugin = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _bindEventListener = require("bind-event-listener");
11
11
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
12
12
  var _utils = require("@atlaskit/editor-common/utils");
13
13
  var _state = require("@atlaskit/editor-prosemirror/state");
14
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
15
  var _commands = require("./pm-plugins/commands");
17
16
  var _pluginKey = require("./pm-plugins/plugin-key");
@@ -19,9 +18,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
19
18
  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) { (0, _defineProperty2.default)(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; }
20
19
  var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selectionToolbarPlugin(options) {
21
20
  var __selectionToolbarHandlers = [];
22
- return _objectSpread(_objectSpread({
23
- name: 'selectionToolbar'
24
- }, (0, _platformFeatureFlags.fg)('platform_editor_ai_definitions_live_page_view_mode') && {
21
+ return {
22
+ name: 'selectionToolbar',
25
23
  actions: {
26
24
  suppressToolbar: function suppressToolbar() {
27
25
  var _options$api$core$act, _options$api;
@@ -35,8 +33,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
35
33
  hide: false
36
34
  }))) !== null && _options$api$core$act2 !== void 0 ? _options$api$core$act2 : false;
37
35
  }
38
- }
39
- }), {}, {
36
+ },
40
37
  pmPlugins: function pmPlugins(selectionToolbarHandlers) {
41
38
  if (selectionToolbarHandlers) {
42
39
  __selectionToolbarHandlers.push.apply(__selectionToolbarHandlers, (0, _toConsumableArray2.default)(selectionToolbarHandlers));
@@ -150,7 +147,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
150
147
  if (Array.isArray((_resolved$i = resolved[i]) === null || _resolved$i === void 0 ? void 0 : _resolved$i.items)) {
151
148
  items.push.apply(items, (0, _toConsumableArray2.default)(resolved[i].items));
152
149
  }
153
- if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true)) {
150
+ if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant2')) {
154
151
  var shouldNotAddSeparator = false;
155
152
  if (resolved[i] && resolved[i + 1]) {
156
153
  var _resolved$i2, _resolved, _resolved$i3, _resolved2;
@@ -181,7 +178,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
181
178
  };
182
179
  }
183
180
  }
184
- });
181
+ };
185
182
  };
186
183
  function getSelectionNodeTypes(state) {
187
184
  var selectionNodeTypes = [];
@@ -2,7 +2,6 @@ import { bind } from 'bind-event-listener';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
6
  import { toggleToolbar } from './pm-plugins/commands';
8
7
  import { selectionToolbarPluginKey } from './pm-plugins/plugin-key';
@@ -10,22 +9,20 @@ export const selectionToolbarPlugin = options => {
10
9
  const __selectionToolbarHandlers = [];
11
10
  return {
12
11
  name: 'selectionToolbar',
13
- ...(fg('platform_editor_ai_definitions_live_page_view_mode') && {
14
- actions: {
15
- suppressToolbar: () => {
16
- var _options$api$core$act, _options$api;
17
- return (_options$api$core$act = (_options$api = options.api) === null || _options$api === void 0 ? void 0 : _options$api.core.actions.execute(toggleToolbar({
18
- hide: true
19
- }))) !== null && _options$api$core$act !== void 0 ? _options$api$core$act : false;
20
- },
21
- unsuppressToolbar: () => {
22
- var _options$api$core$act2, _options$api2;
23
- return (_options$api$core$act2 = (_options$api2 = options.api) === null || _options$api2 === void 0 ? void 0 : _options$api2.core.actions.execute(toggleToolbar({
24
- hide: false
25
- }))) !== null && _options$api$core$act2 !== void 0 ? _options$api$core$act2 : false;
26
- }
12
+ actions: {
13
+ suppressToolbar: () => {
14
+ var _options$api$core$act, _options$api;
15
+ return (_options$api$core$act = (_options$api = options.api) === null || _options$api === void 0 ? void 0 : _options$api.core.actions.execute(toggleToolbar({
16
+ hide: true
17
+ }))) !== null && _options$api$core$act !== void 0 ? _options$api$core$act : false;
18
+ },
19
+ unsuppressToolbar: () => {
20
+ var _options$api$core$act2, _options$api2;
21
+ return (_options$api$core$act2 = (_options$api2 = options.api) === null || _options$api2 === void 0 ? void 0 : _options$api2.core.actions.execute(toggleToolbar({
22
+ hide: false
23
+ }))) !== null && _options$api$core$act2 !== void 0 ? _options$api$core$act2 : false;
27
24
  }
28
- }),
25
+ },
29
26
  pmPlugins(selectionToolbarHandlers) {
30
27
  if (selectionToolbarHandlers) {
31
28
  __selectionToolbarHandlers.push(...selectionToolbarHandlers);
@@ -139,7 +136,7 @@ export const selectionToolbarPlugin = options => {
139
136
  if (Array.isArray((_resolved$i = resolved[i]) === null || _resolved$i === void 0 ? void 0 : _resolved$i.items)) {
140
137
  items.push(...resolved[i].items);
141
138
  }
142
- if (editorExperiment('contextual_formatting_toolbar', true)) {
139
+ if (editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2')) {
143
140
  let shouldNotAddSeparator = false;
144
141
  if (resolved[i] && resolved[i + 1]) {
145
142
  var _resolved$i2, _resolved, _resolved$i3, _resolved2;
@@ -1,20 +1,18 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  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; }
5
5
  import { bind } from 'bind-event-listener';
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
7
  import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
8
8
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
10
  import { toggleToolbar } from './pm-plugins/commands';
12
11
  import { selectionToolbarPluginKey } from './pm-plugins/plugin-key';
13
12
  export var selectionToolbarPlugin = function selectionToolbarPlugin(options) {
14
13
  var __selectionToolbarHandlers = [];
15
- return _objectSpread(_objectSpread({
16
- name: 'selectionToolbar'
17
- }, fg('platform_editor_ai_definitions_live_page_view_mode') && {
14
+ return {
15
+ name: 'selectionToolbar',
18
16
  actions: {
19
17
  suppressToolbar: function suppressToolbar() {
20
18
  var _options$api$core$act, _options$api;
@@ -28,8 +26,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(options) {
28
26
  hide: false
29
27
  }))) !== null && _options$api$core$act2 !== void 0 ? _options$api$core$act2 : false;
30
28
  }
31
- }
32
- }), {}, {
29
+ },
33
30
  pmPlugins: function pmPlugins(selectionToolbarHandlers) {
34
31
  if (selectionToolbarHandlers) {
35
32
  __selectionToolbarHandlers.push.apply(__selectionToolbarHandlers, _toConsumableArray(selectionToolbarHandlers));
@@ -143,7 +140,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(options) {
143
140
  if (Array.isArray((_resolved$i = resolved[i]) === null || _resolved$i === void 0 ? void 0 : _resolved$i.items)) {
144
141
  items.push.apply(items, _toConsumableArray(resolved[i].items));
145
142
  }
146
- if (editorExperiment('contextual_formatting_toolbar', true)) {
143
+ if (editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2')) {
147
144
  var shouldNotAddSeparator = false;
148
145
  if (resolved[i] && resolved[i + 1]) {
149
146
  var _resolved$i2, _resolved, _resolved$i3, _resolved2;
@@ -174,7 +171,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(options) {
174
171
  };
175
172
  }
176
173
  }
177
- });
174
+ };
178
175
  };
179
176
  function getSelectionNodeTypes(state) {
180
177
  var selectionNodeTypes = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,17 +30,12 @@
30
30
  "af:exports": {
31
31
  ".": "./src/index.ts"
32
32
  },
33
- "platform-feature-flags": {
34
- "platform_editor_ai_definitions_live_page_view_mode": {
35
- "type": "boolean"
36
- }
37
- },
38
33
  "dependencies": {
39
- "@atlaskit/editor-common": "^99.0.0",
34
+ "@atlaskit/editor-common": "^99.5.0",
40
35
  "@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
41
36
  "@atlaskit/editor-prosemirror": "6.2.1",
42
37
  "@atlaskit/platform-feature-flags": "^0.3.0",
43
- "@atlaskit/tmp-editor-statsig": "^2.33.0",
38
+ "@atlaskit/tmp-editor-statsig": "^2.41.0",
44
39
  "@babel/runtime": "^7.0.0",
45
40
  "bind-event-listener": "^3.0.0"
46
41
  },