@atlaskit/editor-plugin-card 0.14.22 → 0.14.24

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,18 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 0.14.24
4
+
5
+ ### Patch Changes
6
+
7
+ - [#63549](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63549) [`c2147cd56a94`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c2147cd56a94) - Fix inconsistency of discoverability pulse
8
+ - Updated dependencies
9
+
10
+ ## 0.14.23
11
+
12
+ ### Patch Changes
13
+
14
+ - [#63354](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63354) [`0b49755d1170`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0b49755d1170) - [ux] Include embed card frame as part of its width when frameStyle is set to "show" and show embed frame by default in renderer
15
+
3
16
  ## 0.14.22
4
17
 
5
18
  ### Patch Changes
@@ -304,7 +304,7 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
304
304
  onResolve: this.onResolve,
305
305
  onError: this.onError,
306
306
  showActions: platform === 'web',
307
- isFrameVisible: true,
307
+ frameStyle: "show",
308
308
  inheritDimensions: true,
309
309
  platform: platform,
310
310
  container: this.scrollContainer,
@@ -94,14 +94,16 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
94
94
  return (0, _react2.jsx)("span", {
95
95
  css: shouldShowLinkPulse && loaderWrapperStyles,
96
96
  className: "card"
97
- }, shouldShowLinkPulse ? (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
97
+ }, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
98
98
  data: {
99
99
  attributes: (0, _utils.getResolvedAttributesFromStore)(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
100
100
  }
101
101
  }, (0, _react2.jsx)(_Pulse.DiscoveryPulse, {
102
102
  localStorageKey: _localStorage.LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
103
103
  localStorageKeyExpirationInMs: _localStorage.ONE_DAY_IN_MILLISECONDS,
104
- discoveryMode: "start"
105
- }, cardWithOverlay)) : cardWithOverlay);
106
- }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, cardWithOverlay]);
104
+ discoveryMode: "start",
105
+ shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
106
+ testId: "link-discovery-pulse"
107
+ }, cardWithOverlay)));
108
+ }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay]);
107
109
  };
@@ -135,7 +135,8 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = /*#__PURE__*/functio
135
135
  attributes: _objectSpread({}, resolvedAnalyticsAttributes)
136
136
  }
137
137
  }, /*#__PURE__*/_react.default.createElement(_Pulse.DiscoveryPulse, {
138
- localStorageKey: _localStorage.LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR
138
+ localStorageKey: _localStorage.LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR,
139
+ testId: "toolbar-discovery-pulse"
139
140
  }, LinkToolbarButtons));
140
141
  }
141
142
  return LinkToolbarButtons;
@@ -14,15 +14,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
14
14
  var DiscoveryPulse = exports.DiscoveryPulse = function DiscoveryPulse(_ref) {
15
15
  var children = _ref.children,
16
16
  localStorageKey = _ref.localStorageKey,
17
- isDiscovered = _ref.isDiscovered,
18
17
  localStorageKeyExpirationInMs = _ref.localStorageKeyExpirationInMs,
19
18
  _ref$discoveryMode = _ref.discoveryMode,
20
- discoveryMode = _ref$discoveryMode === void 0 ? 'iteration' : _ref$discoveryMode;
21
- var discovered = isDiscovered || (0, _localStorage.isLocalStorageKeyDiscovered)(localStorageKey);
19
+ discoveryMode = _ref$discoveryMode === void 0 ? 'iteration' : _ref$discoveryMode,
20
+ shouldShowPulse = _ref.shouldShowPulse,
21
+ testId = _ref.testId;
22
+ var discovered = (0, _localStorage.isLocalStorageKeyDiscovered)(localStorageKey);
23
+ var showPulse = shouldShowPulse !== null && shouldShowPulse !== void 0 ? shouldShowPulse : !discovered;
22
24
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
23
25
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
24
26
  (0, _react.useEffect)(function () {
25
- if (!discovered) {
27
+ if (showPulse) {
26
28
  createAnalyticsEvent({
27
29
  action: 'viewed',
28
30
  actionSubject: 'pulse',
@@ -32,16 +34,16 @@ var DiscoveryPulse = exports.DiscoveryPulse = function DiscoveryPulse(_ref) {
32
34
  }
33
35
  }).fire('media');
34
36
  }
35
- }, [createAnalyticsEvent, discovered, localStorageKey]);
37
+ }, [createAnalyticsEvent, discovered, localStorageKey, showPulse]);
36
38
  var onDiscovery = (0, _react.useCallback)(function () {
37
39
  if (!discovered) {
38
40
  (0, _localStorage.markLocalStorageKeyDiscovered)(localStorageKey, localStorageKeyExpirationInMs);
39
41
  }
40
42
  }, [discovered, localStorageKey, localStorageKeyExpirationInMs]);
