@atlaskit/editor-plugin-block-menu 5.0.9 → 5.0.10

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.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c0f06bd1a9b63`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0f06bd1a9b63) -
8
+ Feature flag removal platform_editor_block_menu_patch_2
9
+ - Updated dependencies
10
+
3
11
  ## 5.0.9
4
12
 
5
13
  ### Patch Changes
@@ -8,7 +8,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
8
8
  var _monitoring = require("@atlaskit/editor-common/monitoring");
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
12
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
14
13
  var _selection = require("./selection");
@@ -124,7 +123,7 @@ var formatNode = exports.formatNode = function formatNode(api) {
124
123
  });
125
124
  // get the first list node as when click on drag handle if there are list node
126
125
  // can only select one list at a time, so we just need to find the first one
127
- if (listNodes.length > 0 && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_2')) {
126
+ if (listNodes.length > 0) {
128
127
  var firstChild = listNodes[0];
129
128
  var newTr = formatNodeSelectEmptyList(tr, targetType, firstChild, schema);
130
129
  if (newTr) {
@@ -8,7 +8,6 @@ exports.unwrapAndConvertToList = exports.unwrapAndConvertToBlockType = exports.t
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _inlineNodeTransforms = require("./inline-node-transforms");
13
12
  var _utils2 = require("./utils");
14
13
  var convertInvalidNodeToValidNodeType = function convertInvalidNodeToValidNodeType(sourceContent, sourceNodeType, validNodeType, withMarks) {
@@ -204,7 +203,7 @@ var unwrapAndConvertToList = exports.unwrapAndConvertToList = function unwrapAnd
204
203
  heading = _schema$nodes2.heading;
205
204
  var isTargetTaskList = targetNodeType === taskList;
206
205
  var createListItemFromInline = function createListItemFromInline(content) {
207
- if (!content && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_2')) {
206
+ if (!content) {
208
207
  return isTargetTaskList ? taskItem.create() : listItem.create(null, paragraph.create());
209
208
  } else {
210
209
  return isTargetTaskList ? taskItem.create(null, content) : listItem.create(null, paragraph.create(null, content));
@@ -243,7 +242,7 @@ var unwrapAndConvertToList = exports.unwrapAndConvertToList = function unwrapAnd
243
242
  var isOnlyNewLines = function isOnlyNewLines(codeText) {
244
243
  return codeText.replace(/\n/g, '').trim() === '';
245
244
  };
246
- if ((!codeText || isOnlyNewLines(codeText)) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_2')) {
245
+ if (!codeText || isOnlyNewLines(codeText)) {
247
246
  // Empty code block - create an empty list item
248
247
  currentListItems.push(createListItemFromInline());
249
248
  }
@@ -76,7 +76,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
76
76
  // if text is inside of an expand or extension, the selection contains an expand or extension for some reason
77
77
  // the expandNode or extensionNode always and only have one child, no matter how much contents are inside the expand or extension,
78
78
  // and the one child is the line that is being selected, so we can use the .firstChild again
79
- if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension' && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_patch_2'))) {
79
+ if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension')) {
80
80
  var expandOrExtensionNode = fragment.firstChild;
81
81
  var actualNodeToCopy = expandOrExtensionNode.firstChild;
82
82
  fragment = _model.Fragment.from(actualNodeToCopy) || _model.Fragment.empty;
@@ -2,7 +2,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
2
2
  import { logException } from '@atlaskit/editor-common/monitoring';
3
3
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { findParentNodeOfType, findSelectedNodeOfType, safeInsert as pmSafeInsert } from '@atlaskit/editor-prosemirror/utils';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
8
7
  import { setSelectionAfterTransform } from './selection';
@@ -129,7 +128,7 @@ export const formatNode = api => (targetType, analyticsAttrs) => {
129
128
  });
130
129
  // get the first list node as when click on drag handle if there are list node
131
130
  // can only select one list at a time, so we just need to find the first one
132
- if (listNodes.length > 0 && fg('platform_editor_block_menu_patch_2')) {
131
+ if (listNodes.length > 0) {
133
132
  const firstChild = listNodes[0];
134
133
  const newTr = formatNodeSelectEmptyList(tr, targetType, firstChild, schema);
135
134
  if (newTr) {
@@ -1,6 +1,5 @@
1
1
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
2
2
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { getInlineNodeTextContent } from './inline-node-transforms';
5
4
  import { isBlockNodeType, isListNodeType, isContainerNodeType, isBlockNodeForExtraction, convertNodeToInlineContent, getContentSupportChecker, convertCodeBlockContentToParagraphs, filterMarksForTargetNodeType, getMarksWithBreakout } from './utils';
6
5
  const convertInvalidNodeToValidNodeType = (sourceContent, sourceNodeType, validNodeType, withMarks) => {
@@ -205,7 +204,7 @@ export const unwrapAndConvertToList = ({
205
204
  } = schema.nodes;
206
205
  const isTargetTaskList = targetNodeType === taskList;
207
206
  const createListItemFromInline = content => {
208
- if (!content && fg('platform_editor_block_menu_patch_2')) {
207
+ if (!content) {
209
208
  return isTargetTaskList ? taskItem.create() : listItem.create(null, paragraph.create());
210
209
  } else {
211
210
  return isTargetTaskList ? taskItem.create(null, content) : listItem.create(null, paragraph.create(null, content));
@@ -242,7 +241,7 @@ export const unwrapAndConvertToList = ({
242
241
  // check if code block only contains newline characters
243
242
  // eslint-disable-next-line require-unicode-regexp
244
243
  const isOnlyNewLines = codeText => codeText.replace(/\n/g, '').trim() === '';
245
- if ((!codeText || isOnlyNewLines(codeText)) && fg('platform_editor_block_menu_patch_2')) {
244
+ if (!codeText || isOnlyNewLines(codeText)) {
246
245
  // Empty code block - create an empty list item
247
246
  currentListItems.push(createListItemFromInline());
248
247
  }
@@ -70,7 +70,7 @@ const CopyBlockMenuItem = ({
70
70
  // if text is inside of an expand or extension, the selection contains an expand or extension for some reason
71
71
  // the expandNode or extensionNode always and only have one child, no matter how much contents are inside the expand or extension,
72
72
  // and the one child is the line that is being selected, so we can use the .firstChild again
73
- if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension' && fg('platform_editor_block_menu_patch_2'))) {
73
+ if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension')) {
74
74
  const expandOrExtensionNode = fragment.firstChild;
75
75
  const actualNodeToCopy = expandOrExtensionNode.firstChild;
76
76
  fragment = Fragment.from(actualNodeToCopy) || Fragment.empty;
@@ -2,7 +2,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
2
2
  import { logException } from '@atlaskit/editor-common/monitoring';
3
3
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { findParentNodeOfType, findSelectedNodeOfType, safeInsert as pmSafeInsert } from '@atlaskit/editor-prosemirror/utils';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
6
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
8
7
  import { setSelectionAfterTransform } from './selection';
@@ -119,7 +118,7 @@ export var formatNode = function formatNode(api) {
119
118
  });
120
119
  // get the first list node as when click on drag handle if there are list node
121
120
  // can only select one list at a time, so we just need to find the first one
122
- if (listNodes.length > 0 && fg('platform_editor_block_menu_patch_2')) {
121
+ if (listNodes.length > 0) {
123
122
  var firstChild = listNodes[0];
124
123
  var newTr = formatNodeSelectEmptyList(tr, targetType, firstChild, schema);
125
124
  if (newTr) {
@@ -1,7 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { getInlineNodeTextContent } from './inline-node-transforms';
6
5
  import { isBlockNodeType, isListNodeType, isContainerNodeType, isBlockNodeForExtraction, convertNodeToInlineContent, getContentSupportChecker, convertCodeBlockContentToParagraphs, filterMarksForTargetNodeType, getMarksWithBreakout } from './utils';
7
6
  var convertInvalidNodeToValidNodeType = function convertInvalidNodeToValidNodeType(sourceContent, sourceNodeType, validNodeType, withMarks) {
@@ -197,7 +196,7 @@ export var unwrapAndConvertToList = function unwrapAndConvertToList(_ref3) {
197
196
  heading = _schema$nodes2.heading;
198
197
  var isTargetTaskList = targetNodeType === taskList;
199
198
  var createListItemFromInline = function createListItemFromInline(content) {
200
- if (!content && fg('platform_editor_block_menu_patch_2')) {
199
+ if (!content) {
201
200
  return isTargetTaskList ? taskItem.create() : listItem.create(null, paragraph.create());
202
201
  } else {
203
202
  return isTargetTaskList ? taskItem.create(null, content) : listItem.create(null, paragraph.create(null, content));
@@ -236,7 +235,7 @@ export var unwrapAndConvertToList = function unwrapAndConvertToList(_ref3) {
236
235
  var isOnlyNewLines = function isOnlyNewLines(codeText) {
237
236
  return codeText.replace(/\n/g, '').trim() === '';
238
237
  };
239
- if ((!codeText || isOnlyNewLines(codeText)) && fg('platform_editor_block_menu_patch_2')) {
238
+ if (!codeText || isOnlyNewLines(codeText)) {
240
239
  // Empty code block - create an empty list item
241
240
  currentListItems.push(createListItemFromInline());
242
241
  }
@@ -69,7 +69,7 @@ var CopyBlockMenuItem = function CopyBlockMenuItem(_ref) {
69
69
  // if text is inside of an expand or extension, the selection contains an expand or extension for some reason
70
70
  // the expandNode or extensionNode always and only have one child, no matter how much contents are inside the expand or extension,
71
71
  // and the one child is the line that is being selected, so we can use the .firstChild again
72
- if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension' && fg('platform_editor_block_menu_patch_2'))) {
72
+ if ((_fragment2 = fragment) !== null && _fragment2 !== void 0 && _fragment2.firstChild && (fragment.firstChild.type.name === 'expand' || fragment.firstChild.type.name === 'bodiedExtension')) {
73
73
  var expandOrExtensionNode = fragment.firstChild;
74
74
  var actualNodeToCopy = expandOrExtensionNode.firstChild;
75
75
  fragment = Fragment.from(actualNodeToCopy) || Fragment.empty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "5.0.9",
3
+ "version": "5.0.10",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -102,9 +102,6 @@
102
102
  "platform_editor_block_menu_for_disabled_nodes": {
103
103
  "type": "boolean"
104
104
  },
105
- "platform_editor_block_menu_patch_2": {
106
- "type": "boolean"
107
- },
108
105
  "platform_editor_block_menu_shouldfitcontainer": {
109
106
  "type": "boolean"
110
107
  },