@atlaskit/editor-plugin-block-type 10.2.21 → 10.3.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,24 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 10.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2702e8bc600ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2702e8bc600ac) -
8
+ Add the empty line to history so it can be part of undo stack correctly.
9
+ - Updated dependencies
10
+
11
+ ## 10.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`762b79e21f96a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/762b79e21f96a) -
16
+ Migrated and cleaned up legacy iconography usage.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 10.2.21
4
23
 
5
24
  ### Patch Changes
@@ -93,7 +93,11 @@ var createPlugin = exports.createPlugin = function createPlugin(editorAPI, dispa
93
93
  var lastNode = pos.node(1);
94
94
  var paragraph = newState.schema.nodes.paragraph;
95
95
  if (lastNode && lastNode.isBlock && lastNode.type !== paragraph) {
96
- return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create()).setMeta('addToHistory', false);
96
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_insert_paragraph_undo')) {
97
+ return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create());
98
+ } else {
99
+ return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create()).setMeta('addToHistory', false);
100
+ }
97
101
  }
98
102
  }
99
103
  },
@@ -11,9 +11,8 @@ var _reactIntlNext = require("react-intl-next");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _styles = require("@atlaskit/editor-common/styles");
13
13
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
14
- var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
14
+ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
15
15
  var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
16
- var _textStyle = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/text-style"));
17
16
  var _primitives = require("@atlaskit/primitives");
18
17
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
19
18
  var _blockTypes = require("../../block-types");
@@ -45,8 +44,7 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
45
44
  var icon = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && props.blockTypeIcon ? props.blockTypeIcon : (0, _react2.jsx)(_text.default, {
46
45
  label: labelTextStyles,
47
46
  spacing: "spacious",
48
- color: "currentColor",
49
- LEGACY_fallbackIcon: _textStyle.default
47
+ color: "currentColor"
50
48
  });
51
49
  var chevronIconSpacing = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') ? 'spacious' : 'none';
52
50
  var shouldUseIconAsButton = props.isSmall || (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1');
@@ -74,7 +72,6 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
74
72
  spacing: chevronIconSpacing,
75
73
  label: "",
76
74
  color: "currentColor",
77
- LEGACY_margin: "0 0 0 -8px",
78
75
  size: "small"
79
76
  }))))
80
77
  }, !shouldUseIconAsButton && (0, _react2.jsx)(_primitives.Box, {
@@ -84,7 +84,11 @@ export const createPlugin = (editorAPI, dispatch, lastNodeMustBeParagraph, inclu
84
84
  paragraph
85
85
  } = newState.schema.nodes;
86
86
  if (lastNode && lastNode.isBlock && lastNode.type !== paragraph) {
87
- return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create()).setMeta('addToHistory', false);
87
+ if (fg('platform_editor_fix_insert_paragraph_undo')) {
88
+ return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create());
89
+ } else {
90
+ return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create()).setMeta('addToHistory', false);
91
+ }
88
92
  }
89
93
  }
90
94
  },
@@ -10,9 +10,8 @@ import { FormattedMessage } from 'react-intl-next';
10
10
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
11
11
  import { expandIconContainerStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
12
12
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
13
- import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
13
+ import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
14
14
  import TextIcon from '@atlaskit/icon/core/text';
15
- import { default as TextStyleIconLegacy } from '@atlaskit/icon/glyph/editor/text-style';
16
15
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
17
16
  import { Box, xcss } from '@atlaskit/primitives';
18
17
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -36,8 +35,7 @@ export const BlockTypeButton = props => {
36
35
  const icon = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && props.blockTypeIcon ? props.blockTypeIcon : jsx(TextIcon, {
37
36
  label: labelTextStyles,
38
37
  spacing: "spacious",
39
- color: "currentColor",
40
- LEGACY_fallbackIcon: TextStyleIconLegacy
38
+ color: "currentColor"
41
39
  });
42
40
  const chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') ? 'spacious' : 'none';
43
41
  const shouldUseIconAsButton = props.isSmall || expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1');
@@ -65,7 +63,6 @@ export const BlockTypeButton = props => {
65
63
  spacing: chevronIconSpacing,
66
64
  label: "",
67
65
  color: "currentColor",
68
- LEGACY_margin: "0 0 0 -8px",
69
66
  size: "small"
70
67
  }))))
