@atlaskit/editor-plugin-card 7.2.1 → 7.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,14 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 7.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#191381](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/191381)
8
+ [`efd66bb003bb4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/efd66bb003bb4) -
9
+ [ux] Show warning on embed option in smart link card appearance dropdown
10
+ - Updated dependencies
11
+
3
12
  ## 7.2.1
4
13
 
5
14
  ### Patch Changes
@@ -14,6 +14,7 @@ var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _model = require("@atlaskit/editor-prosemirror/model");
15
15
  var _linkProvider = require("@atlaskit/link-provider");
16
16
  var _menu = require("@atlaskit/menu");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
18
  var _doc = require("../pm-plugins/doc");
18
19
  var _DatasourceDropdownOption = require("./DatasourceDropdownOption");
19
20
  var _LinkToolbarAppearance = require("./LinkToolbarAppearance");
@@ -30,8 +31,6 @@ var LinkAppearanceMenu = exports.LinkAppearanceMenu = function LinkAppearanceMen
30
31
  allowBlockCards = _ref$allowBlockCards === void 0 ? true : _ref$allowBlockCards,
31
32
  allowDatasource = _ref.allowDatasource,
32
33
  editorAnalyticsApi = _ref.editorAnalyticsApi,
33
- _ref$showUpgradeDisco = _ref.showUpgradeDiscoverability,
34
- showUpgradeDiscoverability = _ref$showUpgradeDisco === void 0 ? true : _ref$showUpgradeDisco,
35
34
  isDatasourceView = _ref.isDatasourceView,
36
35
  dispatchCommand = _ref.dispatchCommand,
37
36
  settingsConfig = _ref.settingsConfig;
@@ -57,7 +56,8 @@ var LinkAppearanceMenu = exports.LinkAppearanceMenu = function LinkAppearanceMen
57
56
  hidden: false,
58
57
  testId: 'embed-appearance',
59
58
  disabled: !isEmbedCardLinkSupportedInParent,
60
- tooltip: isEmbedCardLinkSupportedInParent ? undefined : (0, _LinkToolbarAppearance.getUnavailableMessage)(editorState, intl)
59
+ tooltip: isEmbedCardLinkSupportedInParent ? undefined : (0, _LinkToolbarAppearance.getUnavailableMessage)(editorState, intl),
60
+ description: (0, _expValEquals.expValEquals)('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? intl.formatMessage(_messages.cardMessages.embedToBlockCardWarning) : undefined
61
61
  };
62
62
  var blockCardOption = allowBlockCards && {
63
63
  appearance: 'block',
@@ -109,7 +109,9 @@ var LinkAppearanceMenu = exports.LinkAppearanceMenu = function LinkAppearanceMen
109
109
  onClick: function onClick() {
110
110
  return option.onClick();
111
111
  },
112
- isSelected: option.selected
112
+ isSelected: option.selected,
113
+ description: option.description,
114
+ shouldDescriptionWrap: true
113
115
  }, option.title);
114
116
  }), /*#__PURE__*/_react.default.createElement(_DatasourceDropdownOption.DatasourceDropdownOption, {
115
117
  allowDatasource: allowDatasource,
@@ -6,6 +6,7 @@ import { isSupportedInParent } from '@atlaskit/editor-common/utils';
6
6
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
7
7
  import { useSmartCardContext } from '@atlaskit/link-provider';
8
8
  import { ButtonItem, LinkItem, MenuGroup, Section } from '@atlaskit/menu';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
10
11
  import { DatasourceDropdownOption, datasourceDisplayInformation } from './DatasourceDropdownOption';
11
12
  import { getUnavailableMessage } from './LinkToolbarAppearance';
@@ -18,7 +19,6 @@ export const LinkAppearanceMenu = ({
18
19
  allowBlockCards = true,
19
20
  allowDatasource,
20
21
  editorAnalyticsApi,
21
- showUpgradeDiscoverability = true,
22
22
  isDatasourceView,
23
23
  dispatchCommand,
24
24
  settingsConfig
@@ -44,7 +44,8 @@ export const LinkAppearanceMenu = ({
44
44
  hidden: false,
45
45
  testId: 'embed-appearance',
46
46
  disabled: !isEmbedCardLinkSupportedInParent,
47
- tooltip: isEmbedCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
47
+ tooltip: isEmbedCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl),
48
+ description: expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? intl.formatMessage(messages.embedToBlockCardWarning) : undefined
48
49
  };
49
50
  const blockCardOption = allowBlockCards && {
50
51
  appearance: 'block',
@@ -93,7 +94,9 @@ export const LinkAppearanceMenu = ({
93
94
  key: option.title,
94
95
  iconBefore: option.icon,
95
96
  onClick: () => option.onClick(),
96
- isSelected: option.selected
97
+ isSelected: option.selected,
98
+ description: option.description,
99
+ shouldDescriptionWrap: true
97
100
  }, option.title);
98
101
  }), /*#__PURE__*/React.createElement(DatasourceDropdownOption, {
99
102
  allowDatasource: allowDatasource,
@@ -9,6 +9,7 @@ import { isSupportedInParent } from '@atlaskit/editor-common/utils';
9
9
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
10
10
  import { useSmartCardContext } from '@atlaskit/link-provider';
11
11
  import { ButtonItem, LinkItem, MenuGroup, Section } from '@atlaskit/menu';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
  import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
13
14
  import { DatasourceDropdownOption, datasourceDisplayInformation } from './DatasourceDropdownOption';
14
15
  import { getUnavailableMessage } from './LinkToolbarAppearance';
@@ -23,8 +24,6 @@ export var LinkAppearanceMenu = function LinkAppearanceMenu(_ref) {
23
24
  allowBlockCards = _ref$allowBlockCards === void 0 ? true : _ref$allowBlockCards,
24
25
  allowDatasource = _ref.allowDatasource,
25
26
  editorAnalyticsApi = _ref.editorAnalyticsApi,
26
- _ref$showUpgradeDisco = _ref.showUpgradeDiscoverability,
27
- showUpgradeDiscoverability = _ref$showUpgradeDisco === void 0 ? true : _ref$showUpgradeDisco,
28
27
  isDatasourceView = _ref.isDatasourceView,
29
28
  dispatchCommand = _ref.dispatchCommand,
30
29
  settingsConfig = _ref.settingsConfig;
@@ -50,7 +49,8 @@ export var LinkAppearanceMenu = function LinkAppearanceMenu(_ref) {
50
49
  hidden: false,
51
50
  testId: 'embed-appearance',
52
51
  disabled: !isEmbedCardLinkSupportedInParent,
53
- tooltip: isEmbedCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl)
52
+ tooltip: isEmbedCardLinkSupportedInParent ? undefined : getUnavailableMessage(editorState, intl),
53
+ description: expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? intl.formatMessage(messages.embedToBlockCardWarning) : undefined
54
54
  };
55
55
  var blockCardOption = allowBlockCards && {
56
56
  appearance: 'block',
@@ -102,7 +102,9 @@ export var LinkAppearanceMenu = function LinkAppearanceMenu(_ref) {
102
102
  onClick: function onClick() {
103
103
  return option.onClick();
104
104
  },
105
- isSelected: option.selected
105
+ isSelected: option.selected,
106
+ description: option.description,
107
+ shouldDescriptionWrap: true
106
108
  }, option.title);
107
109
  }), /*#__PURE__*/React.createElement(DatasourceDropdownOption, {
108
110
  allowDatasource: allowDatasource,
@@ -6,7 +6,7 @@ type Props = LinkToolbarAppearanceProps & {
6
6
  settingsConfig: FloatingToolbarItem<Command>;
7
7
  allowDatasource?: boolean;
8
8
  };
9
- export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
9
+ export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
10
10
  export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
11
11
  settingsConfig: FloatingToolbarItem<Command>;
12
12
  allowDatasource?: boolean | undefined;
@@ -6,7 +6,7 @@ type Props = LinkToolbarAppearanceProps & {
6
6
  settingsConfig: FloatingToolbarItem<Command>;
7
7
  allowDatasource?: boolean;
8
8
  };
9
- export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
9
+ export declare const LinkAppearanceMenu: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, isDatasourceView, dispatchCommand, settingsConfig, }: Props) => React.JSX.Element | null;
10
10
  export declare const getLinkAppearanceDropdown: ({ url, intl, currentAppearance, editorState, allowEmbeds, allowBlockCards, allowDatasource, editorAnalyticsApi, showUpgradeDiscoverability, isDatasourceView, settingsConfig, }: LinkToolbarAppearanceProps & {
11
11
  settingsConfig: FloatingToolbarItem<Command>;
12
12
  allowDatasource?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "7.2.1",
3
+ "version": "7.2.2",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",