41
- var pulseProps = {
42
- onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
43
+ return /*#__PURE__*/_react.default.createElement(_linkingCommon.Pulse, {
43
44
  onAnimationIteration: discoveryMode === 'iteration' ? onDiscovery : undefined,
44
- isDiscovered: discovered
45
- };
46
- return /*#__PURE__*/_react.default.createElement(_linkingCommon.Pulse, pulseProps, children);
45
+ onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
46
+ showPulse: showPulse,
47
+ testId: testId
48
+ }, children);
47
49
  };
@@ -19,6 +19,7 @@ var _styles = require("@atlaskit/editor-common/styles");
19
19
  var _ui = require("@atlaskit/editor-common/ui");
20
20
  var _utils = require("@atlaskit/editor-prosemirror/utils");
21
21
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
23
  var _smartCard = require("@atlaskit/smart-card");
23
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
25
  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; }
@@ -332,7 +333,13 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
332
333
  containerWidth = _this$props6.containerWidth,
333
334
  fullWidthMode = _this$props6.fullWidthMode,
334
335
  children = _this$props6.children;
335
- var initialWidth = this.calcPxWidth() - _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide;
336
+ var resizerProps = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.show-embed-card-frame-renderer') ? {
337
+ width: this.calcPxWidth(),
338
+ innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPadding
339
+ } : {
340
+ width: this.calcPxWidth() - _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide,
341
+ innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide
342
+ };
336
343
  var enable = {};
337
344
  _ui.handleSides.forEach(function (side) {
338
345
  var oppositeSide = side === 'left' ? 'right' : 'left';
@@ -359,7 +366,7 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
359
366
 
360
367
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
361
368
  return (0, _react2.jsx)("div", {
362
- css: _styles.embedSpacingStyles,
369
+ css: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.show-embed-card-frame-renderer') ? {} : _styles.embedSpacingStyles,
363
370
  "data-testid": "resizable-embed-card-spacing"
364
371
  }, (0, _react2.jsx)("div", {
365
372
  css: (0, _ui.wrapperStyle)({
@@ -369,17 +376,14 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
369
376
  fullWidthMode: fullWidthMode
370
377
  })
371
378
  }, (0, _react2.jsx)(_ui.Resizer, (0, _extends2.default)({}, this.props, {
372
- width: initialWidth // Starting or initial width of embed <iframe> itself.
373
- ,
374
379
  enable: enable,
375
380
  calcNewSize: this.calcNewSize,
376
381
  snapPoints: this.calcSnapPoints(),
377
382
  scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
378
383
  highlights: this.highlights,
379
- innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide,
380
384
  nodeType: "embed",
381
385
  handleStyles: nestedInTableHandleStyles(this.isNestedInTable())
382
- }), children, this.getHeightDefiningComponent())));
386
+ }, resizerProps), children, this.getHeightDefiningComponent())));
383
387
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
384
388
  }
385
389
  }]);
@@ -293,7 +293,7 @@ export class EmbedCardComponent extends React.PureComponent {
293
293
  onResolve: this.onResolve,
294
294
  onError: this.onError,
295
295
  showActions: platform === 'web',
296
- isFrameVisible: true,
296
+ frameStyle: "show",
297
297
  inheritDimensions: true,
298
298
  platform: platform,
299
299
  container: this.scrollContainer,
@@ -78,14 +78,16 @@ export const AwarenessWrapper = ({
78
78
  return jsx("span", {
79
79
  css: shouldShowLinkPulse && loaderWrapperStyles,
80
80
  className: "card"
81
- }, shouldShowLinkPulse ? jsx(AnalyticsContext, {
81
+ }, jsx(AnalyticsContext, {
82
82
  data: {
83
83
  attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
84
84
  }
85
85
  }, jsx(DiscoveryPulse, {
86
86
  localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
87
87
  localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
88
- discoveryMode: "start"
89
- }, cardWithOverlay)) : cardWithOverlay);
90
- }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, cardWithOverlay]);
88
+ discoveryMode: "start",
89
+ shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
90
+ testId: "link-discovery-pulse"
91
+ }, cardWithOverlay)));
92
+ }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay]);
91
93
  };