71
68
  }, !shouldUseIconAsButton && jsx(Box, {
@@ -86,7 +86,11 @@ export var createPlugin = function createPlugin(editorAPI, dispatch, lastNodeMus
86
86
  var lastNode = pos.node(1);
87
87
  var paragraph = newState.schema.nodes.paragraph;
88
88
  if (lastNode && lastNode.isBlock && lastNode.type !== paragraph) {
89
- return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create()).setMeta('addToHistory', false);
89
+ if (fg('platform_editor_fix_insert_paragraph_undo')) {
90
+ return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create());
91
+ } else {
92
+ return newState.tr.insert(newState.doc.content.size, newState.schema.nodes.paragraph.create()).setMeta('addToHistory', false);
93
+ }
90
94
  }
91
95
  }
92
96
  },
@@ -10,9 +10,8 @@ import { FormattedMessage } from 'react-intl-next';
10
10
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
11
11
  import { expandIconContainerStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
12
12
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
13
- import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
13
+ import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
14
14
  import TextIcon from '@atlaskit/icon/core/text';
15
- import { default as TextStyleIconLegacy } from '@atlaskit/icon/glyph/editor/text-style';
16
15
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
17
16
  import { Box, xcss } from '@atlaskit/primitives';
18
17
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -36,8 +35,7 @@ export var BlockTypeButton = function BlockTypeButton(props) {
36
35
  var icon = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && props.blockTypeIcon ? props.blockTypeIcon : jsx(TextIcon, {
37
36
  label: labelTextStyles,
38
37
  spacing: "spacious",
39
- color: "currentColor",
40
- LEGACY_fallbackIcon: TextStyleIconLegacy
38
+ color: "currentColor"
41
39
  });
42
40
  var chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') ? 'spacious' : 'none';
43
41
  var shouldUseIconAsButton = props.isSmall || expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1');
@@ -65,7 +63,6 @@ export var BlockTypeButton = function BlockTypeButton(props) {
65
63
  spacing: chevronIconSpacing,
66
64
  label: "",
67
65
  color: "currentColor",
68
- LEGACY_margin: "0 0 0 -8px",
69
66
  size: "small"
70
67
  }))))
71
68
  }, !shouldUseIconAsButton && jsx(Box, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "10.2.21",
3
+ "version": "10.3.1",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,41 +29,41 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^51.5.1",
33
- "@atlaskit/css": "^0.17.0",
32
+ "@atlaskit/adf-schema": "^51.5.0",
33
+ "@atlaskit/css": "^0.18.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
35
- "@atlaskit/editor-plugin-block-menu": "^5.1.0",
35
+ "@atlaskit/editor-plugin-block-menu": "^5.2.0",
36
36
  "@atlaskit/editor-plugin-list": "^8.2.0",
37
37
  "@atlaskit/editor-plugin-primary-toolbar": "^7.0.0",
38
38
  "@atlaskit/editor-plugin-selection": "^6.1.0",
39
39
  "@atlaskit/editor-plugin-selection-toolbar": "^7.1.0",
40
40
  "@atlaskit/editor-plugin-toolbar": "^3.4.0",
41
- "@atlaskit/editor-prosemirror": "7.0.0",
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.18.0",
45
45
  "@atlaskit/editor-toolbar-model": "^0.2.0",
46
- "@atlaskit/icon": "^29.0.0",
47
- "@atlaskit/icon-lab": "^5.12.0",
46
+ "@atlaskit/icon": "^29.3.0",
47
+ "@atlaskit/icon-lab": "^5.13.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
49
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
50
50
  "@atlaskit/primitives": "^16.4.0",
51
51
  "@atlaskit/prosemirror-history": "^0.2.0",
52
52
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
53
53
  "@atlaskit/theme": "^21.0.0",
54
- "@atlaskit/tmp-editor-statsig": "^15.0.0",
55
- "@atlaskit/tokens": "^8.4.0",
54
+ "@atlaskit/tmp-editor-statsig": "^15.13.0",
55
+ "@atlaskit/tokens": "^8.6.0",
56
56
  "@babel/runtime": "^7.0.0",
57
57
  "@emotion/react": "^11.7.1"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^110.40.0",
60
+ "@atlaskit/editor-common": "^110.46.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"
64
64
  },
65
65
  "devDependencies": {
66
- "@testing-library/react": "^13.4.0",
66
+ "@testing-library/react": "^16.3.0",
67
67
  "@testing-library/user-event": "^14.4.3",
68
68
  "wait-for-expect": "^1.2.0"
69
69
  },
@@ -116,6 +116,9 @@
116
116
  "platform_editor_use_preferences_plugin": {
117
117
  "type": "boolean"
118
118
  },
119
+ "platform_editor_fix_insert_paragraph_undo": {
120
+ "type": "boolean"
121
+ },
119
122
  "platform_editor_adf_with_localid": {
120
123
  "type": "boolean"
121
124
  },