@atlaskit/smart-card 26.42.1 → 26.42.3

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/smart-card
2
2
 
3
+ ## 26.42.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43009](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43009) [`df50e1df692`](https://bitbucket.org/atlassian/atlassian-frontend/commits/df50e1df692) - Remove should-call-onclick-in-warning-modal-only-when-safe FF
8
+ - Updated dependencies
9
+
10
+ ## 26.42.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [#43024](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43024) [`4e36cb30932`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e36cb30932) - Update embed card and embed modal internal structure and unskip vr tests
15
+
3
16
  ## 26.42.1
4
17
 
5
18
  ### Patch Changes
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "26.42.1"
25
+ packageVersion: "26.42.3"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -9,8 +9,10 @@ exports.Frame = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = require("@emotion/react");
11
11
  var _react2 = _interopRequireWildcard(require("react"));
12
+ var _reactMagneticDi = require("react-magnetic-di");
12
13
  var _utils = require("../../../utils");
13
14
  var _IframeDwellTracker = require("./IframeDwellTracker");
15
+ var _IFrame = require("./IFrame");
14
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
18
  /** @jsx jsx */
@@ -102,8 +104,8 @@ var Frame = exports.Frame = /*#__PURE__*/_react2.default.forwardRef(function (_r
102
104
  isWindowFocused: isWindowFocused,
103
105
  iframePercentVisible: percentVisible,
104
106
  onIframeDwell: onIframeDwell
105
- }), (0, _react.jsx)("iframe", {
106
- ref: mergedRef,
107
+ }), (0, _react.jsx)(_IFrame.IFrame, {
108
+ childRef: mergedRef,
107
109
  src: url,
108
110
  "data-testid": "".concat(testId, "-frame"),
109
111
  "data-iframe-loaded": isIframeLoaded,
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.IFrame = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _excluded = ["childRef"];
12
+ /**
13
+ * Iframe element isolated for DI purposes
14
+ */
15
+ var IFrame = exports.IFrame = function IFrame(_ref) {
16
+ var childRef = _ref.childRef,
17
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
18
+ return /*#__PURE__*/_react.default.createElement("iframe", (0, _extends2.default)({}, props, {
19
+ ref: childRef
20
+ }));
21
+ };
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _reactMagneticDi = require("react-magnetic-di");
9
10
  var _react = require("@emotion/react");
10
11
  var _utils = require("../../../../utils");
12
+ var _IFrame = require("../../../EmbedCard/components/IFrame");
11
13
  var _templateObject;
12
14
  /** @jsx jsx */
13
15
  var iframeCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: calc(100vh - 208px);\n"])));
@@ -25,6 +27,6 @@ var EmbedContent = function EmbedContent(_ref) {
25
27
  src: src,
26
28
  'data-testid': "".concat(testId, "-embed")
27
29
  };
28
- return (0, _react.jsx)("iframe", props);
30
+ return (0, _react.jsx)(_IFrame.IFrame, props);
29
31
  };
30
32
  var _default = exports.default = EmbedContent;
@@ -13,12 +13,11 @@ var _click = require("../../utils/analytics/click");
13
13
  var _LinkAnalyticsContext = require("../../utils/analytics/LinkAnalyticsContext");
14
14
  var _useLinkWarningModal2 = require("./LinkWarningModal/hooks/use-link-warning-modal");
15
15
  var _LinkWarningModal = _interopRequireDefault(require("./LinkWarningModal"));
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
16
  var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
18
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
19
18
  var PACKAGE_DATA = {
20
19
  packageName: "@atlaskit/smart-card",
21
- packageVersion: "26.42.1",
20
+ packageVersion: "26.42.3",
22
21
  componentName: 'linkUrl'
23
22
  };
24
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -42,24 +41,16 @@ var LinkUrl = function LinkUrl(_ref) {
42
41
  "data-testid": testId,
43
42
  href: href,
44
43
  onClick: function onClick(e) {
45
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.should-call-onclick-in-warning-modal-only-when-safe')) {
46
- if (!checkSafety) {
47
- _onClick && _onClick(e);
48
- return;
49
- }
44
+ if (!checkSafety) {
45
+ _onClick && _onClick(e);
46
+ return;
47
+ }
50
48
 
51
- // Only call the onClick if the link is safe
52
- if (isLinkSafe(e, href)) {
53
- _onClick && _onClick(e);
54
- } else {
55
- showSafetyWarningModal(e, href);
56
- }
57
- } else {
58
- if (checkSafety && !isLinkSafe(e, href)) {
59
- showSafetyWarningModal(e, href);
60
- }
61
- // Call the onClick regardless of the link safety
49
+ // Only call the onClick if the link is safe
50
+ if (isLinkSafe(e, href)) {
62
51
  _onClick && _onClick(e);
52
+ } else {
53
+ showSafetyWarningModal(e, href);
63
54
  }
64
55
  }
65
56
  }, props), children)), checkSafety && /*#__PURE__*/_react.default.createElement(_LinkWarningModal.default, linkWarningModalProps));
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "26.42.1"
7
+ packageVersion: "26.42.3"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,8 +1,10 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import React, { useEffect, useState, useRef } from 'react';
4
+ import { di } from 'react-magnetic-di';
4
5
  import { getIframeSandboxAttribute } from '../../../utils';