@@ -106,7 +106,8 @@ export class LinkToolbarAppearance extends React.Component {
106
106
  }
107
107
  }
108
108
  }, /*#__PURE__*/React.createElement(DiscoveryPulse, {
109
- localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR
109
+ localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR,
110
+ testId: "toolbar-discovery-pulse"
110
111
  }, LinkToolbarButtons));
111
112
  }
112
113
  return LinkToolbarButtons;
@@ -5,16 +5,18 @@ import { isLocalStorageKeyDiscovered, markLocalStorageKeyDiscovered } from '../.
5
5
  export const DiscoveryPulse = ({
6
6
  children,
7
7
  localStorageKey,
8
- isDiscovered,
9
8
  localStorageKeyExpirationInMs,
10
- discoveryMode = 'iteration'
9
+ discoveryMode = 'iteration',
10
+ shouldShowPulse,
11
+ testId
11
12
  }) => {
12
- const discovered = isDiscovered || isLocalStorageKeyDiscovered(localStorageKey);
13
+ const discovered = isLocalStorageKeyDiscovered(localStorageKey);
14
+ const showPulse = shouldShowPulse !== null && shouldShowPulse !== void 0 ? shouldShowPulse : !discovered;
13
15
  const {
14
16
  createAnalyticsEvent
15
17
  } = useAnalyticsEvents();
16
18
  useEffect(() => {
17
- if (!discovered) {
19
+ if (showPulse) {
18
20
  createAnalyticsEvent({
19
21
  action: 'viewed',
20
22
  actionSubject: 'pulse',
@@ -24,16 +26,16 @@ export const DiscoveryPulse = ({
24
26
  }
25
27
  }).fire('media');
26
28
  }
27
- }, [createAnalyticsEvent, discovered, localStorageKey]);
29
+ }, [createAnalyticsEvent, discovered, localStorageKey, showPulse]);
28
30
  const onDiscovery = useCallback(() => {
29
31
  if (!discovered) {
30
32
  markLocalStorageKeyDiscovered(localStorageKey, localStorageKeyExpirationInMs);
31
33
  }
32
34
  }, [discovered, localStorageKey, localStorageKeyExpirationInMs]);
33
- const pulseProps = {
34
- onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
35
+ return /*#__PURE__*/React.createElement(Pulse, {
35
36
  onAnimationIteration: discoveryMode === 'iteration' ? onDiscovery : undefined,
36
- isDiscovered: discovered
37
- };
38
- return /*#__PURE__*/React.createElement(Pulse, pulseProps, children);
37
+ onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
38
+ showPulse: showPulse,
39
+ testId: testId
40
+ }, children);
39
41
  };
@@ -6,7 +6,8 @@ import { jsx } from '@emotion/react';
6
6
  import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
7
7
  import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
8
8
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
9
- import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
9
+ import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
10
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
11
  import { embedHeaderHeight } from '@atlaskit/smart-card';
11
12
  // eslint-disable-next-line @repo/internal/react/no-class-components
