@atlaskit/editor-plugin-block-type 3.13.1 → 3.14.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,26 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 3.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#133711](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133711)
8
+ [`41612f682764d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/41612f682764d) -
9
+ [ED-24400] Added feature gate and experiment for nesting media & codeblock in quotes
10
+ - Updated dependencies
11
+
12
+ ## 3.14.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#133191](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133191)
17
+ [`78a1927084934`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/78a1927084934) -
18
+ [ux] Remove icon migration feature gate and migrate new icons on primary toolbar
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 3.13.1
4
25
 
5
26
  ### Patch Changes
@@ -19,6 +19,7 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
19
19
  var _messages = require("@atlaskit/editor-common/messages");
20
20
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
21
21
  var _types = require("@atlaskit/editor-common/types");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
23
  var _commands = require("./commands");
23
24
  var _blockType = require("./commands/block-type");
24
25
  var _inputRule = _interopRequireDefault(require("./pm-plugins/input-rule"));
@@ -101,9 +102,12 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
101
102
  }];
102
103
  };
103
104
  var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3) {
104
- var _api$primaryToolbar;
105
+ var _api$featureFlags, _api$primaryToolbar;
105
106
  var options = _ref3.config,
106
107
  api = _ref3.api;
108
+ // Confluence is injecting the FF through editor props, from an experiment
109
+ // Jira is pulling it in through platform feature flags, from a feature gate
110
+ var isNestingMediaAndCodeblockInQuoteSupported = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.nestMediaAndCodeblockInQuote) || (0, _platformFeatureFlags.fg)('editor_nest_media_and_codeblock_in_quotes_jira');
107
111
  var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
108
112
  var popupsMountPoint = _ref4.popupsMountPoint,
109
113
  popupsBoundariesElement = _ref4.popupsBoundariesElement,
@@ -130,13 +134,12 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
130
134
  return {
131
135
  name: 'blockType',
132
136
  nodes: function nodes() {
133
- var blockquoteNode = _adfSchema.blockquoteWithList;
134
137
  var nodes = [{
135
138
  name: 'heading',
136
139
  node: _adfSchema.heading
137
140
  }, {
138
141
  name: 'blockquote',
139
- node: blockquoteNode
142
+ node: isNestingMediaAndCodeblockInQuoteSupported ? _adfSchema.blockquoteWithNestedCodeblockOrMedia : _adfSchema.blockquoteWithList
140
143
  }, {
141
144
  name: 'hardBreak',
142
145
  node: _adfSchema.hardBreak
@@ -12,10 +12,7 @@ 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
14
  var _textStyleEditorTextStyle = _interopRequireDefault(require("@atlaskit/icon/core/migration/text-style--editor-text-style"));
15
- var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
16
- var _textStyle = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/text-style"));
17
- var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
18
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
19
16
  var _blockTypes = require("../../block-types");
20
17
  var _styled = require("./styled");
21
18
  /**
@@ -48,20 +45,17 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
48
45
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
49
46
  css: [_styles.wrapperStyle, props.isSmall && _styled.wrapperSmallStyle],
50
47
  "data-testid": "toolbar-block-type-text-styles-icon"
51
- }, (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (0, _react2.jsx)(_textStyleEditorTextStyle.default, {
48
+ }, (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (0, _react2.jsx)(_textStyleEditorTextStyle.default, {
52
49
  label: labelTextStyles,
53
50
  spacing: "spacious",
54
51
  color: "currentColor"
55
- }), (0, _react2.jsx)(_chevronDown2.default, {
56
- label: "",
57
- color: "currentColor"
58
- })) : (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (0, _react2.jsx)(_textStyle.default, {
59
- label: labelTextStyles
60
52
  }), (0, _react2.jsx)("span", {
61
53
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
62
- css: _styled.expandIconWrapperStyle
54
+ css: _styles.expandIconContainerStyle
63
55
  }, (0, _react2.jsx)(_chevronDown.default, {
64
- label: ""
56
+ label: "",
57
+ color: "currentColor",
58
+ LEGACY_margin: "0 0 0 -8px"
65
59
  }))))
66
60
  }, !props.isSmall && (0, _react2.jsx)("span", {
67
61
  css: [
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
- import { blockquoteWithList, hardBreak, heading } from '@atlaskit/adf-schema';
2
+ import { blockquoteWithList, blockquoteWithNestedCodeblockOrMedia, hardBreak, heading } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { keymap, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
7
7
  import { ToolbarSize } from '@atlaskit/editor-common/types';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { setBlockTypeWithAnalytics } from './commands';
9
10
  import { insertBlockQuoteWithAnalytics } from './commands/block-type';
10
11
  import inputRulePlugin from './pm-plugins/input-rule';
@@ -88,7 +89,10 @@ const blockTypePlugin = ({
88
89
  config: options,
89
90
  api
90
91
  }) => {
91
- var _api$primaryToolbar;
92
+ var _api$featureFlags, _api$featureFlags$sha, _api$primaryToolbar;
93
+ // Confluence is injecting the FF through editor props, from an experiment
94
+ // Jira is pulling it in through platform feature flags, from a feature gate
95
+ const isNestingMediaAndCodeblockInQuoteSupported = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : (_api$featureFlags$sha = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags$sha === void 0 ? void 0 : _api$featureFlags$sha.nestMediaAndCodeblockInQuote) || fg('editor_nest_media_and_codeblock_in_quotes_jira');
92
96
  const primaryToolbarComponent = ({
93
97
  popupsMountPoint,
94
98
  popupsBoundariesElement,
@@ -116,13 +120,12 @@ const blockTypePlugin = ({
116
120
  return {
117
121
  name: 'blockType',
118
122
  nodes() {
119
- const blockquoteNode = blockquoteWithList;
120
123
  const nodes = [{
121
124
  name: 'heading',
122
125
  node: heading
123
126
  }, {
124
127
  name: 'blockquote',
125
- node: blockquoteNode
128
+ node: isNestingMediaAndCodeblockInQuoteSupported ? blockquoteWithNestedCodeblockOrMedia : blockquoteWithList
126
129
  }, {
127
130
  name: 'hardBreak',
128
131
  node: hardBreak
@@ -8,15 +8,12 @@ import React from 'react';
8
8
  import { jsx } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
11
- import { wrapperStyle } from '@atlaskit/editor-common/styles';
11
+ import { expandIconContainerStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
12
12
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
13
13
  import TextStyleIcon from '@atlaskit/icon/core/migration/text-style--editor-text-style';
14
- import { default as ExpandIcon } from '@atlaskit/icon/glyph/chevron-down';
15
- import { default as TextStyleIconLegacy } from '@atlaskit/icon/glyph/editor/text-style';
16
14
  import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
17
- import { fg } from '@atlaskit/platform-feature-flags';
18
15
  import { NORMAL_TEXT } from '../../block-types';
19
- import { buttonContentReducedSpacingStyle, buttonContentStyle, expandIconWrapperStyle, wrapperSmallStyle } from './styled';
16
+ import { buttonContentReducedSpacingStyle, buttonContentStyle, wrapperSmallStyle } from './styled';
20
17
  export const BlockTypeButton = props => {
21
18
  const blockTypeName = props.blockTypeName || '';
22
19
  const labelTextStyles = props.formatMessage(toolbarMessages.textStyles, {
@@ -40,20 +37,17 @@ export const BlockTypeButton = props => {
40
37
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
41
38
  css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
42
39
  "data-testid": "toolbar-block-type-text-styles-icon"
43
- }, fg('platform_editor_migration_icon_and_typography') ? jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIcon, {
40
+ }, jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIcon, {
44
41
  label: labelTextStyles,
45
42
  spacing: "spacious",
46
43
  color: "currentColor"
47
- }), jsx(ChevronDownIcon, {
48
- label: "",
49
- color: "currentColor"
50
- })) : jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIconLegacy, {
51
- label: labelTextStyles
52
44
  }), jsx("span", {
53
45
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
- css: expandIconWrapperStyle
55
- }, jsx(ExpandIcon, {
56
- label: ""
46
+ css: expandIconContainerStyle
47
+ }, jsx(ChevronDownIcon, {
48
+ label: "",
49
+ color: "currentColor",
50
+ LEGACY_margin: "0 0 0 -8px"
57
51
  }))))
58
52
  }, !props.isSmall && jsx("span", {
59
53
  css: [
@@ -1,11 +1,12 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import React from 'react';
3
- import { blockquoteWithList, hardBreak, heading } from '@atlaskit/adf-schema';
3
+ import { blockquoteWithList, blockquoteWithNestedCodeblockOrMedia, hardBreak, heading } from '@atlaskit/adf-schema';
4
4
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
5
  import { keymap, tooltip } from '@atlaskit/editor-common/keymaps';
6
6
  import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
8
8
  import { ToolbarSize } from '@atlaskit/editor-common/types';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { setBlockTypeWithAnalytics } from './commands';
10
11
  import { insertBlockQuoteWithAnalytics } from './commands/block-type';
11
12
  import inputRulePlugin from './pm-plugins/input-rule';
@@ -88,9 +89,12 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
88
89
  }];
89
90
  };
90
91
  var blockTypePlugin = function blockTypePlugin(_ref3) {
91
- var _api$primaryToolbar;
92
+ var _api$featureFlags, _api$primaryToolbar;
92
93
  var options = _ref3.config,
93
94
  api = _ref3.api;
95
+ // Confluence is injecting the FF through editor props, from an experiment
96
+ // Jira is pulling it in through platform feature flags, from a feature gate
97
+ var isNestingMediaAndCodeblockInQuoteSupported = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.nestMediaAndCodeblockInQuote) || fg('editor_nest_media_and_codeblock_in_quotes_jira');
94
98
  var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
95
99
  var popupsMountPoint = _ref4.popupsMountPoint,
96
100
  popupsBoundariesElement = _ref4.popupsBoundariesElement,
@@ -117,13 +121,12 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
117
121
  return {
118
122
  name: 'blockType',
119
123
  nodes: function nodes() {
120
- var blockquoteNode = blockquoteWithList;
121
124
  var nodes = [{
122
125
  name: 'heading',
123
126
  node: heading
124
127
  }, {
125
128
  name: 'blockquote',
126
- node: blockquoteNode
129
+ node: isNestingMediaAndCodeblockInQuoteSupported ? blockquoteWithNestedCodeblockOrMedia : blockquoteWithList
127
130
  }, {
128
131
  name: 'hardBreak',
129
132
  node: hardBreak
@@ -8,15 +8,12 @@ import React from 'react';
8
8
  import { jsx } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
11
- import { wrapperStyle } from '@atlaskit/editor-common/styles';
11
+ import { expandIconContainerStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
12
12
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
13
13
  import TextStyleIcon from '@atlaskit/icon/core/migration/text-style--editor-text-style';
14
- import { default as ExpandIcon } from '@atlaskit/icon/glyph/chevron-down';
15
- import { default as TextStyleIconLegacy } from '@atlaskit/icon/glyph/editor/text-style';
16
14
  import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
17
- import { fg } from '@atlaskit/platform-feature-flags';
18
15
  import { NORMAL_TEXT } from '../../block-types';
19
- import { buttonContentReducedSpacingStyle, buttonContentStyle, expandIconWrapperStyle, wrapperSmallStyle } from './styled';
16
+ import { buttonContentReducedSpacingStyle, buttonContentStyle, wrapperSmallStyle } from './styled';
20
17
  export var BlockTypeButton = function BlockTypeButton(props) {
21
18
  var blockTypeName = props.blockTypeName || '';
22
19
  var labelTextStyles = props.formatMessage(toolbarMessages.textStyles, {
@@ -40,20 +37,17 @@ export var BlockTypeButton = function BlockTypeButton(props) {
40
37
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
41
38
  css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
42
39
  "data-testid": "toolbar-block-type-text-styles-icon"
43
- }, fg('platform_editor_migration_icon_and_typography') ? jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIcon, {
40
+ }, jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIcon, {
44
41
  label: labelTextStyles,
45
42
  spacing: "spacious",
46
43
  color: "currentColor"
47
- }), jsx(ChevronDownIcon, {
48
- label: "",
49
- color: "currentColor"
50
- })) : jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIconLegacy, {
51
- label: labelTextStyles
52
44
  }), jsx("span", {
53
45
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
- css: expandIconWrapperStyle
55
- }, jsx(ExpandIcon, {
56
- label: ""
46
+ css: expandIconContainerStyle
47
+ }, jsx(ChevronDownIcon, {
48
+ label: "",
49
+ color: "currentColor",
50
+ LEGACY_margin: "0 0 0 -8px"
57
51
  }))))
58
52
  }, !props.isSmall && jsx("span", {
59
53
  css: [
@@ -1,5 +1,6 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
3
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
5
  import type { TextBlockTypes } from './block-types';
5
6
  import type { InputMethod } from './commands/block-type';
@@ -7,7 +8,11 @@ import type { BlockTypeState } from './pm-plugins/main';
7
8
  import type { BlockTypePluginOptions } from './types';
8
9
  export type BlockTypePlugin = NextEditorPlugin<'blockType', {
9
10
  pluginConfiguration: BlockTypePluginOptions | undefined;
10
- dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<PrimaryToolbarPlugin>];
11
+ dependencies: [
12
+ OptionalPlugin<AnalyticsPlugin>,
13
+ OptionalPlugin<PrimaryToolbarPlugin>,
14
+ OptionalPlugin<FeatureFlagsPlugin>
15
+ ];
11
16
  sharedState: BlockTypeState | undefined;
12
17
  actions: {
13
18
  insertBlockQuote: (inputMethod: InputMethod) => Command;
@@ -1,5 +1,6 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
3
4
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
5
  import type { TextBlockTypes } from './block-types';
5
6
  import type { InputMethod } from './commands/block-type';
@@ -9,7 +10,8 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
9
10
  pluginConfiguration: BlockTypePluginOptions | undefined;
10
11
  dependencies: [
11
12
  OptionalPlugin<AnalyticsPlugin>,
12
- OptionalPlugin<PrimaryToolbarPlugin>
13
+ OptionalPlugin<PrimaryToolbarPlugin>,
14
+ OptionalPlugin<FeatureFlagsPlugin>
13
15
  ];
14
16
  sharedState: BlockTypeState | undefined;
15
17
  actions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "3.13.1",
3
+ "version": "3.14.1",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/adf-schema": "^40.8.1",
39
- "@atlaskit/editor-common": "^88.0.0",
39
+ "@atlaskit/editor-common": "^88.1.0",
40
40
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
41
41
  "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
42
42
  "@atlaskit/editor-prosemirror": "5.0.1",
43
43
  "@atlaskit/editor-shared-styles": "^2.13.0",
44
44
  "@atlaskit/editor-tables": "^2.8.0",
45
- "@atlaskit/icon": "^22.14.0",
45
+ "@atlaskit/icon": "^22.15.0",
46
46
  "@atlaskit/platform-feature-flags": "^0.3.0",
47
47
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
48
48
  "@atlaskit/theme": "^13.0.0",
@@ -102,10 +102,10 @@
102
102
  }
103
103
  },
104
104
  "platform-feature-flags": {
105
- "platform_editor_migration_icon_and_typography": {
105
+ "platform_editor_element_padding_changes_gate": {
106
106
  "type": "boolean"
107
107
  },
108
- "platform_editor_element_padding_changes_gate": {
108
+ "editor_nest_media_and_codeblock_in_quotes_jira": {
109
109
  "type": "boolean"
110
110
  }
111
111
  }