@atlaskit/editor-plugin-text-formatting 2.2.8 → 2.2.9

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,14 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 2.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#160862](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160862)
8
+ [`3f27efcc909bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3f27efcc909bd) -
9
+ Fix disabled state of text formatting overflow menu with controls experiment enabled.
10
+ - Updated dependencies
11
+
3
12
  ## 2.2.8
4
13
 
5
14
  ### Patch Changes
@@ -31,7 +31,8 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
31
31
  hasMoreButton = _ref.hasMoreButton,
32
32
  intl = _ref.intl,
33
33
  toolbarType = _ref.toolbarType,
34
- hasMultiplePartsWithFormattingSelected = _ref.hasMultiplePartsWithFormattingSelected;
34
+ hasMultiplePartsWithFormattingSelected = _ref.hasMultiplePartsWithFormattingSelected,
35
+ isDisabled = _ref.isDisabled;
35
36
  var _useMenuState = (0, _menuState.useMenuState)(),
36
37
  _useMenuState2 = (0, _slicedToArray2.default)(_useMenuState, 3),
37
38
  isMenuOpen = _useMenuState2[0],
@@ -105,7 +106,7 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
105
106
  "aria-expanded": isMenuOpen
106
107
  }) : /*#__PURE__*/_react.default.createElement(_dropdownToolbarButton.DropdownToolbarButton, {
107
108
  isReducedSpacing: isReducedSpacing,
108
- isDisabled: false,
109
+ isDisabled: Boolean(isDisabled),
109
110
  isSelected: isMenuOpen,
110
111
  label: intl.formatMessage(_messages.toolbarMessages.textFormat),
111
112
  "aria-expanded": isMenuOpen,
@@ -169,7 +169,7 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
169
169
  }), (0, _react2.jsx)("span", {
170
170
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage
171
171
  css: _styles.wrapperStyle
172
- }, isToolbarDisabled ? (0, _react2.jsx)("div", null, (0, _react2.jsx)(_moreButton.MoreButton, {
172
+ }, isToolbarDisabled && !((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_10')) ? (0, _react2.jsx)("div", null, (0, _react2.jsx)(_moreButton.MoreButton, {
173
173
  label: moreFormattingButtonLabel,
174
174
  isReducedSpacing: isReducedSpacing,
175
175
  isDisabled: true,
@@ -187,7 +187,8 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
187
187
  hasMoreButton: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') ? false : true,
188
188
  items: items,
189
189
  intl: intl,
190
- toolbarType: toolbarType
190
+ toolbarType: toolbarType,
191
+ isDisabled: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_10') ? isToolbarDisabled : false
191
192
  }))), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
192
193
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
193
194
  (0, _react2.jsx)("span", {
@@ -19,7 +19,8 @@ export const FormattingTextDropdownMenu = /*#__PURE__*/React.memo(({
19
19
  hasMoreButton,
20
20
  intl,
21
21
  toolbarType,
22
- hasMultiplePartsWithFormattingSelected
22
+ hasMultiplePartsWithFormattingSelected,
23
+ isDisabled
23
24
  }) => {
24
25
  var _items$0$items$, _items$0$items$2;
25
26
  const [isMenuOpen, toggleMenu, closeMenu] = useMenuState();
@@ -86,7 +87,7 @@ export const FormattingTextDropdownMenu = /*#__PURE__*/React.memo(({
86
87
  "aria-expanded": isMenuOpen
87
88
  }) : /*#__PURE__*/React.createElement(DropdownToolbarButton, {
88
89
  isReducedSpacing: isReducedSpacing,
89
- isDisabled: false,
90
+ isDisabled: Boolean(isDisabled),
90
91
  isSelected: isMenuOpen,
91
92
  label: intl.formatMessage(toolbarMessages.textFormat),
92
93
  "aria-expanded": isMenuOpen,
@@ -158,7 +158,7 @@ const ToolbarFormatting = ({
158
158
  }), jsx("span", {
159
159
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage
160
160
  css: wrapperStyle
161
- }, isToolbarDisabled ? jsx("div", null, jsx(MoreButton, {
161
+ }, isToolbarDisabled && !(editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_10')) ? jsx("div", null, jsx(MoreButton, {
162
162
  label: moreFormattingButtonLabel,
163
163
  isReducedSpacing: isReducedSpacing,
164
164
  isDisabled: true,
@@ -176,7 +176,8 @@ const ToolbarFormatting = ({
176
176
  hasMoreButton: editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4') ? false : true,
177
177
  items: items,
178
178
  intl: intl,
179
- toolbarType: toolbarType
179
+ toolbarType: toolbarType,
180
+ isDisabled: editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_10') ? isToolbarDisabled : false
180
181
  }))), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
181
182
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
182
183
  jsx("span", {
@@ -21,7 +21,8 @@ export var FormattingTextDropdownMenu = /*#__PURE__*/React.memo(function (_ref)
21
21
  hasMoreButton = _ref.hasMoreButton,
22
22
  intl = _ref.intl,
23
23
  toolbarType = _ref.toolbarType,
24
- hasMultiplePartsWithFormattingSelected = _ref.hasMultiplePartsWithFormattingSelected;
24
+ hasMultiplePartsWithFormattingSelected = _ref.hasMultiplePartsWithFormattingSelected,
25
+ isDisabled = _ref.isDisabled;
25
26
  var _useMenuState = useMenuState(),
26
27
  _useMenuState2 = _slicedToArray(_useMenuState, 3),
27
28
  isMenuOpen = _useMenuState2[0],
@@ -95,7 +96,7 @@ export var FormattingTextDropdownMenu = /*#__PURE__*/React.memo(function (_ref)
95
96
  "aria-expanded": isMenuOpen
96
97
  }) : /*#__PURE__*/React.createElement(DropdownToolbarButton, {
97
98
  isReducedSpacing: isReducedSpacing,
98
- isDisabled: false,
99
+ isDisabled: Boolean(isDisabled),
99
100
  isSelected: isMenuOpen,
100
101
  label: intl.formatMessage(toolbarMessages.textFormat),
101
102
  "aria-expanded": isMenuOpen,
@@ -163,7 +163,7 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
163
163
  }), jsx("span", {
164
164
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage
165
165
  css: wrapperStyle
166
- }, isToolbarDisabled ? jsx("div", null, jsx(MoreButton, {
166
+ }, isToolbarDisabled && !(editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_10')) ? jsx("div", null, jsx(MoreButton, {
167
167
  label: moreFormattingButtonLabel,
168
168
  isReducedSpacing: isReducedSpacing,
169
169
  isDisabled: true,
@@ -181,7 +181,8 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
181
181
  hasMoreButton: editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4') ? false : true,
182
182
  items: items,
183
183
  intl: intl,
184
- toolbarType: toolbarType
184
+ toolbarType: toolbarType,
185
+ isDisabled: editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_10') ? isToolbarDisabled : false
185
186
  }))), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
186
187
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
187
188
  jsx("span", {
@@ -16,6 +16,7 @@ type DropdownMenuProps = {
16
16
  hasMoreButton: boolean;
17
17
  toolbarType: ToolbarType;
18
18
  hasMultiplePartsWithFormattingSelected?: boolean;
19
+ isDisabled?: boolean;
19
20
  } & WrappedComponentProps;
20
- export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, hasMultiplePartsWithFormattingSelected, }: DropdownMenuProps) => React.JSX.Element>;
21
+ export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, hasMultiplePartsWithFormattingSelected, isDisabled, }: DropdownMenuProps) => React.JSX.Element>;
21
22
  export {};
@@ -16,6 +16,7 @@ type DropdownMenuProps = {
16
16
  hasMoreButton: boolean;
17
17
  toolbarType: ToolbarType;
18
18
  hasMultiplePartsWithFormattingSelected?: boolean;
19
+ isDisabled?: boolean;
19
20
  } & WrappedComponentProps;
20
- export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, hasMultiplePartsWithFormattingSelected, }: DropdownMenuProps) => React.JSX.Element>;
21
+ export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, hasMultiplePartsWithFormattingSelected, isDisabled, }: DropdownMenuProps) => React.JSX.Element>;
21
22
  export {};
package/docs/0-intro.tsx CHANGED
@@ -33,7 +33,7 @@ ${code`
33
33
  type TextFormattingPlugin = NextEditorPlugin<
34
34
  'textFormatting',
35
35
  {
36
- pluginConfiguration: TextFormattingOptions | undefined;
36
+ pluginConfiguration: TextFormattingPluginOptions | undefined;
37
37
  dependencies: [OptionalPlugin<typeof analyticsPlugin>];
38
38
  commands: {
39
39
  toggleSuperscript: ToggleMarkEditorCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
- "@atlaskit/editor-common": "^105.8.0",
37
+ "@atlaskit/editor-common": "^105.9.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
39
39
  "@atlaskit/editor-plugin-base": "^3.0.0",
40
40
  "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
@@ -42,10 +42,10 @@
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/editor-shared-styles": "^3.4.0",
44
44
  "@atlaskit/editor-tables": "^2.9.0",
45
- "@atlaskit/icon": "^26.1.0",
45
+ "@atlaskit/icon": "^26.2.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
48
- "@atlaskit/tmp-editor-statsig": "^4.24.0",
48
+ "@atlaskit/tmp-editor-statsig": "^4.25.0",
49
49
  "@atlaskit/tokens": "^4.9.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",