12
13
  export default class ResizableEmbedCard extends React.Component {
@@ -306,7 +307,13 @@ export default class ResizableEmbedCard extends React.Component {
306
307
  fullWidthMode,
307
308
  children
308
309
  } = this.props;
309
- const initialWidth = this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide;
310
+ const resizerProps = getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {
311
+ width: this.calcPxWidth(),
312
+ innerPadding: akEditorMediaResizeHandlerPadding
313
+ } : {
314
+ width: this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide,
315
+ innerPadding: akEditorMediaResizeHandlerPaddingWide
316
+ };
310
317
  const enable = {};
311
318
  handleSides.forEach(side => {
312
319
  const oppositeSide = side === 'left' ? 'right' : 'left';
@@ -333,7 +340,7 @@ export default class ResizableEmbedCard extends React.Component {
333
340
 
334
341
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
335
342
  return jsx("div", {
336
- css: embedSpacingStyles,
343
+ css: getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {} : embedSpacingStyles,
337
344
  "data-testid": "resizable-embed-card-spacing"
338
345
  }, jsx("div", {
339
346
  css: wrapperStyle({
@@ -343,17 +350,14 @@ export default class ResizableEmbedCard extends React.Component {
343
350
  fullWidthMode
344
351
  })
345
352
  }, jsx(Resizer, _extends({}, this.props, {
346
- width: initialWidth // Starting or initial width of embed <iframe> itself.
347
- ,
348
353
  enable: enable,
349
354
  calcNewSize: this.calcNewSize,
350
355
  snapPoints: this.calcSnapPoints(),
351
356
  scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
352
357
  highlights: this.highlights,
353
- innerPadding: akEditorMediaResizeHandlerPaddingWide,
354
358
  nodeType: "embed",
355
359
  handleStyles: nestedInTableHandleStyles(this.isNestedInTable())
356
- }), children, this.getHeightDefiningComponent())));
360
+ }, resizerProps), children, this.getHeightDefiningComponent())));
357
361
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
358
362
  }
359
363
  }
@@ -297,7 +297,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
297
297
  onResolve: this.onResolve,
298
298
  onError: this.onError,
299
299
  showActions: platform === 'web',
300
- isFrameVisible: true,
300
+ frameStyle: "show",
301
301
  inheritDimensions: true,
302
302
  platform: platform,
303
303
  container: this.scrollContainer,
@@ -86,14 +86,16 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
86
86
  return jsx("span", {
87
87
  css: shouldShowLinkPulse && loaderWrapperStyles,
88
88
  className: "card"
89
- }, shouldShowLinkPulse ? jsx(AnalyticsContext, {
89
+ }, jsx(AnalyticsContext, {
90
90
  data: {
91
91
  attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
92
92
  }
93
93
  }, jsx(DiscoveryPulse, {
94
94
  localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
95
95
  localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
96
- discoveryMode: "start"
97
- }, cardWithOverlay)) : cardWithOverlay);
98
- }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, cardWithOverlay]);
96
+ discoveryMode: "start",
97
+ shouldShowPulse: isResolvedViewRendered && shouldShowLinkPulse,
98
+ testId: "link-discovery-pulse"
99
+ }, cardWithOverlay)));
100
+ }, [shouldShowLinkPulse, url, cardContext === null || cardContext === void 0 || (_cardContext$value2 = cardContext.value) === null || _cardContext$value2 === void 0 ? void 0 : _cardContext$value2.store, isResolvedViewRendered, cardWithOverlay]);
99
101
  };
@@ -125,7 +125,8 @@ export var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
125
125
  attributes: _objectSpread({}, resolvedAnalyticsAttributes)
126
126
  }
127
127
  }, /*#__PURE__*/React.createElement(DiscoveryPulse, {
128
- localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR
128
+ localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR,
129
+ testId: "toolbar-discovery-pulse"
129
130
  }, LinkToolbarButtons));
130
131
  }
131
132
  return LinkToolbarButtons;
