@atlaskit/editor-plugin-block-type 4.0.7 → 4.0.9

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,20 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 4.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#172933](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172933)
8
+ [`8323af2381d00`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8323af2381d00) -
9
+ [ux] Arranges items in the Selection toolbar under the Contextual toolbar experiment flag
10
+ - Updated dependencies
11
+
12
+ ## 4.0.8
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 4.0.7
4
19
 
5
20
  ### Patch Changes
@@ -204,7 +204,9 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
204
204
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
205
205
  pluginsOptions: {
206
206
  selectionToolbar: function selectionToolbar() {
207
- if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true)) {
207
+ if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
208
+ exposure: true
209
+ })) {
208
210
  var toolbarCustom = {
209
211
  type: 'custom',
210
212
  render: function render(view, _idx, _dispatchAnalyticsEvent) {
@@ -219,7 +221,8 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
219
221
  };
220
222
  return {
221
223
  isToolbarAbove: true,
222
- items: [toolbarCustom]
224
+ items: [toolbarCustom],
225
+ rank: 8
223
226
  };
224
227
  } else {
225
228
  return undefined;
@@ -9,7 +9,6 @@ exports.FloatingToolbarComponent = FloatingToolbarComponent;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _hooks = require("@atlaskit/editor-common/hooks");
12
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
12
  var _ToolbarBlockType = _interopRequireDefault(require("./ToolbarBlockType"));
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -23,11 +22,6 @@ function FloatingToolbarComponent(_ref) {
23
22
  var api = _ref.api;
24
23
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['blockType']),
25
24
  blockTypeState = _useSharedPluginState.blockTypeState;
26
- (0, _react.useEffect)(function () {
27
- (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
28
- exposure: true
29
- });
30
- }, []);
31
25
  var boundSetBlockType = (0, _react.useCallback)(function (name) {
32
26
  var _api$core, _api$blockType;
33
27
  return api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 || (_api$blockType = api.blockType) === null || _api$blockType === void 0 || (_api$blockType = _api$blockType.commands) === null || _api$blockType === void 0 ? void 0 : _api$blockType.setTextLevel(name, _analytics.INPUT_METHOD.FLOATING_TB));
@@ -189,7 +189,9 @@ const blockTypePlugin = ({
189
189
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
190
190
  pluginsOptions: {
191
191
  selectionToolbar: () => {
192
- if (editorExperiment('contextual_formatting_toolbar', true)) {
192
+ if (editorExperiment('contextual_formatting_toolbar', true, {
193
+ exposure: true
194
+ })) {
193
195
  const toolbarCustom = {
194
196
  type: 'custom',
195
197
  render: (view, _idx, _dispatchAnalyticsEvent) => {
@@ -204,7 +206,8 @@ const blockTypePlugin = ({
204
206
  };
205
207
  return {
206
208
  isToolbarAbove: true,
207
- items: [toolbarCustom]
209
+ items: [toolbarCustom],
210
+ rank: 8
208
211
  };
209
212
  } else {
210
213
  return undefined;
@@ -1,7 +1,6 @@
1
- import React, { useCallback, useEffect } from 'react';
1
+ import React, { useCallback } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
4
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
4
  import ToolbarBlockType from './ToolbarBlockType';
6
5
  const FloatingToolbarSettings = {
7
6
  isSmall: true,
@@ -15,11 +14,6 @@ export function FloatingToolbarComponent({
15
14
  const {
16
15
  blockTypeState
17
16
  } = useSharedPluginState(api, ['blockType']);
18
- useEffect(() => {
19
- editorExperiment('contextual_formatting_toolbar', true, {
20
- exposure: true
21
- });
22
- }, []);
23
17
  const boundSetBlockType = useCallback(name => {
24
18
  var _api$core, _api$blockType, _api$blockType$comman;
25
19
  return api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockType = api.blockType) === null || _api$blockType === void 0 ? void 0 : (_api$blockType$comman = _api$blockType.commands) === null || _api$blockType$comman === void 0 ? void 0 : _api$blockType$comman.setTextLevel(name, INPUT_METHOD.FLOATING_TB));
@@ -191,7 +191,9 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
191
191
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
192
192
  pluginsOptions: {
193
193
  selectionToolbar: function selectionToolbar() {
194
- if (editorExperiment('contextual_formatting_toolbar', true)) {
194
+ if (editorExperiment('contextual_formatting_toolbar', true, {
195
+ exposure: true
196
+ })) {
195
197
  var toolbarCustom = {
196
198
  type: 'custom',
197
199
  render: function render(view, _idx, _dispatchAnalyticsEvent) {
@@ -206,7 +208,8 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
206
208
  };
207
209
  return {
208
210
  isToolbarAbove: true,
209
- items: [toolbarCustom]
211
+ items: [toolbarCustom],
212
+ rank: 8
210
213
  };
211
214
  } else {
212
215
  return undefined;
@@ -1,7 +1,6 @@
1
- import React, { useCallback, useEffect } from 'react';
1
+ import React, { useCallback } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
4
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
4
  import ToolbarBlockType from './ToolbarBlockType';
6
5
  var FloatingToolbarSettings = {
7
6
  isSmall: true,
@@ -13,11 +12,6 @@ export function FloatingToolbarComponent(_ref) {
13
12
  var api = _ref.api;
14
13
  var _useSharedPluginState = useSharedPluginState(api, ['blockType']),
15
14
  blockTypeState = _useSharedPluginState.blockTypeState;
16
- useEffect(function () {
17
- editorExperiment('contextual_formatting_toolbar', true, {
18
- exposure: true
19
- });
20
- }, []);
21
15
  var boundSetBlockType = useCallback(function (name) {
22
16
  var _api$core, _api$blockType;
23
17
  return api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 || (_api$blockType = api.blockType) === null || _api$blockType === void 0 || (_api$blockType = _api$blockType.commands) === null || _api$blockType === void 0 ? void 0 : _api$blockType.setTextLevel(name, INPUT_METHOD.FLOATING_TB));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "4.0.7",
3
+ "version": "4.0.9",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^46.1.0",
37
- "@atlaskit/editor-common": "^95.10.0",
37
+ "@atlaskit/editor-common": "^96.1.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
39
39
  "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
40
40
  "@atlaskit/editor-prosemirror": "6.2.1",