@atlaskit/smart-card 26.42.11 → 26.43.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 +12 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/components/Action.js +8 -5
- package/dist/cjs/view/BlockCard/components/ActionList.js +11 -9
- package/dist/cjs/view/BlockCard/components/CollaboratorList.js +5 -2
- package/dist/cjs/view/BlockCard/components/Content.js +4 -1
- package/dist/cjs/view/BlockCard/components/ContentFooter.js +4 -1
- package/dist/cjs/view/BlockCard/components/ContentHeader.js +4 -1
- package/dist/cjs/view/BlockCard/components/Emoji.js +5 -2
- package/dist/cjs/view/BlockCard/components/Frame.js +6 -5
- package/dist/cjs/view/BlockCard/components/Link.js +4 -1
- package/dist/cjs/view/BlockCard/components/Name.js +4 -1
- package/dist/cjs/view/BlockCard/components/Provider.js +6 -3
- package/dist/cjs/view/BlockCard/components/Thumbnail.js +6 -5
- package/dist/cjs/view/BlockCard/components/UnresolvedText.js +4 -1
- package/dist/cjs/view/BlockCard/index.js +19 -16
- package/dist/cjs/view/BlockCard/views/ErroredView.js +12 -11
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +12 -9
- package/dist/cjs/view/BlockCard/views/NotFoundView.js +11 -10
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +16 -13
- package/dist/cjs/view/BlockCard/views/ResolvingView.js +7 -4
- package/dist/cjs/view/BlockCard/views/UnauthorizedView.js +10 -9
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -4
- package/dist/cjs/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +5 -2
- package/dist/cjs/view/CardWithUrl/component.js +2 -0
- package/dist/cjs/view/CardWithUrl/loader.js +2 -0
- package/dist/cjs/view/EmbedCard/components/Frame.js +15 -12
- package/dist/cjs/view/EmbedCard/components/IframeDwellTracker.js +2 -0
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +8 -5
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +12 -9
- package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +10 -8
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +14 -11
- package/dist/cjs/view/EmbedModal/components/embed-content/index.js +2 -1
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +27 -24
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +5 -4
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +6 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +9 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +0 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +0 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +6 -5
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +6 -3
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/container/index.js +4 -3
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +6 -5
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +5 -4
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +4 -3
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +4 -3
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +10 -7
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +19 -16
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +14 -13
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +6 -4
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +12 -10
- package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/preview/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/elements/snippet-element/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +2 -1
- package/dist/cjs/view/HoverCard/components/CustomPopupContainer.js +3 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +29 -26
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +19 -16
- package/dist/cjs/view/HoverCard/components/views/resolving/index.js +15 -12
- package/dist/cjs/view/HoverCard/index.js +9 -6
- package/dist/cjs/view/InlineCard/Frame/index.js +4 -2
- package/dist/cjs/view/InlineCard/Frame/styled.js +13 -4
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +2 -0
- package/dist/cjs/view/InlineCard/index.js +2 -0
- package/dist/cjs/view/LinkUrl/LinkWarningModal/index.js +12 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/Byline.js +4 -1
- package/dist/cjs/view/common/Icon.js +5 -4
- package/dist/cjs/view/common/Metadata.js +7 -4
- package/dist/cjs/view/common/MetadataList.js +5 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/components/Action.js +5 -3
- package/dist/es2019/view/BlockCard/components/ActionList.js +10 -8
- package/dist/es2019/view/BlockCard/components/CollaboratorList.js +4 -2
- package/dist/es2019/view/BlockCard/components/Content.js +3 -1
- package/dist/es2019/view/BlockCard/components/ContentFooter.js +3 -1
- package/dist/es2019/view/BlockCard/components/ContentHeader.js +3 -1
- package/dist/es2019/view/BlockCard/components/Emoji.js +3 -1
- package/dist/es2019/view/BlockCard/components/Frame.js +5 -3
- package/dist/es2019/view/BlockCard/components/Link.js +3 -1
- package/dist/es2019/view/BlockCard/components/Name.js +3 -1
- package/dist/es2019/view/BlockCard/components/Provider.js +5 -3
- package/dist/es2019/view/BlockCard/components/Thumbnail.js +6 -4
- package/dist/es2019/view/BlockCard/components/UnresolvedText.js +3 -1
- package/dist/es2019/view/BlockCard/index.js +19 -16
- package/dist/es2019/view/BlockCard/views/ErroredView.js +10 -8
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +11 -9
- package/dist/es2019/view/BlockCard/views/NotFoundView.js +10 -8
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +15 -13
- package/dist/es2019/view/BlockCard/views/ResolvingView.js +6 -4
- package/dist/es2019/view/BlockCard/views/UnauthorizedView.js +10 -8
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +6 -5
- package/dist/es2019/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +4 -2
- package/dist/es2019/view/CardWithUrl/component.js +2 -0
- package/dist/es2019/view/CardWithUrl/loader.js +2 -0
- package/dist/es2019/view/EmbedCard/components/Frame.js +4 -2
- package/dist/es2019/view/EmbedCard/components/IframeDwellTracker.js +1 -0
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +7 -5
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +6 -4
- package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +10 -9
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +10 -8
- package/dist/es2019/view/EmbedModal/components/embed-content/index.js +4 -2
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +22 -20
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +6 -5
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +5 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +10 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +7 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +5 -3
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +5 -3
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +5 -4
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +7 -6
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +6 -5
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +5 -4
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +5 -4
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +6 -4
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +10 -8
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +7 -5
- package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/preview/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/elements/snippet-element/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +3 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +7 -5
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +9 -7
- package/dist/es2019/view/HoverCard/components/views/resolving/index.js +13 -11
- package/dist/es2019/view/HoverCard/index.js +6 -4
- package/dist/es2019/view/InlineCard/Frame/index.js +4 -2
- package/dist/es2019/view/InlineCard/Frame/styled.js +17 -5
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +2 -0
- package/dist/es2019/view/InlineCard/index.js +2 -0
- package/dist/es2019/view/LinkUrl/LinkWarningModal/index.js +11 -9
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/Byline.js +3 -1
- package/dist/es2019/view/common/Icon.js +6 -5
- package/dist/es2019/view/common/Metadata.js +6 -4
- package/dist/es2019/view/common/MetadataList.js +4 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/components/Action.js +5 -3
- package/dist/esm/view/BlockCard/components/ActionList.js +11 -9
- package/dist/esm/view/BlockCard/components/CollaboratorList.js +4 -2
- package/dist/esm/view/BlockCard/components/Content.js +3 -1
- package/dist/esm/view/BlockCard/components/ContentFooter.js +3 -1
- package/dist/esm/view/BlockCard/components/ContentHeader.js +3 -1
- package/dist/esm/view/BlockCard/components/Emoji.js +3 -1
- package/dist/esm/view/BlockCard/components/Frame.js +5 -3
- package/dist/esm/view/BlockCard/components/Link.js +3 -1
- package/dist/esm/view/BlockCard/components/Name.js +3 -1
- package/dist/esm/view/BlockCard/components/Provider.js +5 -3
- package/dist/esm/view/BlockCard/components/Thumbnail.js +6 -4
- package/dist/esm/view/BlockCard/components/UnresolvedText.js +3 -1
- package/dist/esm/view/BlockCard/index.js +19 -16
- package/dist/esm/view/BlockCard/views/ErroredView.js +10 -8
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +11 -9
- package/dist/esm/view/BlockCard/views/NotFoundView.js +10 -8
- package/dist/esm/view/BlockCard/views/ResolvedView.js +15 -13
- package/dist/esm/view/BlockCard/views/ResolvingView.js +6 -4
- package/dist/esm/view/BlockCard/views/UnauthorizedView.js +10 -8
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +6 -5
- package/dist/esm/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +4 -2
- package/dist/esm/view/CardWithUrl/component.js +2 -0
- package/dist/esm/view/CardWithUrl/loader.js +2 -0
- package/dist/esm/view/EmbedCard/components/Frame.js +4 -2
- package/dist/esm/view/EmbedCard/components/IframeDwellTracker.js +1 -0
- package/dist/esm/view/EmbedCard/views/ErroredView.js +7 -5
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +6 -4
- package/dist/esm/view/EmbedCard/views/UnresolvedView.js +10 -9
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +10 -8
- package/dist/esm/view/EmbedModal/components/embed-content/index.js +4 -2
- package/dist/esm/view/EmbedModal/components/link-info/index.js +22 -20
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +6 -5
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +10 -9
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +0 -2
- package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +0 -2
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +7 -6
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/container/index.js +5 -4
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +7 -6
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +6 -5
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +5 -4
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +5 -4
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +6 -4
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +10 -8
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +5 -4
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +7 -5
- package/dist/esm/view/FlexibleCard/components/elements/media/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/preview/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/elements/snippet-element/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +3 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +7 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +9 -7
- package/dist/esm/view/HoverCard/components/views/resolving/index.js +13 -11
- package/dist/esm/view/HoverCard/index.js +6 -4
- package/dist/esm/view/InlineCard/Frame/index.js +4 -2
- package/dist/esm/view/InlineCard/Frame/styled.js +13 -4
- package/dist/esm/view/InlineCard/ResolvedView/index.js +2 -0
- package/dist/esm/view/InlineCard/index.js +2 -0
- package/dist/esm/view/LinkUrl/LinkWarningModal/index.js +11 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/Byline.js +3 -1
- package/dist/esm/view/common/Icon.js +6 -5
- package/dist/esm/view/common/Metadata.js +6 -4
- package/dist/esm/view/common/MetadataList.js +4 -2
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -0
- package/dist/types/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject;
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { useIntl, FormattedMessage } from 'react-intl-next';
|
|
6
|
-
import { css } from '@emotion/react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
7
8
|
import { getTruncateStyles } from '../../utils';
|
|
8
9
|
import { tokens } from '../../../../../utils/token';
|
|
9
10
|
import { selectUnit } from '@formatjs/intl-utils';
|
|
@@ -65,13 +66,13 @@ var DateTime = function DateTime(_ref) {
|
|
|
65
66
|
numeric: 'auto'
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
return
|
|
69
|
+
return jsx("span", {
|
|
69
70
|
css: [styles, overrideCss],
|
|
70
71
|
"data-separator": true,
|
|
71
72
|
"data-smart-element": name,
|
|
72
73
|
"data-smart-element-date-time": true,
|
|
73
74
|
"data-testid": testId
|
|
74
|
-
}, text ? "".concat(text, " ").concat(context) :
|
|
75
|
+
}, text ? "".concat(text, " ").concat(context) : jsx(FormattedMessage, _extends({}, typeToDescriptorMap[type][typeVariant], {
|
|
75
76
|
values: {
|
|
76
77
|
context: context
|
|
77
78
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React, { useMemo } from 'react';
|
|
4
5
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import { SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
7
8
|
import AtlaskitIcon from '../../common/atlaskit-icon';
|
|
8
9
|
import ImageIcon from '../../common/image-icon';
|
|
@@ -24,7 +25,7 @@ var getCustomRenderStyles = function getCustomRenderStyles(value) {
|
|
|
24
25
|
};
|
|
25
26
|
var renderAtlaskitIcon = function renderAtlaskitIcon(icon, label, testId) {
|
|
26
27
|
if (icon) {
|
|
27
|
-
return
|
|
28
|
+
return jsx(AtlaskitIcon, {
|
|
28
29
|
icon: icon,
|
|
29
30
|
label: label,
|
|
30
31
|
testId: "".concat(testId, "-icon")
|
|
@@ -32,14 +33,14 @@ var renderAtlaskitIcon = function renderAtlaskitIcon(icon, label, testId) {
|
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
var renderDefaultIcon = function renderDefaultIcon(label, testId) {
|
|
35
|
-
return
|
|
36
|
+
return jsx(LinkIcon, {
|
|
36
37
|
label: label,
|
|
37
38
|
testId: "".concat(testId, "-default")
|
|
38
39
|
});
|
|
39
40
|
};
|
|
40
41
|
var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
41
42
|
if (url) {
|
|
42
|
-
return
|
|
43
|
+
return jsx(ImageIcon, {
|
|
43
44
|
defaultIcon: defaultIcon,
|
|
44
45
|
testId: testId,
|
|
45
46
|
url: url
|
|
@@ -74,7 +75,7 @@ var Icon = function Icon(_ref) {
|
|
|
74
75
|
var width = getIconWidth(size);
|
|
75
76
|
var styles = getIconStyles(position, width);
|
|
76
77
|
var renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
77
|
-
return
|
|
78
|
+
return jsx("div", {
|
|
78
79
|
css: [styles, renderStyles, overrideCss],
|
|
79
80
|
"data-fit-to-content": true,
|
|
80
81
|
"data-smart-element": name,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React, { useMemo } from 'react';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
8
|
import { SmartLinkInternalTheme, SmartLinkSize, SmartLinkTheme } from '../../../../../constants';
|
|
8
9
|
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles, hasWhiteSpace } from '../../utils';
|
|
@@ -40,7 +41,7 @@ var getMaxLines = function getMaxLines(maxLines) {
|
|
|
40
41
|
return maxLines;
|
|
41
42
|
};
|
|
42
43
|
var withTooltip = function withTooltip(trigger, content, testId) {
|
|
43
|
-
return
|
|
44
|
+
return jsx(Tooltip, {
|
|
44
45
|
content: content,
|
|
45
46
|
testId: "".concat(testId, "-tooltip"),
|
|
46
47
|
tag: "span"
|
|
@@ -74,7 +75,7 @@ var Link = function Link(_ref) {
|
|
|
74
75
|
var hasSpace = useMemo(function () {
|
|
75
76
|
return text ? hasWhiteSpace(text) : false;
|
|
76
77
|
}, [text]);
|
|
77
|
-
var anchor =
|
|
78
|
+
var anchor = jsx("a", _extends({
|
|
78
79
|
css: [getAnchorStyles(size, theme, getMaxLines(maxLines), hasSpace), overrideCss],
|
|
79
80
|
"data-smart-element": name,
|
|
80
81
|
"data-smart-element-link": true,
|
|
@@ -87,7 +88,7 @@ var Link = function Link(_ref) {
|
|
|
87
88
|
}, target !== '_self' && {
|
|
88
89
|
target: target
|
|
89
90
|
}), text);
|
|
90
|
-
return
|
|
91
|
+
return jsx("span", {
|
|
91
92
|
css: containerStyles
|
|
92
93
|
}, hideTooltip || text === undefined ? anchor : withTooltip(anchor, text, testId));
|
|
93
94
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import AtlaskitLozenge from '@atlaskit/lozenge';
|
|
6
7
|
import LozengeAction from './lozenge-action';
|
|
7
8
|
import { useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -26,17 +27,17 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
26
27
|
if (!text) {
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
|
-
var lozenge = action ?
|
|
30
|
+
var lozenge = action ? jsx(LozengeAction, {
|
|
30
31
|
action: action,
|
|
31
32
|
appearance: appearance,
|
|
32
33
|
testId: testId,
|
|
33
34
|
text: text,
|
|
34
35
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
35
|
-
}) :
|
|
36
|
+
}) : jsx(AtlaskitLozenge, {
|
|
36
37
|
appearance: appearance,
|
|
37
38
|
testId: "".concat(testId, "-lozenge")
|
|
38
39
|
}, text);
|
|
39
|
-
return
|
|
40
|
+
return jsx("span", {
|
|
40
41
|
css: [styles, overrideCss],
|
|
41
42
|
"data-fit-to-content": true,
|
|
42
43
|
"data-smart-element": name,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
2
4
|
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
3
5
|
import { getPulseStyles } from './styled';
|
|
@@ -37,7 +39,7 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
37
39
|
}, [storageClient, discovered]);
|
|
38
40
|
var component = useMemo(function () {
|
|
39
41
|
if (!discovered) {
|
|
40
|
-
return
|
|
42
|
+
return jsx("span", {
|
|
41
43
|
css: getPulseStyles(appearance),
|
|
42
44
|
"data-testid": "".concat(testId, "-discovery")
|
|
43
45
|
}, children);
|
|
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
5
7
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
8
|
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
7
9
|
import LozengeActionTrigger from './lozenge-action-trigger';
|
|
@@ -133,7 +135,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
133
135
|
};
|
|
134
136
|
}(), [action.read, analytics, invoke, isLoaded, text]);
|
|
135
137
|
var trigger = useCallback(function (props) {
|
|
136
|
-
return
|
|
138
|
+
return jsx(LozengeActionTrigger, _extends({}, props, {
|
|
137
139
|
appearance: selected.appearance,
|
|
138
140
|
isOpen: isOpen,
|
|
139
141
|
showFeatureDiscovery: action === null || action === void 0 ? void 0 : action.showFeatureDiscovery,
|
|
@@ -202,7 +204,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
202
204
|
}(), [action === null || action === void 0 ? void 0 : action.update, analytics, invoke, linkId, reload, url]);
|
|
203
205
|
var dropdownItemGroup = useMemo(function () {
|
|
204
206
|
if (errorMessage) {
|
|
205
|
-
return
|
|
207
|
+
return jsx(LozengeActionError, {
|
|
206
208
|
errorMessage: errorMessage,
|
|
207
209
|
testId: testId,
|
|
208
210
|
url: url,
|
|
@@ -210,14 +212,14 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
210
212
|
});
|
|
211
213
|
}
|
|
212
214
|
if (items && items.length > 0) {
|
|
213
|
-
return
|
|
215
|
+
return jsx(LozengeActionItemsGroup, {
|
|
214
216
|
testId: testId,
|
|
215
217
|
items: items,
|
|
216
218
|
onClick: handleItemClick
|
|
217
219
|
});
|
|
218
220
|
}
|
|
219
221
|
}, [errorMessage, handleItemClick, items, previewData, testId, url]);
|
|
220
|
-
return
|
|
222
|
+
return jsx(DropdownMenu, {
|
|
221
223
|
isLoading: isLoading,
|
|
222
224
|
isOpen: isOpen,
|
|
223
225
|
onOpenChange: handleOpenChange,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
4
6
|
import { Fragment, useMemo, useCallback } from 'react';
|
|
5
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
8
|
import { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
@@ -37,29 +39,29 @@ var LozengeActionError = function LozengeActionError(_ref) {
|
|
|
37
39
|
}
|
|
38
40
|
}, [analytics, handlePreviewClose, isPreviewAvailable, previewData]);
|
|
39
41
|
var content = useMemo(function () {
|
|
40
|
-
return
|
|
42
|
+
return jsx(Fragment, null, jsx("div", {
|
|
41
43
|
css: contentStyles
|
|
42
|
-
},
|
|
44
|
+
}, jsx(ErrorIcon, {
|
|
43
45
|
testId: "".concat(testId, "-icon"),
|
|
44
46
|
size: "medium",
|
|
45
47
|
primaryColor: "var(--ds-icon-danger, ".concat(R500, ")"),
|
|
46
48
|
secondaryColor: "var(--ds-background-danger, ".concat(R50, ")"),
|
|
47
49
|
label: 'error'
|
|
48
|
-
}),
|
|
50
|
+
}), jsx("span", {
|
|
49
51
|
css: textStyles(maxLineNumber),
|
|
50
52
|
"data-testid": "".concat(testId, "-error-message")
|
|
51
|
-
}, typeof errorMessage === 'string' ? errorMessage : getFormattedMessage(errorMessage))), isPreviewAvailable ?
|
|
53
|
+
}, typeof errorMessage === 'string' ? errorMessage : getFormattedMessage(errorMessage))), isPreviewAvailable ? jsx("div", {
|
|
52
54
|
css: linkStyles
|
|
53
|
-
},
|
|
55
|
+
}, jsx("a", {
|
|
54
56
|
target: "_blank",
|
|
55
57
|
"data-testid": "".concat(testId, "-open-embed"),
|
|
56
58
|
onClick: handlePreviewOpen
|
|
57
|
-
},
|
|
59
|
+
}, jsx(FormattedMessage, messages.open_issue_in_jira))) : null);
|
|
58
60
|
}, [errorMessage, handlePreviewOpen, isPreviewAvailable, maxLineNumber, testId]);
|
|
59
|
-
return
|
|
61
|
+
return jsx("span", {
|
|
60
62
|
css: dropdownItemGroupStyles,
|
|
61
63
|
"data-testid": "".concat(testId, "-error-item-group")
|
|
62
|
-
},
|
|
64
|
+
}, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
|
|
63
65
|
testId: "".concat(testId, "-error")
|
|
64
66
|
}, content)));
|
|
65
67
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import LozengeActionItem from '../lozenge-action-item';
|
|
3
5
|
import { dropdownItemGroupStyles } from '../styled';
|
|
4
6
|
import { DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
@@ -7,13 +9,12 @@ var LozengeActionItemsGroup = function LozengeActionItemsGroup(_ref) {
|
|
|
7
9
|
testId = _ref.testId,
|
|
8
10
|
onClick = _ref.onClick;
|
|
9
11
|
return (
|
|
10
|
-
/*#__PURE__*/
|
|
11
12
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
12
|
-
|
|
13
|
+
jsx("span", {
|
|
13
14
|
css: dropdownItemGroupStyles,
|
|
14
15
|
"data-testid": "".concat(testId, "-item-group")
|
|
15
|
-
},
|
|
16
|
-
return
|
|
16
|
+
}, jsx(DropdownItemGroup, null, items.map(function (item, idx) {
|
|
17
|
+
return jsx(LozengeActionItem, _extends({}, item, {
|
|
17
18
|
key: idx,
|
|
18
19
|
onClick: onClick,
|
|
19
20
|
testId: "".concat(testId, "-item-").concat(idx)
|
|
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["appearance", "isOpen", "showFeatureDiscovery", "testId", "text", "triggerRef"];
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
5
7
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
8
|
import Lozenge from '@atlaskit/lozenge';
|
|
7
9
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
@@ -26,17 +28,17 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
26
28
|
return setIsBold(false);
|
|
27
29
|
}, []);
|
|
28
30
|
var lozenge = useMemo(function () {
|
|
29
|
-
return
|
|
31
|
+
return jsx(Lozenge, {
|
|
30
32
|
appearance: appearance,
|
|
31
33
|
isBold: isBold
|
|
32
|
-
},
|
|
34
|
+
}, jsx("span", {
|
|
33
35
|
css: triggerLozengeStyles
|
|
34
|
-
},
|
|
36
|
+
}, jsx("span", null, text), jsx(ChevronDownIcon, {
|
|
35
37
|
label: "options",
|
|
36
38
|
size: "medium"
|
|
37
39
|
})));
|
|
38
40
|
}, [appearance, isBold, text]);
|
|
39
|
-
return
|
|
41
|
+
return jsx("button", _extends({
|
|
40
42
|
type: "button"
|
|
41
43
|
}, props, {
|
|
42
44
|
css: triggerButtonStyles,
|
|
@@ -45,7 +47,7 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
45
47
|
onMouseEnter: onMouseEnter,
|
|
46
48
|
onMouseLeave: onMouseLeave,
|
|
47
49
|
ref: triggerRef
|
|
48
|
-
}), showFeatureDiscovery ?
|
|
50
|
+
}), showFeatureDiscovery ? jsx(FeatureDiscovery, {
|
|
49
51
|
appearance: appearance,
|
|
50
52
|
testId: testId
|
|
51
53
|
}, lozenge) : lozenge);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import ImageIcon from '../../common/image-icon';
|
|
6
7
|
/**
|
|
7
8
|
* Media: Image
|
|
@@ -33,12 +34,12 @@ var Media = function Media(_ref) {
|
|
|
33
34
|
if (!type || !url) {
|
|
34
35
|
return null;
|
|
35
36
|
}
|
|
36
|
-
return
|
|
37
|
+
return jsx("div", {
|
|
37
38
|
css: [styles, overrideCss],
|
|
38
39
|
"data-smart-element": name,
|
|
39
40
|
"data-smart-element-media": type,
|
|
40
41
|
"data-testid": testId
|
|
41
|
-
},
|
|
42
|
+
}, jsx(ImageIcon, {
|
|
42
43
|
testId: "".concat(testId, "-image"),
|
|
43
44
|
url: url,
|
|
44
45
|
onError: onError,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["overrideUrl"];
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React, { useContext } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
5
7
|
import { FlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
6
8
|
import { MediaType } from '../../../../../constants';
|
|
7
9
|
import Media from '../media';
|
|
@@ -17,6 +19,6 @@ var Preview = function Preview(props) {
|
|
|
17
19
|
if (!data) {
|
|
18
20
|
return null;
|
|
19
21
|
}
|
|
20
|
-
return
|
|
22
|
+
return jsx(Media, _extends({}, rest, data));
|
|
21
23
|
};
|
|
22
24
|
export default Preview;
|
|
@@ -3,7 +3,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
var _excluded = ["content", "maxLines", "overrideCss"];
|
|
5
5
|
var _templateObject;
|
|
6
|
-
|
|
6
|
+
/** @jsx jsx */
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
7
8
|
import React, { useContext } from 'react';
|
|
8
9
|
import { FlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
9
10
|
import Text from '../text';
|
|
@@ -19,7 +20,7 @@ var SnippetElement = function SnippetElement() {
|
|
|
19
20
|
overrideCss = _ref.overrideCss,
|
|
20
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
22
|
var context = useContext(FlexibleUiContext);
|
|
22
|
-
return
|
|
23
|
+
return jsx(Text, _extends({
|
|
23
24
|
content: overrideContent !== null && overrideContent !== void 0 ? overrideContent : context === null || context === void 0 ? void 0 : context.snippet,
|
|
24
25
|
maxLines: maxLines,
|
|
25
26
|
overrideCss: getSnippetStyles(overrideCss)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import { getFormattedMessage, getTruncateStyles } from '../../utils';
|
|
6
7
|
import { tokens } from '../../../../../utils/token';
|
|
7
8
|
var getStyles = function getStyles(maxLines) {
|
|
@@ -26,7 +27,7 @@ var Text = function Text(_ref) {
|
|
|
26
27
|
if (!message && !content) {
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
|
-
return
|
|
30
|
+
return jsx("span", {
|
|
30
31
|
css: [getStyles(maxLines), overrideCss],
|
|
31
32
|
"data-separator": true,
|
|
32
33
|
"data-smart-element": name,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["children"];
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { popupContainerStyles } from '../styled';
|
|
7
|
+
import { jsx } from '@emotion/react';
|
|
6
8
|
var CustomPopupContainer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
7
9
|
var children = _ref.children,
|
|
8
10
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
-
return
|
|
11
|
+
return jsx("div", _extends({
|
|
10
12
|
css: popupContainerStyles
|
|
11
13
|
}, props, {
|
|
12
14
|
ref: ref
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import Popup from '@atlaskit/popup';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
4
6
|
import React, { useCallback, useMemo, useRef, useEffect } from 'react';
|
|
5
7
|
import { useSmartLinkActions } from '../../../state/hooks-external/useSmartLinkActions';
|
|
6
8
|
import { useSmartLinkRenderers } from '../../../state/renderers';
|
|
@@ -199,17 +201,17 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
199
201
|
url: url,
|
|
200
202
|
id: id
|
|
201
203
|
};
|
|
202
|
-
return
|
|
204
|
+
return jsx(SmartLinkAnalyticsContext, {
|
|
203
205
|
url: url,
|
|
204
206
|
display: CardDisplay.HoverCardPreview,
|
|
205
207
|
id: id,
|
|
206
208
|
source: HOVER_CARD_SOURCE
|
|
207
|
-
},
|
|
209
|
+
}, jsx(HoverCardContent, hoverCardContentProps));
|
|
208
210
|
}, [initShowCard, initHideCard, filteredActions, linkState, onActionClick, renderers, showServerActions, url, id]);
|
|
209
211
|
var trigger = useCallback(function (triggerProps) {
|
|
210
|
-
return
|
|
212
|
+
return jsx("span", {
|
|
211
213
|
ref: parentSpan
|
|
212
|
-
},
|
|
214
|
+
}, jsx("span", _extends({}, triggerProps, {
|
|
213
215
|
onMouseOver: initShowCard,
|
|
214
216
|
onMouseLeave: initHideCard,
|
|
215
217
|
onMouseMove: setMousePosition,
|
|
@@ -218,7 +220,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
218
220
|
"data-testid": "hover-card-trigger-wrapper"
|
|
219
221
|
}), children));
|
|
220
222
|
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition]);
|
|
221
|
-
return
|
|
223
|
+
return jsx(Popup, {
|
|
222
224
|
testId: "hover-card",
|
|
223
225
|
isOpen: isOpen && canOpen,
|
|
224
226
|
onClose: hideCard,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
6
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
5
7
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
@@ -23,7 +25,7 @@ export var hoverCardClassName = 'smart-links-hover-preview';
|
|
|
23
25
|
export var getCopyAction = function getCopyAction(url) {
|
|
24
26
|
return {
|
|
25
27
|
name: ActionName.CustomAction,
|
|
26
|
-
icon:
|
|
28
|
+
icon: jsx(CopyIcon, {
|
|
27
29
|
label: "copy url",
|
|
28
30
|
size: "medium"
|
|
29
31
|
}),
|
|
@@ -48,7 +50,7 @@ export var getCopyAction = function getCopyAction(url) {
|
|
|
48
50
|
}
|
|
49
51
|
return onClick;
|
|
50
52
|
}(),
|
|
51
|
-
tooltipMessage:
|
|
53
|
+
tooltipMessage: jsx(FormattedMessage, messages.copy_url_to_clipboard),
|
|
52
54
|
testId: 'hover-card-copy-button'
|
|
53
55
|
};
|
|
54
56
|
};
|
|
@@ -155,13 +157,13 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
155
157
|
}, []);
|
|
156
158
|
var getCardView = function getCardView(cardState) {
|
|
157
159
|
if (cardState.metadataStatus === 'pending') {
|
|
158
|
-
return
|
|
160
|
+
return jsx(HoverCardLoadingView, {
|
|
159
161
|
flexibleCardProps: flexibleCardProps,
|
|
160
162
|
titleBlockProps: titleBlockProps
|
|
161
163
|
});
|
|
162
164
|
}
|
|
163
165
|
if (cardState.status === 'unauthorized' && services !== null && services !== void 0 && services.length) {
|
|
164
|
-
return
|
|
166
|
+
return jsx(HoverCardUnauthorisedView, {
|
|
165
167
|
analytics: analytics,
|
|
166
168
|
extensionKey: extensionKey,
|
|
167
169
|
id: id,
|
|
@@ -171,13 +173,13 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
171
173
|
}
|
|
172
174
|
if (getBooleanFF('platform.linking-platform.smart-card.cross-join')) {
|
|
173
175
|
if (cardState.status === 'forbidden' || cardState.status === 'not_found') {
|
|
174
|
-
return
|
|
176
|
+
return jsx(HoverCardForbiddenView, {
|
|
175
177
|
flexibleCardProps: flexibleCardProps
|
|
176
178
|
});
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
181
|
if (cardState.status === 'resolved') {
|
|
180
|
-
return
|
|
182
|
+
return jsx(HoverCardResolvedView, {
|
|
181
183
|
id: id,
|
|
182
184
|
url: url,
|
|
183
185
|
extensionKey: extensionKey,
|
|
@@ -192,7 +194,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
192
194
|
return null;
|
|
193
195
|
};
|
|
194
196
|
var cardView = getCardView(cardState);
|
|
195
|
-
return cardView ?
|
|
197
|
+
return cardView ? jsx("div", {
|
|
196
198
|
onMouseEnter: onMouseEnter,
|
|
197
199
|
onMouseLeave: onMouseLeave,
|
|
198
200
|
onClick: onClickStopPropagation,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import LoadingSkeleton from '../../../../FlexibleCard/components/common/loading-skeleton';
|
|
4
6
|
import { CARD_WIDTH_REM } from '../../../styled';
|
|
@@ -13,35 +15,35 @@ var HoverCardLoadingView = function HoverCardLoadingView(_ref) {
|
|
|
13
15
|
var skeletonWidth = CARD_WIDTH_REM - 2;
|
|
14
16
|
var size = titleBlockProps.size,
|
|
15
17
|
actions = titleBlockProps.actions;
|
|
16
|
-
var actionGroup = (actions === null || actions === void 0 ? void 0 : actions.length) && (actions === null || actions === void 0 ? void 0 : actions.length) > 0 &&
|
|
18
|
+
var actionGroup = (actions === null || actions === void 0 ? void 0 : actions.length) && (actions === null || actions === void 0 ? void 0 : actions.length) > 0 && jsx(ActionGroup, {
|
|
17
19
|
items: actions,
|
|
18
20
|
visibleButtonsNum: 2
|
|
19
21
|
});
|
|
20
|
-
return
|
|
22
|
+
return jsx("div", {
|
|
21
23
|
css: loadingViewContainer,
|
|
22
24
|
"data-testid": testId
|
|
23
|
-
},
|
|
25
|
+
}, jsx("div", {
|
|
24
26
|
css: skeletonContainer
|
|
25
|
-
},
|
|
27
|
+
}, jsx(CustomBlock, _extends({}, titleBlockProps, {
|
|
26
28
|
overrideCss: titleBlockStyles,
|
|
27
29
|
testId: "".concat(testId, "-title-block")
|
|
28
|
-
}),
|
|
30
|
+
}), jsx(Icon, {
|
|
29
31
|
render: function render() {
|
|
30
|
-
return
|
|
32
|
+
return jsx(LoadingSkeleton, null);
|
|
31
33
|
},
|
|
32
34
|
size: size
|
|
33
|
-
}),
|
|
35
|
+
}), jsx("span", {
|
|
34
36
|
css: getTitleStyles(lineHeightRem),
|
|
35
37
|
"data-testid": "".concat(testId, "-title")
|
|
36
|
-
},
|
|
38
|
+
}, jsx(LoadingSkeleton, {
|
|
37
39
|
height: lineHeightRem
|
|
38
|
-
})), actionGroup),
|
|
40
|
+
})), actionGroup), jsx(LoadingSkeleton, {
|
|
39
41
|
width: skeletonWidth,
|
|
40
42
|
height: lineHeightRem
|
|
41
|
-
}),
|
|
43
|
+
}), jsx(LoadingSkeleton, {
|
|
42
44
|
width: skeletonWidth,
|
|
43
45
|
height: lineHeightRem * 3
|
|
44
|
-
}),
|
|
46
|
+
}), jsx(LoadingSkeleton, {
|
|
45
47
|
width: skeletonWidth,
|
|
46
48
|
height: lineHeightRem
|
|
47
49
|
})));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { useCallback } from 'react';
|
|
3
5
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
6
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
@@ -17,10 +19,10 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
17
19
|
errorInfo: info
|
|
18
20
|
});
|
|
19
21
|
}, [analytics.ui, id]);
|
|
20
|
-
return
|
|
22
|
+
return jsx(ErrorBoundary, {
|
|
21
23
|
fallback: children,
|
|
22
24
|
onError: onError
|
|
23
|
-
},
|
|
25
|
+
}, jsx(HoverCardComponent, props, children));
|
|
24
26
|
};
|
|
25
27
|
var HoverCardWithoutAnalyticsContext = withAnalyticsEvents()(HoverCardWithErrorBoundary);
|
|
26
28
|
|
|
@@ -32,12 +34,12 @@ var HoverCardWithoutAnalyticsContext = withAnalyticsEvents()(HoverCardWithErrorB
|
|
|
32
34
|
* use to configure hover preview behaviour.
|
|
33
35
|
*/
|
|
34
36
|
export var HoverCard = function HoverCard(props) {
|
|
35
|
-
return
|
|
37
|
+
return jsx(HoverCardWithoutAnalyticsContext, props);
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
/**
|
|
39
41
|
* A standalone hover preview component
|
|
40
42
|
*/
|
|
41
43
|
export var StandaloneHoverCard = function StandaloneHoverCard(props) {
|
|
42
|
-
return
|
|
44
|
+
return jsx(HoverCard, props);
|
|
43
45
|
};
|
|
@@ -9,7 +9,8 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
9
9
|
link = props.link,
|
|
10
10
|
withoutBackground = props.withoutBackground,
|
|
11
11
|
testId = props.testId,
|
|
12
|
-
className = props.className
|
|
12
|
+
className = props.className,
|
|
13
|
+
isHovered = props.isHovered;
|
|
13
14
|
var handleClick = useCallback(function (event) {
|
|
14
15
|
if (onClick) {
|
|
15
16
|
event.preventDefault();
|
|
@@ -48,6 +49,7 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
48
49
|
onKeyPress: handleKeyPress,
|
|
49
50
|
"data-testid": testId,
|
|
50
51
|
className: className,
|
|
51
|
-
ref: ref
|
|
52
|
+
ref: ref,
|
|
53
|
+
isHovered: isHovered
|
|
52
54
|
}, children);
|
|
53
55
|
});
|