@atlaskit/editor-plugin-block-type 11.1.1 → 11.2.1

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,23 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 11.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`6e8029473620b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e8029473620b) -
14
+ [EDITOR-4496] clean up experiment platform_editor_toolbar_aifc_patch_3 and remove view-mode plugin
15
+ dependency from loom plugin
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 11.1.1
4
22
 
5
23
  ### Patch Changes
@@ -15,7 +15,6 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
15
15
  var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
16
16
  var _editorToolbar = require("@atlaskit/editor-toolbar");
17
17
  var _compiled = require("@atlaskit/primitives/compiled");
18
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
18
  var headingSizeStylesMap = {
20
19
  normal: "_11c8fhey",
21
20
  heading1: "_11c812ln",
@@ -52,8 +51,7 @@ var HeadingButton = exports.HeadingButton = function HeadingButton(_ref) {
52
51
  api === null || api === void 0 || (_api$core = api.core) === null || _api$core === 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(blockType.name, _analytics.INPUT_METHOD.TOOLBAR, fromBlockQuote));
53
52
  };
54
53
  var shortcut = (0, _keymaps.formatShortcut)(shortcuts[blockType.name]);
55
- (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
56
- var isSelected = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) ? (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name : currentBlockType === blockType;
54
+ var isSelected = (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name;
57
55
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
58
56
  elemBefore: blockType.icon,
59
57
  elemAfter: shortcut ? /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarKeyboardShortcutHint, {
@@ -10,15 +10,10 @@ var _reactIntlNext = require("react-intl-next");
10
10
  var _hooks = require("@atlaskit/editor-common/hooks");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _toolbar = require("@atlaskit/editor-common/toolbar");
13
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
14
13
  var _editorToolbar = require("@atlaskit/editor-toolbar");
15
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
16
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
14
  var _blockTypes = require("../../block-types");
18
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
- var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(function () {
20
- return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
21
- }, function (api) {
16
+ var usePluginState = function usePluginState(api) {
22
17
  return (0, _hooks.useSharedPluginStateWithSelector)(api, ['blockType'], function (state) {
23
18
  var _state$blockTypeState, _state$blockTypeState2;
24
19
  return {
@@ -26,14 +21,7 @@ var usePluginState = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(fun
26
21
  currentBlockType: (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
27
22
  };
28
23
  });
29
- }, function (api) {
30
- var blockTypesDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.blockTypesDisabled');
31
- var currentBlockType = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockType.currentBlockType');
32
- return {
33
- blockTypesDisabled: blockTypesDisabled,
34
- currentBlockType: currentBlockType
35
- };
36
- });
24
+ };
37
25
  var TextStylesMenuButton = exports.TextStylesMenuButton = function TextStylesMenuButton(_ref) {
38
26
  var _Object$values$find;
39
27
  var api = _ref.api,
@@ -8,7 +8,6 @@ import { formatShortcut, setNormalText, toggleHeading1, toggleHeading2, toggleHe
8
8
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
9
9
  import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
10
10
  import { Box } from '@atlaskit/primitives/compiled';
11
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  const headingSizeStylesMap = {
13
12
  normal: "_11c8fhey",
14
13
  heading1: "_11c812ln",
@@ -45,8 +44,7 @@ export const HeadingButton = ({
45
44
  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(blockType.name, INPUT_METHOD.TOOLBAR, fromBlockQuote));
46
45
  };
47
46
  const shortcut = formatShortcut(shortcuts[blockType.name]);
48
- expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
49
- const isSelected = expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) ? (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name : currentBlockType === blockType;
47
+ const isSelected = (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name;
50
48
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
51
49
  elemBefore: blockType.icon,
52
50
  elemAfter: shortcut ? /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
@@ -3,12 +3,9 @@ import { useIntl } from 'react-intl-next';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
5
5
  import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
6
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
7
6
  import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
8
- import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
9
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
7
  import { toolbarBlockTypesWithRank } from '../../block-types';
11
- const usePluginState = conditionalHooksFactory(() => expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true), api => {
8
+ const usePluginState = api => {
12
9
  return useSharedPluginStateWithSelector(api, ['blockType'], state => {
13
10
  var _state$blockTypeState, _state$blockTypeState2;
14
11
  return {
@@ -16,14 +13,7 @@ const usePluginState = conditionalHooksFactory(() => expValEquals('platform_edit
16
13
  currentBlockType: (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
17
14
  };
18
15
  });
19
- }, api => {
20
- const blockTypesDisabled = useSharedPluginStateSelector(api, 'blockType.blockTypesDisabled');
21
- const currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
22
- return {
23
- blockTypesDisabled,
24
- currentBlockType
25
- };
26
- });
16
+ };
27
17
  export const TextStylesMenuButton = ({
28
18
  api,
29
19
  children
@@ -8,7 +8,6 @@ import { formatShortcut, setNormalText, toggleHeading1, toggleHeading2, toggleHe
8
8
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
9
9
  import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
10
10
  import { Box } from '@atlaskit/primitives/compiled';
11
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  var headingSizeStylesMap = {
13
12
  normal: "_11c8fhey",
14
13
  heading1: "_11c812ln",
@@ -45,8 +44,7 @@ export var HeadingButton = function HeadingButton(_ref) {
45
44
  api === null || api === void 0 || (_api$core = api.core) === null || _api$core === 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(blockType.name, INPUT_METHOD.TOOLBAR, fromBlockQuote));
46
45
  };
47
46
  var shortcut = formatShortcut(shortcuts[blockType.name]);
48
- expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
49
- var isSelected = expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) ? (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name : currentBlockType === blockType;
47
+ var isSelected = (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name) === blockType.name;
50
48
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
51
49
  elemBefore: blockType.icon,
52
50
  elemAfter: shortcut ? /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
@@ -3,14 +3,9 @@ import { useIntl } from 'react-intl-next';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
5
5
  import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
6
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
7
6
  import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
8
- import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
9
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
7
  import { toolbarBlockTypesWithRank } from '../../block-types';
11
- var usePluginState = conditionalHooksFactory(function () {
12
- return expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true);
13
- }, function (api) {
8
+ var usePluginState = function usePluginState(api) {
14
9
  return useSharedPluginStateWithSelector(api, ['blockType'], function (state) {
15
10
  var _state$blockTypeState, _state$blockTypeState2;
16
11
  return {
@@ -18,14 +13,7 @@ var usePluginState = conditionalHooksFactory(function () {
18
13
  currentBlockType: (_state$blockTypeState2 = state.blockTypeState) === null || _state$blockTypeState2 === void 0 ? void 0 : _state$blockTypeState2.currentBlockType
19
14
  };
20
15
  });
21
- }, function (api) {
22
- var blockTypesDisabled = useSharedPluginStateSelector(api, 'blockType.blockTypesDisabled');
23
- var currentBlockType = useSharedPluginStateSelector(api, 'blockType.currentBlockType');
24
- return {
25
- blockTypesDisabled: blockTypesDisabled,
26
- currentBlockType: currentBlockType
27
- };
28
- });
16
+ };
29
17
  export var TextStylesMenuButton = function TextStylesMenuButton(_ref) {
30
18
  var _Object$values$find;
31
19
  var api = _ref.api,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "11.1.1",
3
+ "version": "11.2.1",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,23 +36,22 @@
36
36
  "@atlaskit/editor-plugin-list": "^9.0.0",
37
37
  "@atlaskit/editor-plugin-primary-toolbar": "^8.0.0",
38
38
  "@atlaskit/editor-plugin-selection": "^7.0.0",
39
- "@atlaskit/editor-plugin-selection-toolbar": "^8.0.0",
40
- "@atlaskit/editor-plugin-toolbar": "^4.0.0",
39
+ "@atlaskit/editor-plugin-selection-toolbar": "^8.1.0",
40
+ "@atlaskit/editor-plugin-toolbar": "^4.1.0",
41
41
  "@atlaskit/editor-prosemirror": "^7.2.0",
42
42
  "@atlaskit/editor-shared-styles": "^3.10.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
44
  "@atlaskit/editor-toolbar": "^0.19.0",
45
45
  "@atlaskit/editor-toolbar-model": "^0.3.0",
46
- "@atlaskit/icon": "^29.4.0",
46
+ "@atlaskit/icon": "^30.0.0",
47
47
  "@atlaskit/icon-lab": "^5.14.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/platform-feature-flags-react": "^0.4.0",
50
49
  "@atlaskit/primitives": "^17.1.0",
51
50
  "@atlaskit/prosemirror-history": "^0.2.0",
52
51
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
53
52
  "@atlaskit/theme": "^21.0.0",
54
- "@atlaskit/tmp-editor-statsig": "^16.23.0",
55
- "@atlaskit/tokens": "^10.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^16.30.0",
54
+ "@atlaskit/tokens": "^10.1.0",
56
55
  "@babel/runtime": "^7.0.0",
57
56
  "@emotion/react": "^11.7.1"
58
57
  },