@atlaskit/editor-plugin-block-type 6.2.0 → 6.2.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 6.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#200079](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200079)
8
+ [`ce48926ed3661`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ce48926ed3661) -
9
+ Clean up bugfix feature flag
10
+
11
+ ## 6.2.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 6.2.0
4
18
 
5
19
  ### Minor Changes
@@ -16,10 +16,8 @@ exports.setNormalTextWithAnalytics = setNormalTextWithAnalytics;
16
16
  var _analytics = require("@atlaskit/editor-common/analytics");
17
17
  var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
18
18
  var _utils = require("@atlaskit/editor-common/utils");
19
- var _model = require("@atlaskit/editor-prosemirror/model");
20
19
  var _transform = require("@atlaskit/editor-prosemirror/transform");
21
20
  var _editorTables = require("@atlaskit/editor-tables");
22
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
21
  var _blockTypes = require("../block-types");
24
22
  var _clearFormatting = require("./clear-formatting");
25
23
  var _wrapSelectionIn = require("./wrapSelectionIn");
@@ -58,28 +56,20 @@ function setHeading(level, fromBlockQuote) {
58
56
  if (!range) {
59
57
  return;
60
58
  }
61
- if ((0, _platformFeatureFlags.fg)('platform_editor_bugfix_remove_block_quote')) {
62
- // First, lift the content out of the blockquote
63
- var targetLiftDepth = (0, _transform.liftTarget)(range);
64
- if (targetLiftDepth || targetLiftDepth === 0) {
65
- tr.lift(range, targetLiftDepth);
66
- }
67
59
 
68
- // Then apply the heading block type to the lifted content
69
- // We need to recalculate positions after the lift operation
70
- var newFrom = tr.mapping.map($from.pos);
71
- var newTo = tr.mapping.map($to.pos);
72
- tr.setBlockType(newFrom, newTo, schema.nodes.heading, {
73
- level: level
74
- });
75
- } else {
76
- var content = $from.node().content;
77
- var headingNode = schema.nodes.heading.createChecked({
78
- level: level
79
- }, content);
80
- var slice = new _model.Slice(_model.Fragment.from(headingNode), 0, 0);
81
- tr.replaceRange(range.start, range.end, slice);
60
+ // First, lift the content out of the blockquote
61
+ var targetLiftDepth = (0, _transform.liftTarget)(range);
62
+ if (targetLiftDepth || targetLiftDepth === 0) {
63
+ tr.lift(range, targetLiftDepth);
82
64
  }
65
+
66
+ // Then apply the heading block type to the lifted content
67
+ // We need to recalculate positions after the lift operation
68
+ var newFrom = tr.mapping.map($from.pos);
69
+ var newTo = tr.mapping.map($to.pos);
70
+ tr.setBlockType(newFrom, newTo, schema.nodes.heading, {
71
+ level: level
72
+ });
83
73
  } else {
84
74
  tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
85
75
  level: level
@@ -121,14 +111,11 @@ function setNormalText(fromBlockQuote) {
121
111
  if (!range) {
122
112
  return;
123
113
  }
124
- if ((0, _platformFeatureFlags.fg)('platform_editor_bugfix_remove_block_quote')) {
125
- // First, lift the content out of the blockquote
126
- var targetLiftDepth = (0, _transform.liftTarget)(range);
127
- if (targetLiftDepth || targetLiftDepth === 0) {
128
- tr.lift(range, targetLiftDepth);
129
- }
130
- } else {
131
- tr.lift(range, 0);
114
+
115
+ // First, lift the content out of the blockquote
116
+ var targetLiftDepth = (0, _transform.liftTarget)(range);
117
+ if (targetLiftDepth || targetLiftDepth === 0) {
118
+ tr.lift(range, targetLiftDepth);
132
119
  }
133
120
  var newFrom = tr.mapping.map($from.pos);
134
121
  var newTo = tr.mapping.map($to.pos);
@@ -25,13 +25,13 @@ var headingSizeStylesMap = {
25
25
  heading6: "_11c81vhk"
26
26
  };
27
27
  var shortcuts = {
28
- 'normal': _keymaps.setNormalText,
29
- 'heading1': _keymaps.toggleHeading1,
30
- 'heading2': _keymaps.toggleHeading2,
31
- 'heading3': _keymaps.toggleHeading3,
32
- 'heading4': _keymaps.toggleHeading4,
33
- 'heading5': _keymaps.toggleHeading5,
34
- 'heading6': _keymaps.toggleHeading6
28
+ normal: _keymaps.setNormalText,
29
+ heading1: _keymaps.toggleHeading1,
30
+ heading2: _keymaps.toggleHeading2,
31
+ heading3: _keymaps.toggleHeading3,
32
+ heading4: _keymaps.toggleHeading4,
33
+ heading5: _keymaps.toggleHeading5,
34
+ heading6: _keymaps.toggleHeading6
35
35
  };
36
36
  var HeadingButton = exports.HeadingButton = function HeadingButton(_ref) {
37
37
  var blockType = _ref.blockType,
@@ -1,10 +1,8 @@
1
1
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
2
2
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
3
3
  import { filterChildrenBetween, wrapSelectionIn } from '@atlaskit/editor-common/utils';
4
- import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
5
4
  import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
6
5
  import { CellSelection } from '@atlaskit/editor-tables';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
6
  import { HEADINGS_BY_NAME, NORMAL_TEXT } from '../block-types';
9
7
  import { FORMATTING_NODE_TYPES, FORMATTING_MARK_TYPES, cellSelectionNodesBetween, formatTypes, clearNodeFormattingOnSelection } from './clear-formatting';
10
8
  import { wrapSelectionInBlockType } from './wrapSelectionIn';
@@ -51,28 +49,20 @@ export function setHeading(level, fromBlockQuote) {
51
49
  if (!range) {
52
50
  return;
53
51
  }
54
- if (fg('platform_editor_bugfix_remove_block_quote')) {
55
- // First, lift the content out of the blockquote
56
- const targetLiftDepth = liftTarget(range);
57
- if (targetLiftDepth || targetLiftDepth === 0) {
58
- tr.lift(range, targetLiftDepth);
59
- }
60
52
 
61
- // Then apply the heading block type to the lifted content
62
- // We need to recalculate positions after the lift operation
63
- const newFrom = tr.mapping.map($from.pos);
64
- const newTo = tr.mapping.map($to.pos);
65
- tr.setBlockType(newFrom, newTo, schema.nodes.heading, {
66
- level
67
- });
68
- } else {
69
- const content = $from.node().content;
70
- const headingNode = schema.nodes.heading.createChecked({
71
- level
72
- }, content);
73
- const slice = new Slice(Fragment.from(headingNode), 0, 0);
74
- tr.replaceRange(range.start, range.end, slice);
53
+ // First, lift the content out of the blockquote
54
+ const targetLiftDepth = liftTarget(range);
55
+ if (targetLiftDepth || targetLiftDepth === 0) {
56
+ tr.lift(range, targetLiftDepth);
75
57
  }
58
+
59
+ // Then apply the heading block type to the lifted content
60
+ // We need to recalculate positions after the lift operation
61
+ const newFrom = tr.mapping.map($from.pos);
62
+ const newTo = tr.mapping.map($to.pos);
63
+ tr.setBlockType(newFrom, newTo, schema.nodes.heading, {
64
+ level
65
+ });
76
66
  } else {
77
67
  tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
78
68
  level
@@ -125,14 +115,11 @@ export function setNormalText(fromBlockQuote) {
125
115
  if (!range) {
126
116
  return;
127
117
  }
128
- if (fg('platform_editor_bugfix_remove_block_quote')) {
129
- // First, lift the content out of the blockquote
130
- const targetLiftDepth = liftTarget(range);
131
- if (targetLiftDepth || targetLiftDepth === 0) {
132
- tr.lift(range, targetLiftDepth);
133
- }
134
- } else {
135
- tr.lift(range, 0);
118
+
119
+ // First, lift the content out of the blockquote
120
+ const targetLiftDepth = liftTarget(range);
121
+ if (targetLiftDepth || targetLiftDepth === 0) {
122
+ tr.lift(range, targetLiftDepth);
136
123
  }
137
124
  const newFrom = tr.mapping.map($from.pos);
138
125
  const newTo = tr.mapping.map($to.pos);
@@ -18,13 +18,13 @@ const headingSizeStylesMap = {
18
18
  heading6: "_11c81vhk"
19
19
  };
20
20
  const shortcuts = {
21
- 'normal': setNormalText,
22
- 'heading1': toggleHeading1,
23
- 'heading2': toggleHeading2,
24
- 'heading3': toggleHeading3,
25
- 'heading4': toggleHeading4,
26
- 'heading5': toggleHeading5,
27
- 'heading6': toggleHeading6
21
+ normal: setNormalText,
22
+ heading1: toggleHeading1,
23
+ heading2: toggleHeading2,
24
+ heading3: toggleHeading3,
25
+ heading4: toggleHeading4,
26
+ heading5: toggleHeading5,
27
+ heading6: toggleHeading6
28
28
  };
29
29
  export const HeadingButton = ({
30
30
  blockType,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
4
4
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
- import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from "@atlaskit/editor-toolbar";
5
+ import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
6
6
  import { toolbarBlockTypesWithRank } from '../../block-types';
7
7
  export const TextStylesMenuButton = ({
8
8
  api,
@@ -4,10 +4,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
4
4
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
5
5
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
6
6
  import { filterChildrenBetween, wrapSelectionIn } from '@atlaskit/editor-common/utils';
7
- import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
8
7
  import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
9
8
  import { CellSelection } from '@atlaskit/editor-tables';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
9
  import { HEADINGS_BY_NAME, NORMAL_TEXT } from '../block-types';
12
10
  import { FORMATTING_NODE_TYPES, FORMATTING_MARK_TYPES, cellSelectionNodesBetween, formatTypes, clearNodeFormattingOnSelection } from './clear-formatting';
13
11
  import { wrapSelectionInBlockType } from './wrapSelectionIn';
@@ -43,28 +41,20 @@ export function setHeading(level, fromBlockQuote) {
43
41
  if (!range) {
44
42
  return;
45
43
  }
46
- if (fg('platform_editor_bugfix_remove_block_quote')) {
47
- // First, lift the content out of the blockquote
48
- var targetLiftDepth = liftTarget(range);
49
- if (targetLiftDepth || targetLiftDepth === 0) {
50
- tr.lift(range, targetLiftDepth);
51
- }
52
44
 
53
- // Then apply the heading block type to the lifted content
54
- // We need to recalculate positions after the lift operation
55
- var newFrom = tr.mapping.map($from.pos);
56
- var newTo = tr.mapping.map($to.pos);
57
- tr.setBlockType(newFrom, newTo, schema.nodes.heading, {
58
- level: level
59
- });
60
- } else {
61
- var content = $from.node().content;
62
- var headingNode = schema.nodes.heading.createChecked({
63
- level: level
64
- }, content);
65
- var slice = new Slice(Fragment.from(headingNode), 0, 0);
66
- tr.replaceRange(range.start, range.end, slice);
45
+ // First, lift the content out of the blockquote
46
+ var targetLiftDepth = liftTarget(range);
47
+ if (targetLiftDepth || targetLiftDepth === 0) {
48
+ tr.lift(range, targetLiftDepth);
67
49
  }
50
+
51
+ // Then apply the heading block type to the lifted content
52
+ // We need to recalculate positions after the lift operation
53
+ var newFrom = tr.mapping.map($from.pos);
54
+ var newTo = tr.mapping.map($to.pos);
55
+ tr.setBlockType(newFrom, newTo, schema.nodes.heading, {
56
+ level: level
57
+ });
68
58
  } else {
69
59
  tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
70
60
  level: level
@@ -106,14 +96,11 @@ export function setNormalText(fromBlockQuote) {
106
96
  if (!range) {
107
97
  return;
108
98
  }
109
- if (fg('platform_editor_bugfix_remove_block_quote')) {
110
- // First, lift the content out of the blockquote
111
- var targetLiftDepth = liftTarget(range);
112
- if (targetLiftDepth || targetLiftDepth === 0) {
113
- tr.lift(range, targetLiftDepth);
114
- }
115
- } else {
116
- tr.lift(range, 0);
99
+
100
+ // First, lift the content out of the blockquote
101
+ var targetLiftDepth = liftTarget(range);
102
+ if (targetLiftDepth || targetLiftDepth === 0) {
103
+ tr.lift(range, targetLiftDepth);
117
104
  }
118
105
  var newFrom = tr.mapping.map($from.pos);
119
106
  var newTo = tr.mapping.map($to.pos);
@@ -18,13 +18,13 @@ var headingSizeStylesMap = {
18
18
  heading6: "_11c81vhk"
19
19
  };
20
20
  var shortcuts = {
21
- 'normal': setNormalText,
22
- 'heading1': toggleHeading1,
23
- 'heading2': toggleHeading2,
24
- 'heading3': toggleHeading3,
25
- 'heading4': toggleHeading4,
26
- 'heading5': toggleHeading5,
27
- 'heading6': toggleHeading6
21
+ normal: setNormalText,
22
+ heading1: toggleHeading1,
23
+ heading2: toggleHeading2,
24
+ heading3: toggleHeading3,
25
+ heading4: toggleHeading4,
26
+ heading5: toggleHeading5,
27
+ heading6: toggleHeading6
28
28
  };
29
29
  export var HeadingButton = function HeadingButton(_ref) {
30
30
  var blockType = _ref.blockType,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
4
4
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
5
- import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from "@atlaskit/editor-toolbar";
5
+ import { ToolbarDropdownMenu, ToolbarTooltip, TextIcon } from '@atlaskit/editor-toolbar';
6
6
  import { toolbarBlockTypesWithRank } from '../../block-types';
7
7
  export var TextStylesMenuButton = function TextStylesMenuButton(_ref) {
8
8
  var _Object$values$find;
@@ -1,4 +1,4 @@
1
- export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean, typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => () => import("@emotion/react").SerializedStyles;
1
+ export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean, typographyTheme?: "typography" | "typography-adg3" | "typography-modernized" | "typography-refreshed") => () => import("@emotion/react").SerializedStyles;
2
2
  export declare const keyboardShortcut: import("@emotion/react").SerializedStyles;
3
3
  export declare const keyboardShortcutSelect: import("@emotion/react").SerializedStyles;
4
4
  export declare const wrapperSmallStyle: import("@emotion/react").SerializedStyles;
@@ -1 +1 @@
1
- export declare const blocktypeStyles: (typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => import("@emotion/react").SerializedStyles;
1
+ export declare const blocktypeStyles: (typographyTheme?: "typography" | "typography-adg3" | "typography-modernized" | "typography-refreshed") => import("@emotion/react").SerializedStyles;
@@ -1,4 +1,4 @@
1
- export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean, typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => () => import("@emotion/react").SerializedStyles;
1
+ export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean, typographyTheme?: "typography" | "typography-adg3" | "typography-modernized" | "typography-refreshed") => () => import("@emotion/react").SerializedStyles;
2
2
  export declare const keyboardShortcut: import("@emotion/react").SerializedStyles;
3
3
  export declare const keyboardShortcutSelect: import("@emotion/react").SerializedStyles;
4
4
  export declare const wrapperSmallStyle: import("@emotion/react").SerializedStyles;
@@ -1 +1 @@
1
- export declare const blocktypeStyles: (typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed') => import("@emotion/react").SerializedStyles;
1
+ export declare const blocktypeStyles: (typographyTheme?: "typography" | "typography-adg3" | "typography-modernized" | "typography-refreshed") => import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "6.2.0",
3
+ "version": "6.2.2",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,25 +39,25 @@
39
39
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
40
40
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
41
41
  "@atlaskit/editor-plugin-selection-toolbar": "^4.3.0",
42
- "@atlaskit/editor-plugin-toolbar": "^0.1.0",
42
+ "@atlaskit/editor-plugin-toolbar": "^0.2.0",
43
43
  "@atlaskit/editor-prosemirror": "7.0.0",
44
44
  "@atlaskit/editor-shared-styles": "^3.6.0",
45
45
  "@atlaskit/editor-tables": "^2.9.0",
46
- "@atlaskit/editor-toolbar": "^0.1.0",
47
- "@atlaskit/editor-toolbar-model": "^0.0.4",
48
- "@atlaskit/icon": "^27.10.0",
46
+ "@atlaskit/editor-toolbar": "^0.2.0",
47
+ "@atlaskit/editor-toolbar-model": "^0.1.0",
48
+ "@atlaskit/icon": "^27.11.0",
49
49
  "@atlaskit/icon-lab": "^5.4.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
51
  "@atlaskit/primitives": "^14.11.0",
52
52
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
53
53
  "@atlaskit/theme": "^19.0.0",
54
- "@atlaskit/tmp-editor-statsig": "^9.25.0",
54
+ "@atlaskit/tmp-editor-statsig": "^9.27.0",
55
55
  "@atlaskit/tokens": "^6.0.0",
56
56
  "@babel/runtime": "^7.0.0",
57
57
  "@emotion/react": "^11.7.1"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^107.19.0",
60
+ "@atlaskit/editor-common": "^107.22.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0",
63
63
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -118,9 +118,6 @@
118
118
  },
119
119
  "platform_editor_use_preferences_plugin": {
120
120
  "type": "boolean"
121
- },
122
- "platform_editor_bugfix_remove_block_quote": {
123
- "type": "boolean"
124
121
  }
125
122
  }
126
123
  }