5
6
  import { IframeDwellTracker } from './IframeDwellTracker';
7
+ import { IFrame } from './IFrame';
6
8
  function mergeRefs(refs) {
7
9
  return value => {
8
10
  refs.forEach(ref => {
@@ -76,8 +78,8 @@ export const Frame = /*#__PURE__*/React.forwardRef(({
76
78
  isWindowFocused: isWindowFocused,
77
79
  iframePercentVisible: percentVisible,
78
80
  onIframeDwell: onIframeDwell
79
- }), jsx("iframe", {
80
- ref: mergedRef,
81
+ }), jsx(IFrame, {
82
+ childRef: mergedRef,
81
83
  src: url,
82
84
  "data-testid": `${testId}-frame`,
83
85
  "data-iframe-loaded": isIframeLoaded,
@@ -0,0 +1,13 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ /**
4
+ * Iframe element isolated for DI purposes
5
+ */
6
+ export const IFrame = ({
7
+ childRef,
8
+ ...props
9
+ }) => {
10
+ return /*#__PURE__*/React.createElement("iframe", _extends({}, props, {
11
+ ref: childRef
12
+ }));
13
+ };
@@ -1,7 +1,9 @@
1
1
  /** @jsx jsx */
2
2
 
3
+ import { di } from 'react-magnetic-di';
3
4
  import { css, jsx } from '@emotion/react';
4
5
  import { getIframeSandboxAttribute } from '../../../../utils';
6
+ import { IFrame } from '../../../EmbedCard/components/IFrame';
5
7
  const iframeCss = css`
6
8
  width: 100%;
7
9
  height: calc(100vh - 208px);
@@ -21,6 +23,6 @@ const EmbedContent = ({
21
23
  src,
22
24
  'data-testid': `${testId}-embed`
23
25
  };
24
- return jsx("iframe", props);
26
+ return jsx(IFrame, props);
25
27
  };
26
28
  export default EmbedContent;
@@ -5,10 +5,9 @@ import { withLinkClickedEvent } from '../../utils/analytics/click';
5
5
  import { LinkAnalyticsContext } from '../../utils/analytics/LinkAnalyticsContext';
6
6
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
7
7
  import LinkWarningModal from './LinkWarningModal';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
8
  const PACKAGE_DATA = {
10
9
  packageName: "@atlaskit/smart-card",
11
- packageVersion: "26.42.1",
10
+ packageVersion: "26.42.3",
12
11
  componentName: 'linkUrl'
13
12
  };
14
13
  const Link = withLinkClickedEvent('a');
@@ -32,24 +31,16 @@ const LinkUrl = ({
32
31
  "data-testid": testId,
33
32
  href: href,
34
33
  onClick: e => {
35
- if (getBooleanFF('platform.linking-platform.smart-card.should-call-onclick-in-warning-modal-only-when-safe')) {
36
- if (!checkSafety) {
37
- onClick && onClick(e);
38
- return;
39
- }
34
+ if (!checkSafety) {
35
+ onClick && onClick(e);
36
+ return;
37
+ }
40
38
 
41
- // Only call the onClick if the link is safe
42
- if (isLinkSafe(e, href)) {
43
- onClick && onClick(e);
44
- } else {
45
- showSafetyWarningModal(e, href);
46
- }
47
- } else {
48
- if (checkSafety && !isLinkSafe(e, href)) {
49
- showSafetyWarningModal(e, href);
50
- }
51
- // Call the onClick regardless of the link safety
39
+ // Only call the onClick if the link is safe
40
+ if (isLinkSafe(e, href)) {
52
41
  onClick && onClick(e);
42
+ } else {
43
+ showSafetyWarningModal(e, href);
53
44
  }
54
45
  }
55
46
  }, props), children)), checkSafety && /*#__PURE__*/React.createElement(LinkWarningModal, linkWarningModalProps));
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "26.42.1"
18
+ packageVersion: "26.42.3"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -2,8 +2,10 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  /** @jsx jsx */
3
3
  import { jsx } from '@emotion/react';
4
4
  import React, { useEffect, useState, useRef } from 'react';
5
+ import { di } from 'react-magnetic-di';
5
6
  import { getIframeSandboxAttribute } from '../../../utils';
6
7
  import { IframeDwellTracker } from './IframeDwellTracker';
8
+ import { IFrame } from './IFrame';
7
9
  function mergeRefs(refs) {
8
10
  return function (value) {
9
11
  refs.forEach(function (ref) {
@@ -91,8 +93,8 @@ export var Frame = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef) {
91
93
  isWindowFocused: isWindowFocused,
92
94
  iframePercentVisible: percentVisible,
93
95
  onIframeDwell: onIframeDwell
94
- }), jsx("iframe", {
95
- ref: mergedRef,
96
+ }), jsx(IFrame, {
97
+ childRef: mergedRef,
96
98
  src: url,
97
99
  "data-testid": "".concat(testId, "-frame"),
98
100
  "data-iframe-loaded": isIframeLoaded,
@@ -0,0 +1,14 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["childRef"];
4
+ import React from 'react';
5
+ /**
6
+ * Iframe element isolated for DI purposes
7
+ */
8
+ export var IFrame = function IFrame(_ref) {
9
+ var childRef = _ref.childRef,
10
+ props = _objectWithoutProperties(_ref, _excluded);
11
+ return /*#__PURE__*/React.createElement("iframe", _extends({}, props, {
12
+ ref: childRef
13
+ }));
14
+ };
@@ -2,8 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
  var _templateObject;
3
3
  /** @jsx jsx */
4
4
 
5
+ import { di } from 'react-magnetic-di';
5
6
  import { css, jsx } from '@emotion/react';
6
7
  import { getIframeSandboxAttribute } from '../../../../utils';
8
+ import { IFrame } from '../../../EmbedCard/components/IFrame';
7
9
  var iframeCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 208px);\n"])));
8
10
  var EmbedContent = function EmbedContent(_ref) {
9
11
  var isTrusted = _ref.isTrusted,
@@ -19,6 +21,6 @@ var EmbedContent = function EmbedContent(_ref) {
19
21
  src: src,
20
22
  'data-testid': "".concat(testId, "-embed")
21
23
  };
22
- return jsx("iframe", props);
24
+ return jsx(IFrame, props);
23
25
  };
24
26
  export default EmbedContent;
@@ -8,10 +8,9 @@ import { withLinkClickedEvent } from '../../utils/analytics/click';
8
8
  import { LinkAnalyticsContext } from '../../utils/analytics/LinkAnalyticsContext';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  import LinkWarningModal from './LinkWarningModal';
11
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
11
  var PACKAGE_DATA = {
13
12
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "26.42.1",
13
+ packageVersion: "26.42.3",
15
14
  componentName: 'linkUrl'
16
15
  };
17
16
  var Link = withLinkClickedEvent('a');
@@ -35,24 +34,16 @@ var LinkUrl = function LinkUrl(_ref) {
35
34
  "data-testid": testId,
36
35
  href: href,
37
36
  onClick: function onClick(e) {
38
- if (getBooleanFF('platform.linking-platform.smart-card.should-call-onclick-in-warning-modal-only-when-safe')) {
39
- if (!checkSafety) {
40
- _onClick && _onClick(e);
41
- return;
42
- }
37
+ if (!checkSafety) {
38
+ _onClick && _onClick(e);
39
+ return;
40
+ }
43
41
 
44
- // Only call the onClick if the link is safe
45
- if (isLinkSafe(e, href)) {
46
- _onClick && _onClick(e);
47
- } else {
48
- showSafetyWarningModal(e, href);
49
- }
50
- } else {
51
- if (checkSafety && !isLinkSafe(e, href)) {
52
- showSafetyWarningModal(e, href);
53
- }
54
- // Call the onClick regardless of the link safety
42
+ // Only call the onClick if the link is safe
43
+ if (isLinkSafe(e, href)) {
55
44
  _onClick && _onClick(e);
45
+ } else {
46
+ showSafetyWarningModal(e, href);
56
47
  }
57
48
  }
58
49
  }, props), children)), checkSafety && /*#__PURE__*/React.createElement(LinkWarningModal, linkWarningModalProps));
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IFrameProps {
3
+ childRef?: React.Ref<HTMLIFrameElement>;
4
+ }
5
+ /**
6
+ * Iframe element isolated for DI purposes
7
+ */
8
+ export declare const IFrame: ({ childRef, ...props }: React.ComponentProps<'iframe'> & IFrameProps) => JSX.Element;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IFrameProps {
3
+ childRef?: React.Ref<HTMLIFrameElement>;
4
+ }
5
+ /**
6
+ * Iframe element isolated for DI purposes
7
+ */
8
+ export declare const IFrame: ({ childRef, ...props }: React.ComponentProps<'iframe'> & IFrameProps) => JSX.Element;
9
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.42.1",
3
+ "version": "26.42.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,7 +27,7 @@
27
27
  "@atlaskit/avatar": "^21.4.0",
28
28
  "@atlaskit/avatar-group": "^9.4.0",
29
29
  "@atlaskit/badge": "^15.1.0",
30
- "@atlaskit/button": "^16.13.0",
30
+ "@atlaskit/button": "^16.16.0",
31
31
  "@atlaskit/dropdown-menu": "^12.1.0",
32
32
  "@atlaskit/frontend-utilities": "^2.7.0",
33
33
  "@atlaskit/icon": "^21.12.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/link-analytics": "^8.3.0",
39
39
  "@atlaskit/link-client-extension": "^1.8.0",
40
40
  "@atlaskit/link-extractors": "^1.2.0",
41
- "@atlaskit/linking-common": "^4.17.0",
41
+ "@atlaskit/linking-common": "^4.18.0",
42
42
  "@atlaskit/linking-types": "^8.4.0",
43
43
  "@atlaskit/logo": "^13.14.0",
44
44
  "@atlaskit/lozenge": "^11.4.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
47
47
  "@atlaskit/platform-feature-flags": "^0.2.1",
48
48
  "@atlaskit/popup": "^1.11.0",
49
- "@atlaskit/primitives": "^1.9.0",
49
+ "@atlaskit/primitives": "^1.10.0",
50
50
  "@atlaskit/spinner": "^15.6.0",
51
51
  "@atlaskit/theme": "^12.6.0",
52
52
  "@atlaskit/tokens": "^1.28.0",
@@ -141,9 +141,6 @@
141
141
  "platform.linking-platform.smart-card.follow-button": {
142
142
  "type": "boolean"
143
143
  },
144
- "platform.linking-platform.smart-card.should-call-onclick-in-warning-modal-only-when-safe": {
145
- "type": "boolean"
146
- },
147
144
  "platform.linking-platform.smart-card.show-smart-links-refreshed-design": {
148
145
  "type": "boolean"
149
146
  },