@atlaskit/editor-plugin-block-menu 5.0.21 → 5.0.22

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,13 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 5.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41a91a916c125`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41a91a916c125) -
8
+ EDITOR-2846 Change platform_synced_block to use editorExperiment and add Jira experiment
9
+ - Updated dependencies
10
+
3
11
  ## 5.0.21
4
12
 
5
13
  ### Patch Changes
@@ -24,6 +24,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
24
  var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
25
25
  var _compiled = require("@atlaskit/primitives/compiled");
26
26
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
27
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
27
28
  var _blockMenuProvider = require("./block-menu-provider");
28
29
  var _blockMenuRenderer = require("./block-menu-renderer");
29
30
  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); }
@@ -118,7 +119,7 @@ var BlockMenuContent = function BlockMenuContent(_ref3) {
118
119
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
119
120
  testId: "editor-block-menu",
120
121
  ref: ref,
121
- xcss: (0, _css.cx)(styles.base, (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_synced_block', 'isEnabled', true) && styles.emptyMenuSectionStyles)
122
+ xcss: (0, _css.cx)(styles.base, (0, _experiments.editorExperiment)('platform_synced_block', true) && styles.emptyMenuSectionStyles)
122
123
  }, /*#__PURE__*/_react.default.createElement(_blockMenuRenderer.BlockMenuRenderer, {
123
124
  components: blockMenuComponents || [],
124
125
  fallbacks: {
@@ -17,7 +17,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
17
17
  var _utils = require("@atlaskit/editor-tables/utils");
18
18
  var _editorToolbar = require("@atlaskit/editor-toolbar");
19
19
  var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
20
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
21
21
  var _blockMenuProvider = require("./block-menu-provider");
22
22
  var _consts = require("./consts");
23
23
  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; }
@@ -112,7 +112,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
112
112
  }
113
113
  // source sync block (bodiedSyncBlock) is also a special case
114
114
  // where we need to copy the content of the bodiedSyncBlock node
115
- else if (selection.node.type.name === 'bodiedSyncBlock' && (0, _expValEquals.expValEquals)('platform_synced_block', 'isEnabled', true)) {
115
+ else if (selection.node.type.name === 'bodiedSyncBlock' && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
116
116
  var bodiedSyncBlockNode = selection.node;
117
117
  var _domNode3 = toDOMFromFragment(bodiedSyncBlockNode.content, schema);
118
118
  (0, _copyButton.copyDomNode)(_domNode3, bodiedSyncBlockNode.type, selection);
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.CopySection = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _editorToolbar = require("@atlaskit/editor-toolbar");
10
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
10
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
11
  var _checkIsFormatMenuHidden = require("./utils/checkIsFormatMenuHidden");
12
12
  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); }
13
13
  var CopySection = exports.CopySection = function CopySection(_ref) {
@@ -17,6 +17,6 @@ var CopySection = exports.CopySection = function CopySection(_ref) {
17
17
  return (0, _checkIsFormatMenuHidden.checkIsFormatMenuHidden)(api);
18
18
  }, [api]);
19
19
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
20
- hasSeparator: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_synced_block', 'isEnabled', true) ? true : !isFormatMenuHidden()
20
+ hasSeparator: (0, _experiments.editorExperiment)('platform_synced_block', true) ? true : !isFormatMenuHidden()
21
21
  }, children);
22
22
  };
@@ -17,6 +17,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
18
18
  import { Box } from '@atlaskit/primitives/compiled';
19
19
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
20
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
20
21
  import { useBlockMenu } from './block-menu-provider';
21
22
  import { BlockMenuRenderer } from './block-menu-renderer';
22
23
  const styles = {
@@ -111,7 +112,7 @@ const BlockMenuContent = ({
111
112
  return /*#__PURE__*/React.createElement(Box, {
112
113
  testId: "editor-block-menu",
113
114
  ref: ref,
114
- xcss: cx(styles.base, expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) && styles.emptyMenuSectionStyles)
115
+ xcss: cx(styles.base, editorExperiment('platform_synced_block', true) && styles.emptyMenuSectionStyles)
115
116
  }, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
116
117
  components: blockMenuComponents || [],
117
118
  fallbacks: {
@@ -9,7 +9,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
9
9
  import { isTableSelected } from '@atlaskit/editor-tables/utils';
10
10
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
11
11
  import CopyIcon from '@atlaskit/icon/core/copy';
12
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
13
  import { useBlockMenu } from './block-menu-provider';
14
14
  import { BLOCK_MENU_ITEM_NAME } from './consts';
15
15
  const toDOMFromFragment = (fragment, schema) => {
@@ -107,7 +107,7 @@ const CopyBlockMenuItem = ({
107
107
  }
108
108
  // source sync block (bodiedSyncBlock) is also a special case
109
109
  // where we need to copy the content of the bodiedSyncBlock node
110
- else if (selection.node.type.name === 'bodiedSyncBlock' && expValEquals('platform_synced_block', 'isEnabled', true)) {
110
+ else if (selection.node.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true)) {
111
111
  const bodiedSyncBlockNode = selection.node;
112
112
  const domNode = toDOMFromFragment(bodiedSyncBlockNode.content, schema);
113
113
  copyDomNode(domNode, bodiedSyncBlockNode.type, selection);
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
3
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
3
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
4
  import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
5
5
  export const CopySection = ({
6
6
  api,
@@ -10,6 +10,6 @@ export const CopySection = ({
10
10
  return checkIsFormatMenuHidden(api);
11
11
  }, [api]);
12
12
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
13
- hasSeparator: expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) ? true : !isFormatMenuHidden()
13
+ hasSeparator: editorExperiment('platform_synced_block', true) ? true : !isFormatMenuHidden()
14
14
  }, children);
15
15
  };
@@ -17,6 +17,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
18
18
  import { Box } from '@atlaskit/primitives/compiled';
19
19
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
20
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
20
21
  import { useBlockMenu } from './block-menu-provider';
21
22
  import { BlockMenuRenderer } from './block-menu-renderer';
22
23
  var styles = {
@@ -110,7 +111,7 @@ var BlockMenuContent = function BlockMenuContent(_ref3) {
110
111
  return /*#__PURE__*/React.createElement(Box, {
111
112
  testId: "editor-block-menu",
112
113
  ref: ref,
113
- xcss: cx(styles.base, expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) && styles.emptyMenuSectionStyles)
114
+ xcss: cx(styles.base, editorExperiment('platform_synced_block', true) && styles.emptyMenuSectionStyles)
114
115
  }, /*#__PURE__*/React.createElement(BlockMenuRenderer, {
115
116
  components: blockMenuComponents || [],
116
117
  fallbacks: {
@@ -12,7 +12,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
12
12
  import { isTableSelected } from '@atlaskit/editor-tables/utils';
13
13
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
14
14
  import CopyIcon from '@atlaskit/icon/core/copy';
15
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
16
  import { useBlockMenu } from './block-menu-provider';
17
17
  import { BLOCK_MENU_ITEM_NAME } from './consts';
18
18
  var toDOMFromFragment = function toDOMFromFragment(fragment, schema) {
@@ -105,7 +105,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
105
105
  }
106
106
  // source sync block (bodiedSyncBlock) is also a special case
107
107
  // where we need to copy the content of the bodiedSyncBlock node
108
- else if (selection.node.type.name === 'bodiedSyncBlock' && expValEquals('platform_synced_block', 'isEnabled', true)) {
108
+ else if (selection.node.type.name === 'bodiedSyncBlock' && editorExperiment('platform_synced_block', true)) {
109
109
  var bodiedSyncBlockNode = selection.node;
110
110
  var _domNode3 = toDOMFromFragment(bodiedSyncBlockNode.content, schema);
111
111
  copyDomNode(_domNode3, bodiedSyncBlockNode.type, selection);
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
3
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
3
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
4
  import { checkIsFormatMenuHidden } from './utils/checkIsFormatMenuHidden';
5
5
  export var CopySection = function CopySection(_ref) {
6
6
  var api = _ref.api,
@@ -9,6 +9,6 @@ export var CopySection = function CopySection(_ref) {
9
9
  return checkIsFormatMenuHidden(api);
10
10
  }, [api]);
11
11
  return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
12
- hasSeparator: expValEqualsNoExposure('platform_synced_block', 'isEnabled', true) ? true : !isFormatMenuHidden()
12
+ hasSeparator: editorExperiment('platform_synced_block', true) ? true : !isFormatMenuHidden()
13
13
  }, children);
14
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "5.0.21",
3
+ "version": "5.0.22",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",