@@ -5,15 +5,17 @@ import { isLocalStorageKeyDiscovered, markLocalStorageKeyDiscovered } from '../.
5
5
  export var DiscoveryPulse = function DiscoveryPulse(_ref) {
6
6
  var children = _ref.children,
7
7
  localStorageKey = _ref.localStorageKey,
8
- isDiscovered = _ref.isDiscovered,
9
8
  localStorageKeyExpirationInMs = _ref.localStorageKeyExpirationInMs,
10
9
  _ref$discoveryMode = _ref.discoveryMode,
11
- discoveryMode = _ref$discoveryMode === void 0 ? 'iteration' : _ref$discoveryMode;
12
- var discovered = isDiscovered || isLocalStorageKeyDiscovered(localStorageKey);
10
+ discoveryMode = _ref$discoveryMode === void 0 ? 'iteration' : _ref$discoveryMode,
11
+ shouldShowPulse = _ref.shouldShowPulse,
12
+ testId = _ref.testId;
13
+ var discovered = isLocalStorageKeyDiscovered(localStorageKey);
14
+ var showPulse = shouldShowPulse !== null && shouldShowPulse !== void 0 ? shouldShowPulse : !discovered;
13
15
  var _useAnalyticsEvents = useAnalyticsEvents(),
14
16
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
15
17
  useEffect(function () {
16
- if (!discovered) {
18
+ if (showPulse) {
17
19
  createAnalyticsEvent({
18
20
  action: 'viewed',
19
21
  actionSubject: 'pulse',
@@ -23,16 +25,16 @@ export var DiscoveryPulse = function DiscoveryPulse(_ref) {
23
25
  }
24
26
  }).fire('media');
25
27
  }
26
- }, [createAnalyticsEvent, discovered, localStorageKey]);
28
+ }, [createAnalyticsEvent, discovered, localStorageKey, showPulse]);
27
29
  var onDiscovery = useCallback(function () {
28
30
  if (!discovered) {
29
31
  markLocalStorageKeyDiscovered(localStorageKey, localStorageKeyExpirationInMs);
30
32
  }
31
33
  }, [discovered, localStorageKey, localStorageKeyExpirationInMs]);
32
- var pulseProps = {
33
- onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
34
+ return /*#__PURE__*/React.createElement(Pulse, {
34
35
  onAnimationIteration: discoveryMode === 'iteration' ? onDiscovery : undefined,
35
- isDiscovered: discovered
36
- };
37
- return /*#__PURE__*/React.createElement(Pulse, pulseProps, children);
36
+ onAnimationStart: discoveryMode === 'start' ? onDiscovery : undefined,
37
+ showPulse: showPulse,
38
+ testId: testId
39
+ }, children);
38
40
  };
@@ -16,7 +16,8 @@ import { jsx } from '@emotion/react';
16
16
  import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
17
17
  import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
18
18
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
19
- import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
19
+ import { akEditorBreakoutPadding, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
20
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
20
21
  import { embedHeaderHeight } from '@atlaskit/smart-card';
21
22
  // eslint-disable-next-line @repo/internal/react/no-class-components
22
23
  var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
@@ -326,7 +327,13 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
326
327
  containerWidth = _this$props6.containerWidth,
327
328
  fullWidthMode = _this$props6.fullWidthMode,
328
329
  children = _this$props6.children;
329
- var initialWidth = this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide;
330
+ var resizerProps = getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {
331
+ width: this.calcPxWidth(),
332
+ innerPadding: akEditorMediaResizeHandlerPadding
333
+ } : {
334
+ width: this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide,
335
+ innerPadding: akEditorMediaResizeHandlerPaddingWide
336
+ };
330
337
  var enable = {};
331
338
  handleSides.forEach(function (side) {
332
339
  var oppositeSide = side === 'left' ? 'right' : 'left';
@@ -353,7 +360,7 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
353
360
 
354
361
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
355
362
  return jsx("div", {
356
- css: embedSpacingStyles,
363
+ css: getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? {} : embedSpacingStyles,
357
364
  "data-testid": "resizable-embed-card-spacing"
358
365
  }, jsx("div", {
359
366
  css: wrapperStyle({
@@ -363,17 +370,14 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
363
370
  fullWidthMode: fullWidthMode
364
371
  })
365
372
  }, jsx(Resizer, _extends({}, this.props, {
366
- width: initialWidth // Starting or initial width of embed <iframe> itself.
367
- ,
368
373
  enable: enable,
369
374
  calcNewSize: this.calcNewSize,
370
375
  snapPoints: this.calcSnapPoints(),
371
376
  scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
372
377
  highlights: this.highlights,
373
- innerPadding: akEditorMediaResizeHandlerPaddingWide,
374
378
  nodeType: "embed",
375
379
  handleStyles: nestedInTableHandleStyles(this.isNestedInTable())
376
- }), children, this.getHeightDefiningComponent())));
380
+ }, resizerProps), children, this.getHeightDefiningComponent())));
377
381
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */
378
382
  }
379
383
  }]);
