@atlaskit/editor-plugin-card 12.0.2 → 12.1.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,23 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 12.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`77df724ec737e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/77df724ec737e) -
14
+ [https://product-fabric.atlassian.net/browse/ED-28631](ED-28631) - cleanup the
15
+ platform_editor_smart_card_otp Statsig experiment
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 12.0.2
4
22
 
5
23
  ### Patch Changes
@@ -118,7 +118,7 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
118
118
  var _node$attrs = node.attrs,
119
119
  url = _node$attrs.url,
120
120
  data = _node$attrs.data;
121
- var cardInner = (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
121
+ var cardInner = isPageSSRed ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
122
122
  key: url,
123
123
  url: url !== null && url !== void 0 ? url : data.url,
124
124
  container: this.scrollContainer,
@@ -349,7 +349,7 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
349
349
  pctWidth: pctWidth,
350
350
  fullWidthMode: fullWidthMode
351
351
  };
352
- var smartCard = (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
352
+ var smartCard = isPageSSRed ? /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
353
353
  key: url,
354
354
  url: url,
355
355
  appearance: "embed",
@@ -18,7 +18,6 @@ var _ui = require("@atlaskit/editor-common/ui");
18
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
19
  var _smartCard = require("@atlaskit/smart-card");
20
20
  var _ssr = require("@atlaskit/smart-card/ssr");
21
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
21
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
23
22
  var _actions = require("../pm-plugins/actions");
24
23
  var _utils = require("../pm-plugins/utils");
@@ -41,7 +40,6 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
41
40
  showHoverPreview = _ref.showHoverPreview,
42
41
  hoverPreviewOptions = _ref.hoverPreviewOptions,
43
42
  isPageSSRed = _ref.isPageSSRed,
44
- provider = _ref.provider,
45
43
  pluginInjectionApi = _ref.pluginInjectionApi,
46
44
  disablePreviewPanel = _ref.disablePreviewPanel;
47
45
  var _node$attrs = node.attrs,
@@ -128,10 +126,8 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
128
126
  isHovered: isHovered,
129
127
  showHoverPreview: showHoverPreview,
130
128
  hoverPreviewOptions: hoverPreviewOptions,
131
- disablePreviewPanel: disablePreviewPanel
132
- // Durin `platform_editor_smart_card_otp` cleaning up, replace this with `true`.
133
- ,
134
- hideIconLoadingSkeleton: (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)
129
+ disablePreviewPanel: disablePreviewPanel,
130
+ hideIconLoadingSkeleton: true
135
131
  });
136
132
  }
137
133
  return /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
@@ -7,13 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.lazyBlockCardView = void 0;
8
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
10
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
10
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
11
  var _blockCard = require("./blockCard");
13
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
13
  var lazyBlockCardView = exports.lazyBlockCardView = function lazyBlockCardView(props) {
15
14
  var isPageSSRed = props.isPageSSRed;
16
- if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed && (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)) {
15
+ if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
17
16
  return (0, _blockCard.blockCardNodeView)(props);
18
17
  }
19
18
  return (0, _lazyNodeView.withLazyLoading)({
@@ -7,13 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.lazyEmbedCardView = void 0;
8
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
10
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
11
10
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
11
  var _embedCard = require("./embedCard");
13
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
13
  var lazyEmbedCardView = exports.lazyEmbedCardView = function lazyEmbedCardView(props) {
15
14
  var isPageSSRed = props.isPageSSRed;
16
- if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed && (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)) {
15
+ if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
17
16
  return (0, _embedCard.embedCardNodeView)(props);
18
17
  }
19
18
  return (0, _lazyNodeView.withLazyLoading)({
@@ -136,7 +136,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
136
136
  var maxOverlayWidth = (0, _react.useRef)(0);
137
137
  var minOverlayWidth = (0, _react.useRef)(ESTIMATED_MIN_WIDTH_IN_PX);
138
138
  var parentWidth = (0, _react.useRef)(0);
139
- var iconSize = (0, _react.useRef)('small');
140
139
  var containerRef = (0, _react.useRef)(null);
141
140
  var setVisibility = (0, _react.useCallback)(function () {
142
141
  if (!containerRef.current || !maxOverlayWidth.current) {
@@ -186,7 +185,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
186
185
  min = _getOverlayWidths.min;
187
186
  maxOverlayWidth.current = max;
188
187
  minOverlayWidth.current = min;
189
- iconSize.current = (0, _utils.getIconSize)(_label);
190
188
  }
191
189
  }
192
190
  if (isVisible) {
@@ -259,7 +257,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
259
257
  css: iconStyles
260
258
  }, (0, _react2.jsx)(_customize.default, {
261
259
  label: label,
262
- LEGACY_size: iconSize.current,
263
260
  testId: "".concat(testId, "-icon")
264
261
  })), showLabel && (0, _react2.jsx)("span", {
265
262
  css: labelStyles
@@ -12,13 +12,13 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _adfSchema = require("@atlaskit/adf-schema");
13
13
  var _analytics = require("@atlaskit/editor-common/analytics");
14
14
  var _card = require("@atlaskit/editor-common/card");
15
- var _link = require("@atlaskit/editor-common/link");
15
+ var _link2 = require("@atlaskit/editor-common/link");
16
16
  var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
17
17
  var _styles = require("@atlaskit/editor-common/styles");
18
18
  var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
19
19
  var _utils = require("@atlaskit/editor-common/utils");
20
20
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
21
- var _state = require("@atlaskit/editor-prosemirror/state");
21
+ var _state2 = require("@atlaskit/editor-prosemirror/state");
22
22
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
24
  var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
@@ -27,7 +27,6 @@ var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
27
27
  var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
28
28
  var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
29
29
  var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
30
- var _comment2 = _interopRequireDefault(require("@atlaskit/icon/core/migration/comment"));
31
30
  var _settings = _interopRequireDefault(require("@atlaskit/icon/core/settings"));
32
31
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
33
32
  var _doc = require("../pm-plugins/doc");
@@ -47,7 +46,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
47
46
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
48
47
  var removeCard = exports.removeCard = function removeCard(editorAnalyticsApi) {
49
48
  return (0, _card.commandWithMetadata)(function (state, dispatch) {
50
- if (!(state.selection instanceof _state.NodeSelection)) {
49
+ if (!(state.selection instanceof _state2.NodeSelection)) {
51
50
  return false;
52
51
  }
53
52
  var type = state.selection.node.type.name;
@@ -74,7 +73,7 @@ var removeCard = exports.removeCard = function removeCard(editorAnalyticsApi) {
74
73
  };
75
74
  var visitCardLinkAnalytics = exports.visitCardLinkAnalytics = function visitCardLinkAnalytics(editorAnalyticsApi, inputMethod) {
76
75
  return function (state, dispatch) {
77
- if (!(state.selection instanceof _state.NodeSelection)) {
76
+ if (!(state.selection instanceof _state2.NodeSelection)) {
78
77
  return false;
79
78
  }
80
79
  var type = state.selection.node.type;
@@ -88,7 +87,7 @@ var visitCardLinkAnalytics = exports.visitCardLinkAnalytics = function visitCard
88
87
  };
89
88
  var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
90
89
  return function (state, dispatch) {
91
- if (!(state.selection instanceof _state.NodeSelection)) {
90
+ if (!(state.selection instanceof _state2.NodeSelection)) {
92
91
  return false;
93
92
  }
94
93
  if (dispatch) {
@@ -111,7 +110,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(cardOpt
111
110
  embedCard = _state$schema$nodes.embedCard;
112
111
  var nodeType = [inlineCard, blockCard, embedCard];
113
112
  var pluginState = _pluginKey.pluginKey.getState(state);
114
- if (!(state.selection instanceof _state.NodeSelection)) {
113
+ if (!(state.selection instanceof _state2.NodeSelection)) {
115
114
  return;
116
115
  }
117
116
  var selectedNode = state.selection.node;
@@ -296,7 +295,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
296
295
  type: 'button',
297
296
  icon: _comment.default,
298
297
  testId: 'inline-card-toolbar-comment-button',
299
- iconFallback: _comment2.default,
298
+ iconFallback: _comment.default,
300
299
  title: intl.formatMessage(_messages.annotationMessages.createComment),
301
300
  showTitle: (0, _experiments.editorExperiment)('platform_editor_controls', 'control') ? undefined : true,
302
301
  onClick: onCommentButtonClick,
@@ -530,7 +529,7 @@ var getSettingsButton = exports.getSettingsButton = function getSettingsButton(i
530
529
  iconFallback: _settings.default,
531
530
  title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
532
531
  onClick: openLinkSettings(editorAnalyticsApi),
533
- href: userPreferencesLink || (0, _link.getLinkPreferencesURLFromENV)(),
532
+ href: userPreferencesLink || (0, _link2.getLinkPreferencesURLFromENV)(),
534
533
  target: '_blank'
535
534
  };
536
535
  };
@@ -732,7 +731,7 @@ var shouldRenderToolbarPulse = exports.shouldRenderToolbarPulse = function shoul
732
731
  return embedEnabled && appearance === 'inline' && status === 'resolved' && isDiscoverabilityEnabled;
733
732
  };
734
733
  var getStartingToolbarItems = exports.getStartingToolbarItems = function getStartingToolbarItems(options, api) {
735
- return function (intl, link, onEditLink, metadata, state) {
734
+ return function (intl, link, onEditLink, metadata, _state) {
736
735
  var areAllNewToolbarFlagsDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
737
736
  var editLinkItem = options.allowDatasource ? [{
738
737
  type: 'custom',
@@ -824,7 +823,7 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
824
823
  };
825
824
  };
826
825
  var getEndingToolbarItems = exports.getEndingToolbarItems = function getEndingToolbarItems(options, api) {
827
- return function (intl, link) {
826
+ return function (intl, _link) {
828
827
  /**
829
828
  * Require either provider to be supplied (controls link preferences)
830
829
  * Or explicit user preferences config in order to enable button
@@ -102,7 +102,7 @@ export class BlockCardComponent extends React.PureComponent {
102
102
  url,
103
103
  data
104
104
  } = node.attrs;
105
- const cardInner = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSSR, {
105
+ const cardInner = isPageSSRed ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSSR, {
106
106
  key: url,
107
107
  url: url !== null && url !== void 0 ? url : data.url,
108
108
  container: this.scrollContainer,
@@ -341,7 +341,7 @@ export class EmbedCardComponent extends React.PureComponent {
341
341
  pctWidth,
342
342
  fullWidthMode
343
343
  };
344
- const smartCard = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/React.createElement(CardSSR, {
344
+ const smartCard = isPageSSRed ? /*#__PURE__*/React.createElement(CardSSR, {
345
345
  key: url,
346
346
  url: url,
347
347
  appearance: "embed",
@@ -9,7 +9,6 @@ import { UnsupportedInline, findOverflowScrollParent } from '@atlaskit/editor-co
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { Card as SmartCard } from '@atlaskit/smart-card';
11
11
  import { CardSSR } from '@atlaskit/smart-card/ssr';
12
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
13
  import { registerCard, removeCard } from '../pm-plugins/actions';
15
14
  import { getAwarenessProps } from '../pm-plugins/utils';
@@ -29,7 +28,6 @@ export const InlineCard = /*#__PURE__*/memo(({
29
28
  showHoverPreview,
30
29
  hoverPreviewOptions,
31
30
  isPageSSRed,
32
- provider,
33
31
  pluginInjectionApi,
34
32
  disablePreviewPanel
35
33
  }) => {
@@ -123,10 +121,8 @@ export const InlineCard = /*#__PURE__*/memo(({
123
121
  isHovered: isHovered,
124
122
  showHoverPreview: showHoverPreview,
125
123
  hoverPreviewOptions: hoverPreviewOptions,
126
- disablePreviewPanel: disablePreviewPanel
127
- // Durin `platform_editor_smart_card_otp` cleaning up, replace this with `true`.
128
- ,
129
- hideIconLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)
124
+ disablePreviewPanel: disablePreviewPanel,
125
+ hideIconLoadingSkeleton: true
130
126
  });
131
127
  }
132
128
  return /*#__PURE__*/React.createElement(SmartCard, {
@@ -1,12 +1,11 @@
1
1
  import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { blockCardNodeView } from './blockCard';
5
4
  export const lazyBlockCardView = props => {
6
5
  const {
7
6
  isPageSSRed
8
7
  } = props;
9
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
8
+ if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
10
9
  return blockCardNodeView(props);
11
10
  }
12
11
  return withLazyLoading({
@@ -1,12 +1,11 @@
1
1
  import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { embedCardNodeView } from './embedCard';
5
4
  export const lazyEmbedCardView = props => {
6
5
  const {
7
6
  isPageSSRed
8
7
  } = props;
9
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
8
+ if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
10
9
  return embedCardNodeView(props);
11
10
  }
12
11
  return withLazyLoading({
@@ -15,7 +15,7 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
15
15
  import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
16
16
  import CustomizeIcon from '@atlaskit/icon/core/customize';
17
17
  import { B100, N0, N700 } from '@atlaskit/theme/colors';
18
- import { getChildElement, getIconSize, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
18
+ import { getChildElement, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
19
19
  const DEBOUNCE_IN_MS = 5;
20
20
  const ESTIMATED_MIN_WIDTH_IN_PX = 16;
21
21
  const PADDING_IN_PX = 4;
@@ -118,7 +118,6 @@ const InlineCardOverlay = ({
118
118
  const maxOverlayWidth = useRef(0);
119
119
  const minOverlayWidth = useRef(ESTIMATED_MIN_WIDTH_IN_PX);
120
120
  const parentWidth = useRef(0);
121
- const iconSize = useRef('small');
122
121
  const containerRef = useRef(null);
123
122
  const setVisibility = useCallback(() => {
124
123
  if (!containerRef.current || !maxOverlayWidth.current) {
@@ -169,7 +168,6 @@ const InlineCardOverlay = ({
169
168
  } = getOverlayWidths(iconAndLabel, label);
170
169
  maxOverlayWidth.current = max;
171
170
  minOverlayWidth.current = min;
172
- iconSize.current = getIconSize(label);
173
171
  }
174
172
  }
175
173
  if (isVisible) {
@@ -240,7 +238,6 @@ const InlineCardOverlay = ({
240
238
  css: iconStyles
241
239
  }, jsx(CustomizeIcon, {
242
240
  label: label,
243
- LEGACY_size: iconSize.current,
244
241
  testId: `${testId}-icon`
245
242
  })), showLabel && jsx("span", {
246
243
  css: labelStyles
@@ -17,7 +17,6 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
17
17
  import EditIcon from '@atlaskit/icon/core/edit';
18
18
  import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
19
19
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
20
- import LegacyCommentIcon from '@atlaskit/icon/core/migration/comment';
21
20
  import CogIcon from '@atlaskit/icon/core/settings';
22
21
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
22
  import { changeSelectedCardToText } from '../pm-plugins/doc';
@@ -288,7 +287,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
288
287
  type: 'button',
289
288
  icon: CommentIcon,
290
289
  testId: 'inline-card-toolbar-comment-button',
291
- iconFallback: LegacyCommentIcon,
290
+ iconFallback: CommentIcon,
292
291
  title: intl.formatMessage(annotationMessages.createComment),
293
292
  showTitle: editorExperiment('platform_editor_controls', 'control') ? undefined : true,
294
293
  onClick: onCommentButtonClick,
@@ -717,7 +716,7 @@ export const shouldRenderToolbarPulse = (embedEnabled, appearance, status, isDis
717
716
  return embedEnabled && appearance === 'inline' && status === 'resolved' && isDiscoverabilityEnabled;
718
717
  };
719
718
  export const getStartingToolbarItems = (options, api) => {
720
- return (intl, link, onEditLink, metadata, state) => {
719
+ return (intl, link, onEditLink, metadata, _state) => {
721
720
  const areAllNewToolbarFlagsDisabled = !areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
722
721
  const editLinkItem = options.allowDatasource ? [{
723
722
  type: 'custom',
@@ -804,7 +803,7 @@ export const getStartingToolbarItems = (options, api) => {
804
803
  }, ...editLinkItem];
805
804
  };
806
805
  };
807
- export const getEndingToolbarItems = (options, api) => (intl, link) => {
806
+ export const getEndingToolbarItems = (options, api) => (intl, _link) => {
808
807
  /**
809
808
  * Require either provider to be supplied (controls link preferences)
810
809
  * Or explicit user preferences config in order to enable button
@@ -113,7 +113,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
113
113
  var _node$attrs = node.attrs,
114
114
  url = _node$attrs.url,
115
115
  data = _node$attrs.data;
116
- var cardInner = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSSR, {
116
+ var cardInner = isPageSSRed ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSSR, {
117
117
  key: url,
118
118
  url: url !== null && url !== void 0 ? url : data.url,
119
119
  container: this.scrollContainer,
@@ -343,7 +343,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
343
343
  pctWidth: pctWidth,
344
344
  fullWidthMode: fullWidthMode
345
345
  };
346
- var smartCard = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/React.createElement(CardSSR, {
346
+ var smartCard = isPageSSRed ? /*#__PURE__*/React.createElement(CardSSR, {
347
347
  key: url,
348
348
  url: url,
349
349
  appearance: "embed",
@@ -9,7 +9,6 @@ import { UnsupportedInline, findOverflowScrollParent } from '@atlaskit/editor-co
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { Card as SmartCard } from '@atlaskit/smart-card';
11
11
  import { CardSSR } from '@atlaskit/smart-card/ssr';
12
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
13
  import { registerCard, removeCard } from '../pm-plugins/actions';
15
14
  import { getAwarenessProps } from '../pm-plugins/utils';
@@ -29,7 +28,6 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
29
28
  showHoverPreview = _ref.showHoverPreview,
30
29
  hoverPreviewOptions = _ref.hoverPreviewOptions,
31
30
  isPageSSRed = _ref.isPageSSRed,
32
- provider = _ref.provider,
33
31
  pluginInjectionApi = _ref.pluginInjectionApi,
34
32
  disablePreviewPanel = _ref.disablePreviewPanel;
35
33
  var _node$attrs = node.attrs,
@@ -116,10 +114,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
116
114
  isHovered: isHovered,
117
115
  showHoverPreview: showHoverPreview,
118
116
  hoverPreviewOptions: hoverPreviewOptions,
119
- disablePreviewPanel: disablePreviewPanel
120
- // Durin `platform_editor_smart_card_otp` cleaning up, replace this with `true`.
121
- ,
122
- hideIconLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)
117
+ disablePreviewPanel: disablePreviewPanel,
118
+ hideIconLoadingSkeleton: true
123
119
  });
124
120
  }
125
121
  return /*#__PURE__*/React.createElement(SmartCard, {
@@ -1,10 +1,9 @@
1
1
  import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { blockCardNodeView } from './blockCard';
5
4
  export var lazyBlockCardView = function lazyBlockCardView(props) {
6
5
  var isPageSSRed = props.isPageSSRed;
7
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
6
+ if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
8
7
  return blockCardNodeView(props);
9
8
  }
10
9
  return withLazyLoading({
@@ -1,10 +1,9 @@
1
1
  import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { embedCardNodeView } from './embedCard';
5
4
  export var lazyEmbedCardView = function lazyEmbedCardView(props) {
6
5
  var isPageSSRed = props.isPageSSRed;
7
- if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed && expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
6
+ if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
8
7
  return embedCardNodeView(props);
9
8
  }
10
9
  return withLazyLoading({
@@ -19,7 +19,7 @@ import { cardMessages as messages } from '@atlaskit/editor-common/messages';
19
19
  import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
20
20
  import CustomizeIcon from '@atlaskit/icon/core/customize';
21
21
  import { B100, N0, N700 } from '@atlaskit/theme/colors';
22
- import { getChildElement, getIconSize, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
22
+ import { getChildElement, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
23
23
  var DEBOUNCE_IN_MS = 5;
24
24
  var ESTIMATED_MIN_WIDTH_IN_PX = 16;
25
25
  var PADDING_IN_PX = 4;
@@ -128,7 +128,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
128
128
  var maxOverlayWidth = useRef(0);
129
129
  var minOverlayWidth = useRef(ESTIMATED_MIN_WIDTH_IN_PX);
130
130
  var parentWidth = useRef(0);
131
- var iconSize = useRef('small');
132
131
  var containerRef = useRef(null);
133
132
  var setVisibility = useCallback(function () {
134
133
  if (!containerRef.current || !maxOverlayWidth.current) {
@@ -178,7 +177,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
178
177
  min = _getOverlayWidths.min;
179
178
  maxOverlayWidth.current = max;
180
179
  minOverlayWidth.current = min;
181
- iconSize.current = getIconSize(_label);
182
180
  }
183
181
  }
184
182
  if (isVisible) {
@@ -251,7 +249,6 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
251
249
  css: iconStyles
252
250
  }, jsx(CustomizeIcon, {
253
251
  label: label,
254
- LEGACY_size: iconSize.current,
255
252
  testId: "".concat(testId, "-icon")
256
253
  })), showLabel && jsx("span", {
257
254
  css: labelStyles
@@ -21,7 +21,6 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
21
21
  import EditIcon from '@atlaskit/icon/core/edit';
22
22
  import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
23
23
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
24
- import LegacyCommentIcon from '@atlaskit/icon/core/migration/comment';
25
24
  import CogIcon from '@atlaskit/icon/core/settings';
26
25
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
27
26
  import { changeSelectedCardToText } from '../pm-plugins/doc';
@@ -287,7 +286,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
287
286
  type: 'button',
288
287
  icon: CommentIcon,
289
288
  testId: 'inline-card-toolbar-comment-button',
290
- iconFallback: LegacyCommentIcon,
289
+ iconFallback: CommentIcon,
291
290
  title: intl.formatMessage(annotationMessages.createComment),
292
291
  showTitle: editorExperiment('platform_editor_controls', 'control') ? undefined : true,
293
292
  onClick: onCommentButtonClick,
@@ -723,7 +722,7 @@ export var shouldRenderToolbarPulse = function shouldRenderToolbarPulse(embedEna
723
722
  return embedEnabled && appearance === 'inline' && status === 'resolved' && isDiscoverabilityEnabled;
724
723
  };
725
724
  export var getStartingToolbarItems = function getStartingToolbarItems(options, api) {
726
- return function (intl, link, onEditLink, metadata, state) {
725
+ return function (intl, link, onEditLink, metadata, _state) {
727
726
  var areAllNewToolbarFlagsDisabled = !areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
728
727
  var editLinkItem = options.allowDatasource ? [{
729
728
  type: 'custom',
@@ -815,7 +814,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
815
814
  };
816
815
  };
817
816
  export var getEndingToolbarItems = function getEndingToolbarItems(options, api) {
818
- return function (intl, link) {
817
+ return function (intl, _link) {
819
818
  /**
820
819
  * Require either provider to be supplied (controls link preferences)
821
820
  * Or explicit user preferences config in order to enable button
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { SmartCardProps } from './genericCard';
6
6
  import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
7
- export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick: propsOnClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, provider, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
7
+ export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick: propsOnClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
8
8
  export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt' | 'provider'>;
9
9
  /**
10
10
  *
@@ -15,5 +15,5 @@ export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearanc
15
15
  export declare const getStartingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string, onEditLink: Command, metadata: {
16
16
  title: string;
17
17
  url: string;
18
- }, state?: EditorState) => FloatingToolbarItem<Command>[];
19
- export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string) => FloatingToolbarItem<Command>[];
18
+ }, _state?: EditorState) => FloatingToolbarItem<Command>[];
19
+ export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, _link: string) => FloatingToolbarItem<Command>[];
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { SmartCardProps } from './genericCard';
6
6
  import { type InlineCardWithAwarenessProps } from './inlineCardWithAwareness';
7
- export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick: propsOnClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, provider, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
7
+ export declare const InlineCard: React.MemoExoticComponent<({ node, cardContext, actionOptions, useAlternativePreloader, view, getPos, onClick: propsOnClick, onResolve: onRes, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, pluginInjectionApi, disablePreviewPanel, }: SmartCardProps) => React.JSX.Element | null>;
8
8
  export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'actionOptions' | 'allowEmbeds' | 'allowBlockCards' | 'enableInlineUpgradeFeatures' | 'pluginInjectionApi' | 'onClickCallback' | 'isPageSSRed' | 'CompetitorPrompt' | 'provider'>;
9
9
  /**
10
10
  *
@@ -15,5 +15,5 @@ export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearanc
15
15
  export declare const getStartingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string, onEditLink: Command, metadata: {
16
16
  title: string;
17
17
  url: string;
18
- }, state?: EditorState) => FloatingToolbarItem<Command>[];
19
- export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, link: string) => FloatingToolbarItem<Command>[];
18
+ }, _state?: EditorState) => FloatingToolbarItem<Command>[];
19
+ export declare const getEndingToolbarItems: (options: CardPluginOptions, api?: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (intl: IntlShape, _link: string) => FloatingToolbarItem<Command>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "12.0.2",
3
+ "version": "12.1.1",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,30 +39,30 @@
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^7.0.0",
40
40
  "@atlaskit/editor-plugin-editor-viewmode": "^9.0.0",
41
41
  "@atlaskit/editor-plugin-feature-flags": "^6.0.0",
42
- "@atlaskit/editor-plugin-floating-toolbar": "^9.0.0",
42
+ "@atlaskit/editor-plugin-floating-toolbar": "^9.1.0",
43
43
  "@atlaskit/editor-plugin-grid": "^7.0.0",
44
44
  "@atlaskit/editor-plugin-toolbar": "^4.0.0",
45
45
  "@atlaskit/editor-plugin-width": "^8.0.0",
46
46
  "@atlaskit/editor-prosemirror": "^7.2.0",
47
47
  "@atlaskit/editor-shared-styles": "^3.10.0",
48
48
  "@atlaskit/frontend-utilities": "^3.2.0",
49
- "@atlaskit/icon": "^29.3.0",
50
- "@atlaskit/link": "^3.2.0",
49
+ "@atlaskit/icon": "^29.4.0",
50
+ "@atlaskit/link": "^3.3.0",
51
51
  "@atlaskit/link-analytics": "^11.0.0",
52
52
  "@atlaskit/link-client-extension": "^6.0.0",
53
- "@atlaskit/link-datasource": "^4.30.0",
53
+ "@atlaskit/link-datasource": "^4.32.0",
54
54
  "@atlaskit/link-extractors": "^2.4.0",
55
55
  "@atlaskit/linking-common": "^9.9.0",
56
56
  "@atlaskit/linking-types": "^14.2.0",
57
57
  "@atlaskit/menu": "^8.4.0",
58
58
  "@atlaskit/platform-feature-flags": "^1.1.0",
59
59
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
60
- "@atlaskit/primitives": "^17.0.0",
60
+ "@atlaskit/primitives": "^17.1.0",
61
61
  "@atlaskit/prosemirror-history": "^0.2.0",
62
- "@atlaskit/smart-card": "^43.17.0",
62
+ "@atlaskit/smart-card": "^43.20.0",
63
63
  "@atlaskit/theme": "^21.0.0",
64
- "@atlaskit/tmp-editor-statsig": "^16.3.0",
65
- "@atlaskit/tokens": "^9.0.0",
64
+ "@atlaskit/tmp-editor-statsig": "^16.23.0",
65
+ "@atlaskit/tokens": "^10.0.0",
66
66
  "@babel/runtime": "^7.0.0",
67
67
  "@emotion/react": "^11.7.1",
68
68
  "lodash": "^4.17.21",
@@ -71,8 +71,8 @@
71
71
  "uuid": "^3.1.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^111.0.0",
75
- "@atlaskit/link-provider": "^4.0.0",
74
+ "@atlaskit/editor-common": "^111.8.0",
75
+ "@atlaskit/link-provider": "^4.1.0",
76
76
  "react": "^18.2.0",
77
77
  "react-intl-next": "npm:react-intl@^5.18.1"
78
78
  },