@atlaskit/smart-card 30.1.8 → 30.2.0
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 +16 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +1 -4
- package/dist/cjs/view/Card/index.js +2 -4
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +8 -5
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +0 -1
- package/dist/es2019/view/Card/index.js +1 -3
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +5 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +0 -3
- package/dist/esm/view/Card/index.js +1 -3
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +6 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/utils/index.d.ts +0 -2
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +0 -12
- package/dist/types/view/HoverCard/components/CustomPopupContainer.d.ts +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +0 -2
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +0 -12
- package/dist/types-ts4.5/view/HoverCard/components/CustomPopupContainer.d.ts +1 -1
- package/package.json +1 -1
- package/.eslintrc.json +0 -28
- package/dist/cjs/view/CardWithData/loader.js +0 -78
- package/dist/es2019/view/CardWithData/loader.js +0 -46
- package/dist/esm/view/CardWithData/loader.js +0 -66
- package/dist/types/view/CardWithData/loader.d.ts +0 -9
- package/dist/types-ts4.5/view/CardWithData/loader.d.ts +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 30.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#159791](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159791)
|
|
8
|
+
[`ce28bda7a3e2a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ce28bda7a3e2a) -
|
|
9
|
+
Removing deprecated `data` and `importer` prop from @atlaskit/smart-card
|
|
10
|
+
|
|
11
|
+
## 30.1.9
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#156157](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156157)
|
|
16
|
+
[`67bdb3a72c8bb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/67bdb3a72c8bb) -
|
|
17
|
+
Fix hover card accessibility violation
|
|
18
|
+
|
|
3
19
|
## 30.1.8
|
|
4
20
|
|
|
5
21
|
### 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: "30.
|
|
25
|
+
packageVersion: "30.2.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.
|
|
8
|
+
exports.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.importWithRetry = exports.handleOnClick = exports.getPreviewUrlWithTheme = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = exports.downloadUrl = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -14,9 +14,6 @@ var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
|
14
14
|
var _tokens = require("@atlaskit/tokens");
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
-
var isCardWithData = exports.isCardWithData = function isCardWithData(props) {
|
|
18
|
-
return !!props.data;
|
|
19
|
-
};
|
|
20
17
|
var isSpecialEvent = exports.isSpecialEvent = function isSpecialEvent(evt) {
|
|
21
18
|
return evt.isDefaultPrevented() && (isIframe() || isSpecialKey(evt) || isSpecialClick(evt));
|
|
22
19
|
};
|
|
@@ -13,10 +13,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
16
|
-
var _utils = require("../../utils");
|
|
17
16
|
var _analytics = require("../../utils/analytics");
|
|
18
|
-
var _loader = require("../
|
|
19
|
-
var _loader2 = require("../CardWithUrl/loader");
|
|
17
|
+
var _loader = require("../CardWithUrl/loader");
|
|
20
18
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
21
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
20
|
var PlainCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -29,7 +27,7 @@ var PlainCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
29
27
|
(0, _createClass2.default)(PlainCard, [{
|
|
30
28
|
key: "render",
|
|
31
29
|
value: function render() {
|
|
32
|
-
var content =
|
|
30
|
+
var content = /*#__PURE__*/_react.default.createElement(_loader.CardWithURLRenderer, this.props);
|
|
33
31
|
return this.props.intl ? content : /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
34
32
|
locale: "en"
|
|
35
33
|
}, content);
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.HoverCardComponent = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _react2 = require("@emotion/react");
|
|
@@ -20,15 +21,14 @@ var _SmartLinkAnalyticsContext = require("../../../utils/analytics/SmartLinkAnal
|
|
|
20
21
|
var _CustomPopupContainer = _interopRequireDefault(require("../components/CustomPopupContainer"));
|
|
21
22
|
var _HoverCardContent = _interopRequireDefault(require("../components/HoverCardContent"));
|
|
22
23
|
var _styled = require("../styled");
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
var _excluded = ["aria-haspopup", "aria-expanded"];
|
|
25
25
|
/**
|
|
26
26
|
* @jsxRuntime classic
|
|
27
27
|
* @jsx jsx
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
31
|
-
|
|
30
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
31
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
33
33
|
var FADE_IN_DELAY = 500;
|
|
34
34
|
var FADE_OUT_DELAY = 300;
|
|
@@ -205,7 +205,10 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
205
205
|
source: HOVER_CARD_SOURCE
|
|
206
206
|
}, (0, _react2.jsx)(_HoverCardContent.default, hoverCardContentProps));
|
|
207
207
|
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
208
|
-
var trigger = (0, _react.useCallback)(function (
|
|
208
|
+
var trigger = (0, _react.useCallback)(function (_ref3) {
|
|
209
|
+
var ariaHasPopup = _ref3['aria-haspopup'],
|
|
210
|
+
ariaExpanded = _ref3['aria-expanded'],
|
|
211
|
+
triggerProps = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
209
212
|
return (0, _react2.jsx)("span", {
|
|
210
213
|
ref: parentSpan
|
|
211
214
|
}, (0, _react2.jsx)("span", (0, _extends2.default)({}, triggerProps, {
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "30.
|
|
20
|
+
packageVersion: "30.2.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -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: "30.
|
|
7
|
+
packageVersion: "30.2.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
3
|
import { themeObjectToString } from '@atlaskit/tokens';
|
|
4
|
-
export const isCardWithData = props => !!props.data;
|
|
5
4
|
export const isSpecialEvent = evt => evt.isDefaultPrevented() && (isIframe() || isSpecialKey(evt) || isSpecialClick(evt));
|
|
6
5
|
export const isIframe = () => window.parent !== parent;
|
|
7
6
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
3
3
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
-
import { isCardWithData } from '../../utils';
|
|
5
4
|
import { context } from '../../utils/analytics';
|
|
6
|
-
import { CardWithDataRenderer } from '../CardWithData/loader';
|
|
7
5
|
import { CardWithURLRenderer } from '../CardWithUrl/loader';
|
|
8
6
|
class PlainCard extends React.PureComponent {
|
|
9
7
|
render() {
|
|
10
|
-
const content =
|
|
8
|
+
const content = /*#__PURE__*/React.createElement(CardWithURLRenderer, this.props);
|
|
11
9
|
return this.props.intl ? content : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
12
10
|
locale: "en"
|
|
13
11
|
}, content);
|
|
@@ -182,7 +182,11 @@ export const HoverCardComponent = ({
|
|
|
182
182
|
source: HOVER_CARD_SOURCE
|
|
183
183
|
}, jsx(HoverCardContent, hoverCardContentProps));
|
|
184
184
|
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
185
|
-
const trigger = useCallback(
|
|
185
|
+
const trigger = useCallback(({
|
|
186
|
+
'aria-haspopup': ariaHasPopup,
|
|
187
|
+
'aria-expanded': ariaExpanded,
|
|
188
|
+
...triggerProps
|
|
189
|
+
}) => jsx("span", {
|
|
186
190
|
ref: parentSpan
|
|
187
191
|
}, jsx("span", _extends({}, triggerProps, {
|
|
188
192
|
onMouseOver: initShowCard,
|
|
@@ -7,7 +7,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
7
7
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "30.
|
|
10
|
+
packageVersion: "30.2.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -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: "30.
|
|
18
|
+
packageVersion: "30.2.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -4,9 +4,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Loadable from 'react-loadable';
|
|
6
6
|
import { themeObjectToString } from '@atlaskit/tokens';
|
|
7
|
-
export var isCardWithData = function isCardWithData(props) {
|
|
8
|
-
return !!props.data;
|
|
9
|
-
};
|
|
10
7
|
export var isSpecialEvent = function isSpecialEvent(evt) {
|
|
11
8
|
return evt.isDefaultPrevented() && (isIframe() || isSpecialKey(evt) || isSpecialClick(evt));
|
|
12
9
|
};
|
|
@@ -8,9 +8,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
10
10
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
|
-
import { isCardWithData } from '../../utils';
|
|
12
11
|
import { context } from '../../utils/analytics';
|
|
13
|
-
import { CardWithDataRenderer } from '../CardWithData/loader';
|
|
14
12
|
import { CardWithURLRenderer } from '../CardWithUrl/loader';
|
|
15
13
|
var PlainCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
16
14
|
_inherits(PlainCard, _React$PureComponent);
|
|
@@ -22,7 +20,7 @@ var PlainCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
22
20
|
_createClass(PlainCard, [{
|
|
23
21
|
key: "render",
|
|
24
22
|
value: function render() {
|
|
25
|
-
var content =
|
|
23
|
+
var content = /*#__PURE__*/React.createElement(CardWithURLRenderer, this.props);
|
|
26
24
|
return this.props.intl ? content : /*#__PURE__*/React.createElement(IntlProvider, {
|
|
27
25
|
locale: "en"
|
|
28
26
|
}, content);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
var _excluded = ["aria-haspopup", "aria-expanded"];
|
|
3
5
|
/**
|
|
4
6
|
* @jsxRuntime classic
|
|
5
7
|
* @jsx jsx
|
|
@@ -194,7 +196,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
194
196
|
source: HOVER_CARD_SOURCE
|
|
195
197
|
}, jsx(HoverCardContent, hoverCardContentProps));
|
|
196
198
|
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
197
|
-
var trigger = useCallback(function (
|
|
199
|
+
var trigger = useCallback(function (_ref3) {
|
|
200
|
+
var ariaHasPopup = _ref3['aria-haspopup'],
|
|
201
|
+
ariaExpanded = _ref3['aria-expanded'],
|
|
202
|
+
triggerProps = _objectWithoutProperties(_ref3, _excluded);
|
|
198
203
|
return jsx("span", {
|
|
199
204
|
ref: parentSpan
|
|
200
205
|
}, jsx("span", _extends({}, triggerProps, {
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "30.
|
|
13
|
+
packageVersion: "30.2.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ActiveThemeState } from '@atlaskit/tokens';
|
|
3
|
-
import type { CardProps } from '../view/Card';
|
|
4
|
-
export declare const isCardWithData: (props: CardProps) => boolean;
|
|
5
3
|
export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
|
|
6
4
|
export declare const isIframe: () => boolean;
|
|
7
5
|
/**
|
|
@@ -3,5 +3,5 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
4
4
|
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<Omit<CardProps & WrappedComponentProps, "intl"> & {
|
|
5
5
|
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
-
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "
|
|
6
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "hoverPreviewOptions" | "ui" | "onResolve" | "showHoverPreview" | "showAuthTooltip" | "platform" | "forwardedRef" | "fallbackComponent" | "inlinePreloaderStyle" | "isHovered" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "useLegacyBlockCard" | "embedIframeRef" | "embedIframeUrlType" | "frameStyle"> & React.RefAttributes<any>>;
|
|
7
7
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -182,16 +182,4 @@ export interface FlexibleProps extends ActionProps, HoverPreviewProps {
|
|
|
182
182
|
ui?: FlexibleUiOptions;
|
|
183
183
|
}
|
|
184
184
|
export interface CardProps extends BaseCardProps, InlineProps, BlockProps, EmbedProps, FlexibleProps, WithAnalyticsEventsProps {
|
|
185
|
-
/**
|
|
186
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-3226 Internal documentation for deprecation (no external access)}
|
|
187
|
-
* Likely here for legacy reason where editor would store data in ADF instead of resolving it every time
|
|
188
|
-
* https://product-fabric.atlassian.net/browse/EDM-10930
|
|
189
|
-
*/
|
|
190
|
-
data?: any;
|
|
191
|
-
/**
|
|
192
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-3226 Internal documentation for deprecation (no external access)}
|
|
193
|
-
* Likely here for legacy reason where editor would store data in ADF instead of resolving it every time
|
|
194
|
-
* https://product-fabric.atlassian.net/browse/EDM-10930
|
|
195
|
-
*/
|
|
196
|
-
importer?: (target: any) => void;
|
|
197
185
|
}
|
|
@@ -9,5 +9,5 @@ import { type PopupComponentProps } from '@atlaskit/popup';
|
|
|
9
9
|
* HoverCard border implementation is in ContentContainer where it can
|
|
10
10
|
* change between the default border and prism border during runtime.
|
|
11
11
|
*/
|
|
12
|
-
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "appearance" | "children" | "style" | "id" | "tabIndex" | "role" | "data-testid" | "shouldFitContainer" | "
|
|
12
|
+
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "appearance" | "children" | "style" | "id" | "tabIndex" | "role" | "data-testid" | "shouldFitContainer" | "xcss" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export default CustomPopupContainer;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ActiveThemeState } from '@atlaskit/tokens';
|
|
3
|
-
import type { CardProps } from '../view/Card';
|
|
4
|
-
export declare const isCardWithData: (props: CardProps) => boolean;
|
|
5
3
|
export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
|
|
6
4
|
export declare const isIframe: () => boolean;
|
|
7
5
|
/**
|
|
@@ -3,5 +3,5 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
4
4
|
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<Omit<CardProps & WrappedComponentProps, "intl"> & {
|
|
5
5
|
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
-
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "
|
|
6
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "hoverPreviewOptions" | "ui" | "onResolve" | "showHoverPreview" | "showAuthTooltip" | "platform" | "forwardedRef" | "fallbackComponent" | "inlinePreloaderStyle" | "isHovered" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "useLegacyBlockCard" | "embedIframeRef" | "embedIframeUrlType" | "frameStyle"> & React.RefAttributes<any>>;
|
|
7
7
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -182,16 +182,4 @@ export interface FlexibleProps extends ActionProps, HoverPreviewProps {
|
|
|
182
182
|
ui?: FlexibleUiOptions;
|
|
183
183
|
}
|
|
184
184
|
export interface CardProps extends BaseCardProps, InlineProps, BlockProps, EmbedProps, FlexibleProps, WithAnalyticsEventsProps {
|
|
185
|
-
/**
|
|
186
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-3226 Internal documentation for deprecation (no external access)}
|
|
187
|
-
* Likely here for legacy reason where editor would store data in ADF instead of resolving it every time
|
|
188
|
-
* https://product-fabric.atlassian.net/browse/EDM-10930
|
|
189
|
-
*/
|
|
190
|
-
data?: any;
|
|
191
|
-
/**
|
|
192
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-3226 Internal documentation for deprecation (no external access)}
|
|
193
|
-
* Likely here for legacy reason where editor would store data in ADF instead of resolving it every time
|
|
194
|
-
* https://product-fabric.atlassian.net/browse/EDM-10930
|
|
195
|
-
*/
|
|
196
|
-
importer?: (target: any) => void;
|
|
197
185
|
}
|
|
@@ -9,5 +9,5 @@ import { type PopupComponentProps } from '@atlaskit/popup';
|
|
|
9
9
|
* HoverCard border implementation is in ContentContainer where it can
|
|
10
10
|
* change between the default border and prism border during runtime.
|
|
11
11
|
*/
|
|
12
|
-
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "appearance" | "children" | "style" | "id" | "tabIndex" | "role" | "data-testid" | "shouldFitContainer" | "
|
|
12
|
+
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "appearance" | "children" | "style" | "id" | "tabIndex" | "role" | "data-testid" | "shouldFitContainer" | "xcss" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export default CustomPopupContainer;
|
package/package.json
CHANGED
package/.eslintrc.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": {
|
|
3
|
-
"@typescript-eslint/no-unused-vars": [
|
|
4
|
-
"error",
|
|
5
|
-
{ "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
|
|
6
|
-
]
|
|
7
|
-
},
|
|
8
|
-
"overrides": [
|
|
9
|
-
{
|
|
10
|
-
"files": ["docs/**/*"],
|
|
11
|
-
"rules": {
|
|
12
|
-
"@typescript-eslint/no-unused-vars": [
|
|
13
|
-
"error",
|
|
14
|
-
{ "argsIgnorePattern": "^_|props", "ignoreRestSiblings": true }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"files": ["examples/**/*"],
|
|
20
|
-
"rules": {
|
|
21
|
-
"@typescript-eslint/no-unused-vars": [
|
|
22
|
-
"error",
|
|
23
|
-
{ "argsIgnorePattern": "^_|url", "ignoreRestSiblings": true }
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CardWithDataRenderer = void 0;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
19
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
-
var CardWithDataRenderer = exports.CardWithDataRenderer = /*#__PURE__*/function (_React$PureComponent) {
|
|
21
|
-
(0, _inherits2.default)(CardWithDataRenderer, _React$PureComponent);
|
|
22
|
-
var _super = _createSuper(CardWithDataRenderer);
|
|
23
|
-
function CardWithDataRenderer() {
|
|
24
|
-
(0, _classCallCheck2.default)(this, CardWithDataRenderer);
|
|
25
|
-
return _super.apply(this, arguments);
|
|
26
|
-
}
|
|
27
|
-
(0, _createClass2.default)(CardWithDataRenderer, [{
|
|
28
|
-
key: "componentDidMount",
|
|
29
|
-
value: function componentDidMount() {
|
|
30
|
-
if (CardWithDataRenderer.CardContent === null) {
|
|
31
|
-
(this.props.importer || CardWithDataRenderer.moduleImporter)(this);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
key: "render",
|
|
36
|
-
value: function render() {
|
|
37
|
-
var _this$props = this.props,
|
|
38
|
-
id = _this$props.id,
|
|
39
|
-
appearance = _this$props.appearance,
|
|
40
|
-
data = _this$props.data,
|
|
41
|
-
isSelected = _this$props.isSelected,
|
|
42
|
-
onClick = _this$props.onClick,
|
|
43
|
-
onResolve = _this$props.onResolve,
|
|
44
|
-
testId = _this$props.testId,
|
|
45
|
-
inlinePreloaderStyle = _this$props.inlinePreloaderStyle;
|
|
46
|
-
if (!data) {
|
|
47
|
-
throw new Error('@atlaskit/smart-cards: you are trying to render a card with data, but does not provide any');
|
|
48
|
-
}
|
|
49
|
-
if (CardWithDataRenderer.CardContent) {
|
|
50
|
-
return /*#__PURE__*/_react.default.createElement(CardWithDataRenderer.CardContent, {
|
|
51
|
-
id: id,
|
|
52
|
-
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
53
|
-
appearance: appearance,
|
|
54
|
-
data: data,
|
|
55
|
-
isSelected: isSelected,
|
|
56
|
-
onClick: onClick,
|
|
57
|
-
onResolve: onResolve,
|
|
58
|
-
testId: testId
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
-
"data-card-with-data": true
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}], [{
|
|
66
|
-
key: "moduleImporter",
|
|
67
|
-
value: function moduleImporter(target) {
|
|
68
|
-
Promise.resolve().then(function () {
|
|
69
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_smartcard-datacardcontent" */'./component'));
|
|
70
|
-
}).then(function (module) {
|
|
71
|
-
CardWithDataRenderer.CardContent = module.CardWithDataContent;
|
|
72
|
-
target.forceUpdate();
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}]);
|
|
76
|
-
return CardWithDataRenderer;
|
|
77
|
-
}(_react.default.PureComponent);
|
|
78
|
-
(0, _defineProperty2.default)(CardWithDataRenderer, "CardContent", null);
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export class CardWithDataRenderer extends React.PureComponent {
|
|
4
|
-
static moduleImporter(target) {
|
|
5
|
-
import( /* webpackChunkName: "@atlaskit-internal_smartcard-datacardcontent" */'./component').then(module => {
|
|
6
|
-
CardWithDataRenderer.CardContent = module.CardWithDataContent;
|
|
7
|
-
target.forceUpdate();
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
componentDidMount() {
|
|
11
|
-
if (CardWithDataRenderer.CardContent === null) {
|
|
12
|
-
(this.props.importer || CardWithDataRenderer.moduleImporter)(this);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
render() {
|
|
16
|
-
const {
|
|
17
|
-
id,
|
|
18
|
-
appearance,
|
|
19
|
-
data,
|
|
20
|
-
isSelected,
|
|
21
|
-
onClick,
|
|
22
|
-
onResolve,
|
|
23
|
-
testId,
|
|
24
|
-
inlinePreloaderStyle
|
|
25
|
-
} = this.props;
|
|
26
|
-
if (!data) {
|
|
27
|
-
throw new Error('@atlaskit/smart-cards: you are trying to render a card with data, but does not provide any');
|
|
28
|
-
}
|
|
29
|
-
if (CardWithDataRenderer.CardContent) {
|
|
30
|
-
return /*#__PURE__*/React.createElement(CardWithDataRenderer.CardContent, {
|
|
31
|
-
id: id,
|
|
32
|
-
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
33
|
-
appearance: appearance,
|
|
34
|
-
data: data,
|
|
35
|
-
isSelected: isSelected,
|
|
36
|
-
onClick: onClick,
|
|
37
|
-
onResolve: onResolve,
|
|
38
|
-
testId: testId
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
"data-card-with-data": true
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
_defineProperty(CardWithDataRenderer, "CardContent", null);
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
8
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
import React from 'react';
|
|
10
|
-
export var CardWithDataRenderer = /*#__PURE__*/function (_React$PureComponent) {
|
|
11
|
-
_inherits(CardWithDataRenderer, _React$PureComponent);
|
|
12
|
-
var _super = _createSuper(CardWithDataRenderer);
|
|
13
|
-
function CardWithDataRenderer() {
|
|
14
|
-
_classCallCheck(this, CardWithDataRenderer);
|
|
15
|
-
return _super.apply(this, arguments);
|
|
16
|
-
}
|
|
17
|
-
_createClass(CardWithDataRenderer, [{
|
|
18
|
-
key: "componentDidMount",
|
|
19
|
-
value: function componentDidMount() {
|
|
20
|
-
if (CardWithDataRenderer.CardContent === null) {
|
|
21
|
-
(this.props.importer || CardWithDataRenderer.moduleImporter)(this);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}, {
|
|
25
|
-
key: "render",
|
|
26
|
-
value: function render() {
|
|
27
|
-
var _this$props = this.props,
|
|
28
|
-
id = _this$props.id,
|
|
29
|
-
appearance = _this$props.appearance,
|
|
30
|
-
data = _this$props.data,
|
|
31
|
-
isSelected = _this$props.isSelected,
|
|
32
|
-
onClick = _this$props.onClick,
|
|
33
|
-
onResolve = _this$props.onResolve,
|
|
34
|
-
testId = _this$props.testId,
|
|
35
|
-
inlinePreloaderStyle = _this$props.inlinePreloaderStyle;
|
|
36
|
-
if (!data) {
|
|
37
|
-
throw new Error('@atlaskit/smart-cards: you are trying to render a card with data, but does not provide any');
|
|
38
|
-
}
|
|
39
|
-
if (CardWithDataRenderer.CardContent) {
|
|
40
|
-
return /*#__PURE__*/React.createElement(CardWithDataRenderer.CardContent, {
|
|
41
|
-
id: id,
|
|
42
|
-
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
43
|
-
appearance: appearance,
|
|
44
|
-
data: data,
|
|
45
|
-
isSelected: isSelected,
|
|
46
|
-
onClick: onClick,
|
|
47
|
-
onResolve: onResolve,
|
|
48
|
-
testId: testId
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
"data-card-with-data": true
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}], [{
|
|
56
|
-
key: "moduleImporter",
|
|
57
|
-
value: function moduleImporter(target) {
|
|
58
|
-
import( /* webpackChunkName: "@atlaskit-internal_smartcard-datacardcontent" */'./component').then(function (module) {
|
|
59
|
-
CardWithDataRenderer.CardContent = module.CardWithDataContent;
|
|
60
|
-
target.forceUpdate();
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}]);
|
|
64
|
-
return CardWithDataRenderer;
|
|
65
|
-
}(React.PureComponent);
|
|
66
|
-
_defineProperty(CardWithDataRenderer, "CardContent", null);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type CardProps } from '../Card/types';
|
|
3
|
-
import { type CardWithDataContent as CardWithDataContentType } from './component';
|
|
4
|
-
export declare class CardWithDataRenderer extends React.PureComponent<CardProps> {
|
|
5
|
-
static CardContent: typeof CardWithDataContentType | null;
|
|
6
|
-
static moduleImporter(target: CardWithDataRenderer): void;
|
|
7
|
-
componentDidMount(): void;
|
|
8
|
-
render(): JSX.Element;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type CardProps } from '../Card/types';
|
|
3
|
-
import { type CardWithDataContent as CardWithDataContentType } from './component';
|
|
4
|
-
export declare class CardWithDataRenderer extends React.PureComponent<CardProps> {
|
|
5
|
-
static CardContent: typeof CardWithDataContentType | null;
|
|
6
|
-
static moduleImporter(target: CardWithDataRenderer): void;
|
|
7
|
-
componentDidMount(): void;
|
|
8
|
-
render(): JSX.Element;
|
|
9
|
-
}
|