@@ -13,14 +13,12 @@ export interface PulseProps {
13
13
  * The time in ms after which the key in local storage will be considered expired and the Pulse will be shown again
14
14
  */
15
15
  localStorageKeyExpirationInMs?: number;
16
- /**
17
- * And indicator that the feature was discovered externally and the pulsation needs to stop.
18
- */
19
- isDiscovered?: boolean;
20
16
  /**
21
17
  * Indicates when the feature is considered discovered. If "start" is passed, local storage key will be invalidated
22
18
  * as soon as the animation starts. If "iteration" is passed (the default one), it will be invalidated after the first iteration
23
19
  */
24
20
  discoveryMode?: PulseDiscoveryMode;
21
+ shouldShowPulse?: boolean;
22
+ testId?: string;
25
23
  }
26
- export declare const DiscoveryPulse: ({ children, localStorageKey, isDiscovered, localStorageKeyExpirationInMs, discoveryMode, }: PulseProps) => JSX.Element;
24
+ export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, }: PulseProps) => JSX.Element;
@@ -13,14 +13,12 @@ export interface PulseProps {
13
13
  * The time in ms after which the key in local storage will be considered expired and the Pulse will be shown again
14
14
  */
15
15
  localStorageKeyExpirationInMs?: number;
16
- /**
17
- * And indicator that the feature was discovered externally and the pulsation needs to stop.
18
- */
19
- isDiscovered?: boolean;
20
16
  /**
21
17
  * Indicates when the feature is considered discovered. If "start" is passed, local storage key will be invalidated
22
18
  * as soon as the animation starts. If "iteration" is passed (the default one), it will be invalidated after the first iteration
23
19
  */
24
20
  discoveryMode?: PulseDiscoveryMode;
21
+ shouldShowPulse?: boolean;
22
+ testId?: string;
25
23
  }
26
- export declare const DiscoveryPulse: ({ children, localStorageKey, isDiscovered, localStorageKeyExpirationInMs, discoveryMode, }: PulseProps) => JSX.Element;
24
+ export declare const DiscoveryPulse: ({ children, localStorageKey, localStorageKeyExpirationInMs, discoveryMode, shouldShowPulse, testId, }: PulseProps) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "0.14.22",
3
+ "version": "0.14.24",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -10,7 +10,8 @@
10
10
  "atlassian": {
11
11
  "team": "Linking Platform",
12
12
  "singleton": true,
13
- "releaseModel": "continuous"
13
+ "releaseModel": "continuous",
14
+ "runReact18": false
14
15
  },
15
16
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
16
17
  "main": "dist/cjs/index.js",
@@ -34,7 +35,7 @@
34
35
  "@atlaskit/adf-schema": "^35.2.0",
35
36
  "@atlaskit/analytics-next": "^9.1.0",
36
37
  "@atlaskit/custom-steps": "^0.0.10",
37
- "@atlaskit/editor-common": "^76.27.0",
38
+ "@atlaskit/editor-common": "^76.30.0",
38
39
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
39
40
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
40
41
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
@@ -49,13 +50,13 @@
49
50
  "@atlaskit/link-analytics": "^8.3.0",
50
51
  "@atlaskit/link-client-extension": "^1.8.0",
51
52
  "@atlaskit/link-datasource": "^1.19.0",
52
- "@atlaskit/linking-common": "^4.21.0",
53
+ "@atlaskit/linking-common": "^5.0.0",
53
54
  "@atlaskit/linking-types": "^8.5.0",
54
55
  "@atlaskit/platform-feature-flags": "^0.2.0",
55
56
  "@atlaskit/primitives": "^1.15.0",
56
57
  "@atlaskit/smart-card": "^26.43.0",
57
58
  "@atlaskit/theme": "^12.6.0",
58
- "@atlaskit/tokens": "^1.30.0",
59
+ "@atlaskit/tokens": "^1.32.0",
59
60
  "@babel/runtime": "^7.0.0",
60
61
  "@emotion/react": "^11.7.1",
61
62
  "lodash": "^4.17.21",
@@ -129,6 +130,9 @@
129
130
  },
130
131
  "platform.linking-platform.smart-card.inline-switcher": {
131
132
  "type": "boolean"
133
+ },
134
+ "platform.editor.show-embed-card-frame-renderer": {
135
+ "type": "boolean"
132
136
  }
133
137
  }
134
138
  }