@atlaskit/smart-card 23.14.0 → 23.14.2
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/__tests_external__/index.js +0 -6
- package/dist/cjs/__tests_external__/page-objects/BaseCard.js +6 -26
- package/dist/cjs/__tests_external__/page-objects/BlockCard.js +0 -15
- package/dist/cjs/__tests_external__/page-objects/EmbedCard.js +0 -15
- package/dist/cjs/__tests_external__/page-objects/InlineCard.js +0 -15
- package/dist/cjs/__tests_external__/test-cases/card.js +2 -6
- package/dist/cjs/__tests_external__/test-cases/embed.js +1 -5
- package/dist/cjs/__tests_external__/test-cases/inline.js +2 -6
- package/dist/cjs/classNames.js +0 -11
- package/dist/cjs/client/index.js +0 -1
- package/dist/cjs/constants.js +1 -36
- package/dist/cjs/extractors/block/index.js +2 -29
- package/dist/cjs/extractors/common/actions/extractActions.js +2 -20
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +18 -34
- package/dist/cjs/extractors/common/byline/extractByline.js +4 -15
- package/dist/cjs/extractors/common/context/extractAccessContext.js +2 -17
- package/dist/cjs/extractors/common/context/index.js +0 -1
- package/dist/cjs/extractors/common/detail/extractAttachmentCount.js +0 -7
- package/dist/cjs/extractors/common/detail/extractCommentCount.js +0 -7
- package/dist/cjs/extractors/common/detail/extractDownloadUrl.js +0 -2
- package/dist/cjs/extractors/common/detail/extractProgrammingLanguage.js +0 -7
- package/dist/cjs/extractors/common/detail/extractSubscriberCount.js +0 -7
- package/dist/cjs/extractors/common/detail/index.js +0 -5
- package/dist/cjs/extractors/common/icon/extractFileFormat.js +0 -2
- package/dist/cjs/extractors/common/icon/extractIcon.js +0 -26
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +2 -22
- package/dist/cjs/extractors/common/icon/extractIconFromTask.js +1 -28
- package/dist/cjs/extractors/common/icon/index.js +0 -4
- package/dist/cjs/extractors/common/lozenge/extractLozenge.js +0 -15
- package/dist/cjs/extractors/common/lozenge/extractLozengeText.js +1 -6
- package/dist/cjs/extractors/common/lozenge/extractState.js +0 -5
- package/dist/cjs/extractors/common/lozenge/extractTag.js +0 -6
- package/dist/cjs/extractors/common/lozenge/extractTaskStatus.js +0 -3
- package/dist/cjs/extractors/common/lozenge/extractTaskType.js +0 -4
- package/dist/cjs/extractors/common/lozenge/index.js +0 -5
- package/dist/cjs/extractors/common/lozenge/utils.js +0 -2
- package/dist/cjs/extractors/common/meta/extractIsTrusted.js +0 -2
- package/dist/cjs/extractors/common/primitives/extractSummary.js +0 -2
- package/dist/cjs/extractors/common/primitives/extractTitleTextColor.js +0 -7
- package/dist/cjs/extractors/common/primitives/extractVisitUrl.js +0 -2
- package/dist/cjs/extractors/common/primitives/index.js +0 -2
- package/dist/cjs/extractors/common/title-prefix/extractTitlePrefix.js +0 -6
- package/dist/cjs/extractors/common/title-prefix/index.js +0 -1
- package/dist/cjs/extractors/constants.js +2 -2
- package/dist/cjs/extractors/embed/index.js +0 -10
- package/dist/cjs/extractors/flexible/actions/extract-download-action.js +0 -6
- package/dist/cjs/extractors/flexible/actions/extract-preview-action.js +0 -9
- package/dist/cjs/extractors/flexible/actions/extract-view-action.js +0 -6
- package/dist/cjs/extractors/flexible/collaboratorGroup/index.js +0 -4
- package/dist/cjs/extractors/flexible/extract-preview.js +0 -4
- package/dist/cjs/extractors/flexible/extract-priority.js +0 -7
- package/dist/cjs/extractors/flexible/icon/extract-document-type-icon.js +0 -10
- package/dist/cjs/extractors/flexible/icon/extract-file-formatIcon.js +0 -25
- package/dist/cjs/extractors/flexible/icon/extract-icon-renderer.js +0 -5
- package/dist/cjs/extractors/flexible/icon/extract-jira-task-icon.js +0 -12
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +4 -35
- package/dist/cjs/extractors/flexible/icon/extract-provider-icon.js +0 -11
- package/dist/cjs/extractors/flexible/icon/extract-url-icon.js +0 -3
- package/dist/cjs/extractors/flexible/icon/index.js +4 -20
- package/dist/cjs/extractors/flexible/index.js +0 -17
- package/dist/cjs/extractors/flexible/latest-commit/index.js +0 -4
- package/dist/cjs/extractors/flexible/utils.js +0 -33
- package/dist/cjs/extractors/hover/extractMetadata.js +0 -5
- package/dist/cjs/extractors/index.js +4 -16
- package/dist/cjs/extractors/inline/index.js +0 -12
- package/dist/cjs/hooks.js +0 -2
- package/dist/cjs/hoverCard.js +0 -1
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -30
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/in-product.js +0 -1
- package/dist/cjs/index.js +0 -12
- package/dist/cjs/linkUrl.js +0 -2
- package/dist/cjs/messages.js +0 -2
- package/dist/cjs/ssr.js +4 -23
- package/dist/cjs/state/actions/index.js +36 -76
- package/dist/cjs/state/analytics/index.js +0 -2
- package/dist/cjs/state/analytics/ufoExperiences.js +0 -11
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +165 -205
- package/dist/cjs/state/config/index.js +0 -5
- package/dist/cjs/state/flexible-ui-context/index.js +1 -7
- package/dist/cjs/state/flexible-ui-context/utils.js +0 -2
- package/dist/cjs/state/helpers.js +3 -39
- package/dist/cjs/state/hooks/index.js +0 -2
- package/dist/cjs/state/hooks/usePrefetch.js +10 -31
- package/dist/cjs/state/hooks/useSmartLink.js +11 -23
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +12 -29
- package/dist/cjs/state/hooks-external/useSmartLinkReload.js +1 -7
- package/dist/cjs/state/index.js +0 -3
- package/dist/cjs/state/renderers/index.js +0 -4
- package/dist/cjs/state/store/index.js +7 -15
- package/dist/cjs/utils/analytics/analytics.js +133 -197
- package/dist/cjs/utils/analytics/index.js +8 -18
- package/dist/cjs/utils/flexible.js +0 -20
- package/dist/cjs/utils/index.js +5 -54
- package/dist/cjs/utils/jsonld.js +0 -11
- package/dist/cjs/utils/mocks.js +0 -35
- package/dist/cjs/utils/performance.js +0 -23
- package/dist/cjs/utils/test-utils.js +0 -10
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/AuthorizeAction.js +0 -6
- package/dist/cjs/view/BlockCard/actions/DownloadAction.js +0 -15
- package/dist/cjs/view/BlockCard/actions/ForbiddenAction.js +0 -7
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +2 -30
- package/dist/cjs/view/BlockCard/actions/RetryAction.js +0 -11
- package/dist/cjs/view/BlockCard/actions/ViewAction.js +0 -14
- package/dist/cjs/view/BlockCard/actions/flexible/AuthorizeAction.js +0 -8
- package/dist/cjs/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -8
- package/dist/cjs/view/BlockCard/actions/flexible/RetryAction.js +0 -7
- package/dist/cjs/view/BlockCard/components/Action.js +8 -19
- package/dist/cjs/view/BlockCard/components/ActionIcon.js +0 -10
- package/dist/cjs/view/BlockCard/components/ActionList.js +1 -17
- package/dist/cjs/view/BlockCard/components/CollaboratorList.js +7 -14
- package/dist/cjs/view/BlockCard/components/Content.js +3 -7
- package/dist/cjs/view/BlockCard/components/ContentFooter.js +3 -7
- package/dist/cjs/view/BlockCard/components/ContentHeader.js +3 -6
- package/dist/cjs/view/BlockCard/components/Emoji.js +1 -6
- package/dist/cjs/view/BlockCard/components/Frame.js +10 -24
- package/dist/cjs/view/BlockCard/components/Link.js +4 -7
- package/dist/cjs/view/BlockCard/components/Name.js +5 -10
- package/dist/cjs/view/BlockCard/components/Provider.js +2 -8
- package/dist/cjs/view/BlockCard/components/Thumbnail.js +3 -15
- package/dist/cjs/view/BlockCard/components/UnresolvedText.js +2 -4
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +7 -19
- package/dist/cjs/view/BlockCard/index.js +17 -68
- package/dist/cjs/view/BlockCard/utils/handlers.js +0 -2
- package/dist/cjs/view/BlockCard/views/ErroredView.js +10 -36
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +20 -42
- package/dist/cjs/view/BlockCard/views/NotFoundView.js +11 -36
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +34 -57
- package/dist/cjs/view/BlockCard/views/ResolvingView.js +5 -16
- package/dist/cjs/view/BlockCard/views/UnauthorizedView.js +15 -37
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleErroredView.js +7 -23
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +8 -31
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +7 -19
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +16 -33
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +11 -30
- package/dist/cjs/view/Card/index.js +0 -20
- package/dist/cjs/view/CardWithData/component.js +7 -32
- package/dist/cjs/view/CardWithData/loader.js +9 -30
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyFallback.js +2 -8
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +6 -22
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -14
- package/dist/cjs/view/CardWithUrl/component-lazy/index.js +0 -6
- package/dist/cjs/view/CardWithUrl/component.js +35 -60
- package/dist/cjs/view/CardWithUrl/loader.js +31 -50
- package/dist/cjs/view/EmbedCard/EmbedResizeMessageListener.js +0 -22
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +20 -29
- package/dist/cjs/view/EmbedCard/components/Frame.js +21 -48
- package/dist/cjs/view/EmbedCard/components/IframeDwellTracker.js +14 -23
- package/dist/cjs/view/EmbedCard/components/ImageIcon.js +6 -14
- package/dist/cjs/view/EmbedCard/components/styled.js +1 -61
- package/dist/cjs/view/EmbedCard/index.js +18 -53
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +6 -17
- package/dist/cjs/view/EmbedCard/views/ForbiddenView.js +11 -26
- package/dist/cjs/view/EmbedCard/views/NotFoundView.js +6 -16
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +13 -25
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +9 -24
- package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +8 -17
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +5 -20
- package/dist/cjs/view/EmbedModal/components/embed-content/index.js +3 -11
- package/dist/cjs/view/EmbedModal/components/error-boundary/index.js +0 -8
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +11 -32
- package/dist/cjs/view/EmbedModal/components/link-info/link-info-button/index.js +5 -11
- package/dist/cjs/view/EmbedModal/components/link-info/styled.js +0 -5
- package/dist/cjs/view/EmbedModal/index.js +24 -47
- package/dist/cjs/view/EmbedModal/types.js +0 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +8 -25
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +4 -10
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +2 -15
- package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +5 -27
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +13 -25
- package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +10 -42
- package/dist/cjs/view/FlexibleCard/components/actions/action/view-action/index.js +5 -25
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +4 -8
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +4 -43
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +8 -32
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +13 -47
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +11 -24
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +12 -30
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +7 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/index.js +0 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +12 -34
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +4 -16
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +10 -31
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +7 -19
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +10 -31
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +20 -52
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +9 -21
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +4 -16
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -44
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +4 -31
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +5 -11
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -9
- package/dist/cjs/view/FlexibleCard/components/container/index.js +29 -77
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +5 -13
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +10 -25
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +7 -28
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +11 -30
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +13 -35
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +0 -28
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +15 -37
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +11 -28
- package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +8 -18
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +8 -20
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +2 -51
- package/dist/cjs/view/FlexibleCard/components/utils.js +1 -39
- package/dist/cjs/view/FlexibleCard/index.js +13 -30
- package/dist/cjs/view/FlexibleCard/utils.js +0 -28
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +20 -45
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +13 -55
- package/dist/cjs/view/HoverCard/components/SnippetOrPreview.js +10 -26
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +22 -46
- package/dist/cjs/view/HoverCard/components/views/resolved/styled.js +0 -6
- package/dist/cjs/view/HoverCard/components/views/resolving/index.js +2 -11
- package/dist/cjs/view/HoverCard/components/views/resolving/styled.js +0 -5
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +8 -30
- package/dist/cjs/view/HoverCard/components/views/unauthorised/styled.js +0 -5
- package/dist/cjs/view/HoverCard/index.js +4 -15
- package/dist/cjs/view/HoverCard/styled.js +2 -11
- package/dist/cjs/view/HoverCard/utils.js +0 -21
- package/dist/cjs/view/InlineCard/ErroredView/index.js +8 -37
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +6 -46
- package/dist/cjs/view/InlineCard/Frame/index.js +11 -18
- package/dist/cjs/view/InlineCard/Frame/styled.js +1 -18
- package/dist/cjs/view/InlineCard/Icon.js +4 -13
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +10 -48
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +17 -34
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +13 -37
- package/dist/cjs/view/InlineCard/ResolvingView/index.js +7 -27
- package/dist/cjs/view/InlineCard/ResolvingView/styled.js +0 -6
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +10 -44
- package/dist/cjs/view/InlineCard/index.js +13 -43
- package/dist/cjs/view/InlineCard/styled.js +2 -15
- package/dist/cjs/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.js +11 -30
- package/dist/cjs/view/LinkUrl/LinkWarningModal/index.js +5 -20
- package/dist/cjs/view/LinkUrl/index.js +10 -24
- package/dist/cjs/view/LinkView/index.js +0 -16
- package/dist/cjs/view/SmartLinkEvents/useSmartLinkEvents.js +0 -3
- package/dist/cjs/view/common/Byline.js +4 -8
- package/dist/cjs/view/common/Icon.js +6 -21
- package/dist/cjs/view/common/Metadata.js +4 -14
- package/dist/cjs/view/common/MetadataList.js +2 -9
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -14
- package/dist/cjs/view/common/utils.js +0 -7
- package/dist/es2019/__tests_external__/page-objects/BaseCard.js +6 -15
- package/dist/es2019/__tests_external__/page-objects/BlockCard.js +0 -1
- package/dist/es2019/__tests_external__/page-objects/EmbedCard.js +0 -1
- package/dist/es2019/__tests_external__/page-objects/InlineCard.js +0 -1
- package/dist/es2019/constants.js +11 -26
- package/dist/es2019/extractors/block/index.js +6 -12
- package/dist/es2019/extractors/common/actions/extractActions.js +4 -12
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +14 -16
- package/dist/es2019/extractors/common/byline/extractByline.js +0 -2
- package/dist/es2019/extractors/common/context/extractAccessContext.js +10 -11
- package/dist/es2019/extractors/common/detail/extractAttachmentCount.js +0 -1
- package/dist/es2019/extractors/common/detail/extractCommentCount.js +0 -1
- package/dist/es2019/extractors/common/detail/extractProgrammingLanguage.js +0 -1
- package/dist/es2019/extractors/common/detail/extractSubscriberCount.js +0 -1
- package/dist/es2019/extractors/common/icon/extractIcon.js +0 -10
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +2 -11
- package/dist/es2019/extractors/common/icon/extractIconFromTask.js +0 -12
- package/dist/es2019/extractors/common/lozenge/extractLozenge.js +0 -3
- package/dist/es2019/extractors/common/lozenge/extractLozengeText.js +0 -1
- package/dist/es2019/extractors/common/lozenge/extractState.js +0 -2
- package/dist/es2019/extractors/common/lozenge/extractTag.js +0 -3
- package/dist/es2019/extractors/common/lozenge/extractTaskStatus.js +0 -1
- package/dist/es2019/extractors/common/lozenge/extractTaskType.js +0 -1
- package/dist/es2019/extractors/common/primitives/extractTitleTextColor.js +0 -3
- package/dist/es2019/extractors/common/title-prefix/extractTitlePrefix.js +0 -4
- package/dist/es2019/extractors/constants.js +2 -2
- package/dist/es2019/extractors/embed/index.js +2 -4
- package/dist/es2019/extractors/flexible/actions/extract-download-action.js +0 -2
- package/dist/es2019/extractors/flexible/actions/extract-preview-action.js +0 -3
- package/dist/es2019/extractors/flexible/actions/extract-view-action.js +0 -2
- package/dist/es2019/extractors/flexible/collaboratorGroup/index.js +0 -1
- package/dist/es2019/extractors/flexible/extract-preview.js +0 -2
- package/dist/es2019/extractors/flexible/extract-priority.js +0 -4
- package/dist/es2019/extractors/flexible/icon/extract-document-type-icon.js +0 -9
- package/dist/es2019/extractors/flexible/icon/extract-file-formatIcon.js +0 -24
- package/dist/es2019/extractors/flexible/icon/extract-icon-renderer.js +0 -4
- package/dist/es2019/extractors/flexible/icon/extract-jira-task-icon.js +0 -10
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +0 -18
- package/dist/es2019/extractors/flexible/icon/extract-provider-icon.js +0 -6
- package/dist/es2019/extractors/flexible/icon/extract-url-icon.js +0 -2
- package/dist/es2019/extractors/flexible/icon/index.js +4 -6
- package/dist/es2019/extractors/flexible/index.js +0 -3
- package/dist/es2019/extractors/flexible/latest-commit/index.js +0 -2
- package/dist/es2019/extractors/flexible/utils.js +0 -5
- package/dist/es2019/extractors/hover/extractMetadata.js +0 -3
- package/dist/es2019/extractors/index.js +0 -6
- package/dist/es2019/extractors/inline/index.js +0 -2
- package/dist/es2019/index.js +4 -4
- package/dist/es2019/ssr.js +2 -4
- package/dist/es2019/state/actions/index.js +25 -33
- package/dist/es2019/state/analytics/ufoExperiences.js +0 -1
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +31 -46
- package/dist/es2019/state/config/index.js +0 -2
- package/dist/es2019/state/flexible-ui-context/index.js +1 -2
- package/dist/es2019/state/helpers.js +2 -11
- package/dist/es2019/state/hooks/usePrefetch.js +14 -15
- package/dist/es2019/state/hooks/useSmartLink.js +8 -7
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +4 -8
- package/dist/es2019/state/hooks-external/useSmartLinkReload.js +0 -1
- package/dist/es2019/state/store/index.js +6 -5
- package/dist/es2019/utils/analytics/analytics.js +46 -24
- package/dist/es2019/utils/analytics/index.js +8 -5
- package/dist/es2019/utils/flexible.js +0 -1
- package/dist/es2019/utils/index.js +0 -7
- package/dist/es2019/utils/jsonld.js +4 -2
- package/dist/es2019/utils/mocks.js +0 -3
- package/dist/es2019/utils/performance.js +0 -9
- package/dist/es2019/utils/test-utils.js +0 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/DownloadAction.js +0 -1
- package/dist/es2019/view/BlockCard/actions/PreviewAction.js +1 -3
- package/dist/es2019/view/BlockCard/actions/ViewAction.js +0 -1
- package/dist/es2019/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -1
- package/dist/es2019/view/BlockCard/actions/flexible/ForbiddenAction.js +1 -1
- package/dist/es2019/view/BlockCard/actions/flexible/RetryAction.js +1 -1
- package/dist/es2019/view/BlockCard/components/Action.js +0 -1
- package/dist/es2019/view/BlockCard/components/ActionIcon.js +0 -3
- package/dist/es2019/view/BlockCard/components/ActionList.js +0 -1
- package/dist/es2019/view/BlockCard/components/CollaboratorList.js +0 -1
- package/dist/es2019/view/BlockCard/components/Frame.js +4 -2
- package/dist/es2019/view/BlockCard/components/Provider.js +0 -2
- package/dist/es2019/view/BlockCard/components/Thumbnail.js +4 -2
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -4
- package/dist/es2019/view/BlockCard/index.js +1 -24
- package/dist/es2019/view/BlockCard/views/ErroredView.js +2 -2
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +0 -2
- package/dist/es2019/view/BlockCard/views/NotFoundView.js +2 -2
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +0 -2
- package/dist/es2019/view/BlockCard/views/UnauthorizedView.js +2 -3
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleErroredView.js +0 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +1 -5
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +0 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +1 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +1 -3
- package/dist/es2019/view/Card/index.js +0 -3
- package/dist/es2019/view/CardWithData/component.js +0 -6
- package/dist/es2019/view/CardWithData/loader.js +1 -10
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +3 -4
- package/dist/es2019/view/CardWithUrl/component.js +10 -15
- package/dist/es2019/view/CardWithUrl/loader.js +8 -13
- package/dist/es2019/view/EmbedCard/EmbedResizeMessageListener.js +0 -8
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +4 -6
- package/dist/es2019/view/EmbedCard/components/Frame.js +1 -11
- package/dist/es2019/view/EmbedCard/components/IframeDwellTracker.js +4 -6
- package/dist/es2019/view/EmbedCard/components/ImageIcon.js +0 -1
- package/dist/es2019/view/EmbedCard/components/styled.js +0 -9
- package/dist/es2019/view/EmbedCard/index.js +0 -17
- package/dist/es2019/view/EmbedCard/views/ForbiddenView.js +0 -5
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +0 -1
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +0 -1
- package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +0 -1
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +0 -7
- package/dist/es2019/view/EmbedModal/components/embed-content/index.js +1 -2
- package/dist/es2019/view/EmbedModal/components/error-boundary/index.js +0 -3
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +0 -2
- package/dist/es2019/view/EmbedModal/components/link-info/link-info-button/index.js +0 -2
- package/dist/es2019/view/EmbedModal/index.js +0 -6
- package/dist/es2019/view/EmbedModal/types.js +0 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +0 -5
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +0 -5
- package/dist/es2019/view/FlexibleCard/components/actions/action/download-action/index.js +2 -9
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +3 -9
- package/dist/es2019/view/FlexibleCard/components/actions/action/view-action/index.js +2 -6
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +4 -5
- package/dist/es2019/view/FlexibleCard/components/actions/utils.js +2 -11
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +1 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +1 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -8
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +2 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -5
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +1 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +1 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +3 -18
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +62 -195
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -27
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +1 -3
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +1 -7
- package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +1 -9
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +1 -7
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +1 -10
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +0 -25
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +1 -10
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +1 -5
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +0 -23
- package/dist/es2019/view/FlexibleCard/components/utils.js +0 -11
- package/dist/es2019/view/FlexibleCard/index.js +1 -5
- package/dist/es2019/view/FlexibleCard/utils.js +0 -15
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +7 -14
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +0 -9
- package/dist/es2019/view/HoverCard/components/SnippetOrPreview.js +4 -5
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +2 -7
- package/dist/es2019/view/HoverCard/components/views/resolving/index.js +0 -2
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +0 -3
- package/dist/es2019/view/HoverCard/index.js +0 -3
- package/dist/es2019/view/HoverCard/styled.js +2 -2
- package/dist/es2019/view/HoverCard/utils.js +2 -11
- package/dist/es2019/view/InlineCard/ErroredView/index.js +0 -5
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +0 -14
- package/dist/es2019/view/InlineCard/Frame/index.js +5 -4
- package/dist/es2019/view/InlineCard/Frame/styled.js +1 -5
- package/dist/es2019/view/InlineCard/Icon.js +6 -4
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +0 -21
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +22 -15
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +0 -6
- package/dist/es2019/view/InlineCard/ResolvingView/index.js +0 -2
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +0 -6
- package/dist/es2019/view/InlineCard/index.js +0 -14
- package/dist/es2019/view/InlineCard/styled.js +3 -2
- package/dist/es2019/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.js +1 -9
- package/dist/es2019/view/LinkUrl/LinkWarningModal/index.js +0 -2
- package/dist/es2019/view/LinkUrl/index.js +0 -2
- package/dist/es2019/view/LinkView/index.js +0 -1
- package/dist/es2019/view/common/Icon.js +0 -5
- package/dist/es2019/view/common/Metadata.js +0 -4
- package/dist/es2019/view/common/MetadataList.js +0 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +0 -2
- package/dist/es2019/view/common/utils.js +0 -3
- package/dist/esm/__tests_external__/page-objects/BaseCard.js +6 -20
- package/dist/esm/__tests_external__/page-objects/BlockCard.js +0 -8
- package/dist/esm/__tests_external__/page-objects/EmbedCard.js +0 -8
- package/dist/esm/__tests_external__/page-objects/InlineCard.js +0 -8
- package/dist/esm/__tests_external__/test-cases/card.js +2 -2
- package/dist/esm/__tests_external__/test-cases/embed.js +1 -1
- package/dist/esm/__tests_external__/test-cases/inline.js +2 -2
- package/dist/esm/constants.js +11 -26
- package/dist/esm/extractors/block/index.js +2 -13
- package/dist/esm/extractors/common/actions/extractActions.js +2 -14
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +18 -28
- package/dist/esm/extractors/common/byline/extractByline.js +4 -8
- package/dist/esm/extractors/common/context/extractAccessContext.js +2 -12
- package/dist/esm/extractors/common/detail/extractAttachmentCount.js +0 -1
- package/dist/esm/extractors/common/detail/extractCommentCount.js +0 -1
- package/dist/esm/extractors/common/detail/extractProgrammingLanguage.js +0 -1
- package/dist/esm/extractors/common/detail/extractSubscriberCount.js +0 -1
- package/dist/esm/extractors/common/icon/extractIcon.js +0 -10
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +2 -11
- package/dist/esm/extractors/common/icon/extractIconFromTask.js +1 -13
- package/dist/esm/extractors/common/lozenge/extractLozenge.js +0 -7
- package/dist/esm/extractors/common/lozenge/extractLozengeText.js +1 -3
- package/dist/esm/extractors/common/lozenge/extractState.js +0 -2
- package/dist/esm/extractors/common/lozenge/extractTag.js +0 -3
- package/dist/esm/extractors/common/lozenge/extractTaskStatus.js +0 -1
- package/dist/esm/extractors/common/lozenge/extractTaskType.js +0 -1
- package/dist/esm/extractors/common/primitives/extractTitleTextColor.js +0 -3
- package/dist/esm/extractors/common/title-prefix/extractTitlePrefix.js +0 -4
- package/dist/esm/extractors/constants.js +2 -2
- package/dist/esm/extractors/embed/index.js +0 -6
- package/dist/esm/extractors/flexible/actions/extract-download-action.js +0 -2
- package/dist/esm/extractors/flexible/actions/extract-preview-action.js +0 -3
- package/dist/esm/extractors/flexible/actions/extract-view-action.js +0 -2
- package/dist/esm/extractors/flexible/collaboratorGroup/index.js +0 -1
- package/dist/esm/extractors/flexible/extract-preview.js +0 -2
- package/dist/esm/extractors/flexible/extract-priority.js +0 -4
- package/dist/esm/extractors/flexible/icon/extract-document-type-icon.js +0 -9
- package/dist/esm/extractors/flexible/icon/extract-file-formatIcon.js +0 -24
- package/dist/esm/extractors/flexible/icon/extract-icon-renderer.js +0 -4
- package/dist/esm/extractors/flexible/icon/extract-jira-task-icon.js +0 -11
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +4 -24
- package/dist/esm/extractors/flexible/icon/extract-provider-icon.js +0 -6
- package/dist/esm/extractors/flexible/icon/extract-url-icon.js +0 -2
- package/dist/esm/extractors/flexible/icon/index.js +4 -11
- package/dist/esm/extractors/flexible/index.js +0 -3
- package/dist/esm/extractors/flexible/latest-commit/index.js +0 -2
- package/dist/esm/extractors/flexible/utils.js +0 -5
- package/dist/esm/extractors/hover/extractMetadata.js +0 -3
- package/dist/esm/extractors/index.js +4 -15
- package/dist/esm/extractors/inline/index.js +0 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/ssr.js +4 -11
- package/dist/esm/state/actions/index.js +36 -57
- package/dist/esm/state/analytics/ufoExperiences.js +0 -1
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +165 -195
- package/dist/esm/state/config/index.js +0 -2
- package/dist/esm/state/flexible-ui-context/index.js +1 -2
- package/dist/esm/state/helpers.js +3 -12
- package/dist/esm/state/hooks/usePrefetch.js +10 -24
- package/dist/esm/state/hooks/useSmartLink.js +11 -13
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +12 -18
- package/dist/esm/state/hooks-external/useSmartLinkReload.js +1 -2
- package/dist/esm/state/store/index.js +7 -9
- package/dist/esm/utils/analytics/analytics.js +133 -139
- package/dist/esm/utils/analytics/index.js +8 -13
- package/dist/esm/utils/flexible.js +0 -1
- package/dist/esm/utils/index.js +5 -21
- package/dist/esm/utils/jsonld.js +0 -3
- package/dist/esm/utils/mocks.js +0 -20
- package/dist/esm/utils/performance.js +0 -9
- package/dist/esm/utils/test-utils.js +0 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/DownloadAction.js +0 -6
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +3 -15
- package/dist/esm/view/BlockCard/actions/RetryAction.js +0 -3
- package/dist/esm/view/BlockCard/actions/ViewAction.js +0 -6
- package/dist/esm/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/flexible/ForbiddenAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/flexible/RetryAction.js +1 -1
- package/dist/esm/view/BlockCard/components/Action.js +7 -11
- package/dist/esm/view/BlockCard/components/ActionIcon.js +0 -4
- package/dist/esm/view/BlockCard/components/ActionList.js +1 -3
- package/dist/esm/view/BlockCard/components/CollaboratorList.js +6 -8
- package/dist/esm/view/BlockCard/components/Content.js +2 -2
- package/dist/esm/view/BlockCard/components/ContentFooter.js +2 -2
- package/dist/esm/view/BlockCard/components/ContentHeader.js +2 -2
- package/dist/esm/view/BlockCard/components/Frame.js +10 -13
- package/dist/esm/view/BlockCard/components/Link.js +3 -3
- package/dist/esm/view/BlockCard/components/Name.js +4 -4
- package/dist/esm/view/BlockCard/components/Provider.js +1 -3
- package/dist/esm/view/BlockCard/components/Thumbnail.js +3 -6
- package/dist/esm/view/BlockCard/components/UnresolvedText.js +1 -1
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +7 -12
- package/dist/esm/view/BlockCard/index.js +18 -42
- package/dist/esm/view/BlockCard/views/ErroredView.js +10 -17
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +19 -22
- package/dist/esm/view/BlockCard/views/NotFoundView.js +11 -18
- package/dist/esm/view/BlockCard/views/ResolvedView.js +33 -35
- package/dist/esm/view/BlockCard/views/ResolvingView.js +4 -4
- package/dist/esm/view/BlockCard/views/UnauthorizedView.js +15 -22
- package/dist/esm/view/BlockCard/views/flexible/FlexibleErroredView.js +7 -9
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +9 -13
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +7 -9
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +17 -22
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +11 -15
- package/dist/esm/view/Card/index.js +0 -10
- package/dist/esm/view/CardWithData/component.js +7 -20
- package/dist/esm/view/CardWithData/loader.js +10 -24
- package/dist/esm/view/CardWithUrl/component-lazy/LazyFallback.js +2 -2
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +9 -11
- package/dist/esm/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -3
- package/dist/esm/view/CardWithUrl/component.js +35 -42
- package/dist/esm/view/CardWithUrl/loader.js +31 -37
- package/dist/esm/view/EmbedCard/EmbedResizeMessageListener.js +0 -15
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +20 -23
- package/dist/esm/view/EmbedCard/components/Frame.js +20 -38
- package/dist/esm/view/EmbedCard/components/IframeDwellTracker.js +15 -20
- package/dist/esm/view/EmbedCard/components/ImageIcon.js +6 -8
- package/dist/esm/view/EmbedCard/components/styled.js +1 -17
- package/dist/esm/view/EmbedCard/index.js +18 -35
- package/dist/esm/view/EmbedCard/views/ErroredView.js +5 -5
- package/dist/esm/view/EmbedCard/views/ForbiddenView.js +11 -16
- package/dist/esm/view/EmbedCard/views/NotFoundView.js +6 -6
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +12 -13
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +9 -10
- package/dist/esm/view/EmbedCard/views/UnresolvedView.js +7 -8
- package/dist/esm/view/EmbedModal/components/analytics/index.js +5 -12
- package/dist/esm/view/EmbedModal/components/embed-content/index.js +4 -7
- package/dist/esm/view/EmbedModal/components/error-boundary/index.js +0 -3
- package/dist/esm/view/EmbedModal/components/link-info/index.js +10 -14
- package/dist/esm/view/EmbedModal/components/link-info/link-info-button/index.js +5 -7
- package/dist/esm/view/EmbedModal/components/link-info/styled.js +0 -2
- package/dist/esm/view/EmbedModal/index.js +24 -33
- package/dist/esm/view/EmbedModal/types.js +0 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +8 -15
- package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +4 -6
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +2 -9
- package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +5 -21
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +14 -18
- package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +10 -25
- package/dist/esm/view/FlexibleCard/components/actions/action/view-action/index.js +5 -19
- package/dist/esm/view/FlexibleCard/components/actions/index.js +4 -5
- package/dist/esm/view/FlexibleCard/components/actions/utils.js +4 -20
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +8 -23
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +13 -28
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +11 -16
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +12 -22
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +7 -14
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +12 -22
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -9
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +11 -18
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +7 -10
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +10 -17
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +20 -32
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +10 -12
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +5 -8
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +4 -22
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +64 -200
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +4 -6
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -6
- package/dist/esm/view/FlexibleCard/components/container/index.js +29 -61
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +5 -9
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +10 -19
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +7 -17
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +11 -20
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +13 -24
- package/dist/esm/view/FlexibleCard/components/elements/index.js +0 -25
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +15 -26
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +11 -18
- package/dist/esm/view/FlexibleCard/components/elements/media/index.js +8 -14
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +8 -15
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +2 -28
- package/dist/esm/view/FlexibleCard/components/utils.js +1 -14
- package/dist/esm/view/FlexibleCard/index.js +14 -20
- package/dist/esm/view/FlexibleCard/utils.js +0 -15
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +19 -29
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +12 -28
- package/dist/esm/view/HoverCard/components/SnippetOrPreview.js +10 -16
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +22 -29
- package/dist/esm/view/HoverCard/components/views/resolved/styled.js +0 -2
- package/dist/esm/view/HoverCard/components/views/resolving/index.js +1 -3
- package/dist/esm/view/HoverCard/components/views/resolving/styled.js +0 -2
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +8 -13
- package/dist/esm/view/HoverCard/components/views/unauthorised/styled.js +0 -2
- package/dist/esm/view/HoverCard/index.js +3 -6
- package/dist/esm/view/HoverCard/styled.js +2 -4
- package/dist/esm/view/HoverCard/utils.js +0 -15
- package/dist/esm/view/InlineCard/ErroredView/index.js +8 -22
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +6 -29
- package/dist/esm/view/InlineCard/Frame/index.js +11 -10
- package/dist/esm/view/InlineCard/Frame/styled.js +1 -9
- package/dist/esm/view/InlineCard/Icon.js +5 -5
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +10 -36
- package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +20 -15
- package/dist/esm/view/InlineCard/ResolvedView/index.js +13 -25
- package/dist/esm/view/InlineCard/ResolvingView/index.js +7 -16
- package/dist/esm/view/InlineCard/ResolvingView/styled.js +0 -2
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +10 -25
- package/dist/esm/view/InlineCard/index.js +13 -27
- package/dist/esm/view/InlineCard/styled.js +3 -4
- package/dist/esm/view/LinkUrl/LinkWarningModal/hooks/use-link-warning-modal.js +11 -22
- package/dist/esm/view/LinkUrl/LinkWarningModal/index.js +5 -7
- package/dist/esm/view/LinkUrl/index.js +10 -14
- package/dist/esm/view/LinkView/index.js +0 -8
- package/dist/esm/view/common/Byline.js +3 -3
- package/dist/esm/view/common/Icon.js +6 -13
- package/dist/esm/view/common/Metadata.js +3 -7
- package/dist/esm/view/common/MetadataList.js +1 -2
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -5
- package/dist/esm/view/common/utils.js +0 -3
- package/package.json +3 -3
|
@@ -3,7 +3,6 @@ import { ElementName } from '../../../../constants';
|
|
|
3
3
|
// Attention: Keep the export name and element name the same.
|
|
4
4
|
// This will help reducing the code for mapping elements inside
|
|
5
5
|
// createElement and renderElementItems
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Creates a AttachmentCount Badge element using the data from AttachmentCount in the Flexible UI Context.
|
|
9
8
|
* @see Badge
|
|
@@ -13,143 +12,119 @@ export var AttachmentCount = createElement(ElementName.AttachmentCount);
|
|
|
13
12
|
* An AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
|
|
14
13
|
* @see AvatarGroup
|
|
15
14
|
*/
|
|
16
|
-
|
|
17
15
|
export var AuthorGroup = createElement(ElementName.AuthorGroup);
|
|
18
16
|
/**
|
|
19
17
|
* Creates a Checklist Badge element using the data from ChecklistProgress in the Flexible UI Context.
|
|
20
18
|
* @see Badge
|
|
21
19
|
*/
|
|
22
|
-
|
|
23
20
|
export var ChecklistProgress = createElement(ElementName.ChecklistProgress);
|
|
24
21
|
/**
|
|
25
22
|
* An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
|
|
26
23
|
* @see AvatarGroup
|
|
27
24
|
*/
|
|
28
|
-
|
|
29
25
|
export var CollaboratorGroup = createElement(ElementName.CollaboratorGroup);
|
|
30
26
|
/**
|
|
31
27
|
* Creates a CommentCount Badge element using the data from CommentCount in the Flexible UI Context.
|
|
32
28
|
* @see Badge
|
|
33
29
|
*/
|
|
34
|
-
|
|
35
30
|
export var CommentCount = createElement(ElementName.CommentCount);
|
|
36
31
|
/**
|
|
37
32
|
* Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
|
|
38
33
|
* @see DateTime
|
|
39
34
|
*/
|
|
40
|
-
|
|
41
35
|
export var CreatedOn = createElement(ElementName.CreatedOn);
|
|
42
36
|
/**
|
|
43
37
|
* Creates a CreatedBy text element using the data from CreatedBy in the Flexible UI Context.
|
|
44
38
|
* @see Text
|
|
45
39
|
*/
|
|
46
|
-
|
|
47
40
|
export var CreatedBy = createElement(ElementName.CreatedBy);
|
|
48
41
|
/**
|
|
49
42
|
* Creates a DueOn Lozenge element using the data from dueOn in the Flexible UI Context.
|
|
50
43
|
* @see Lozenge
|
|
51
44
|
*/
|
|
52
|
-
|
|
53
45
|
export var DueOn = createElement(ElementName.DueOn);
|
|
54
46
|
/**
|
|
55
47
|
* Creates an element that contains Last Commit hash
|
|
56
48
|
*/
|
|
57
|
-
|
|
58
49
|
export var LatestCommit = createElement(ElementName.LatestCommit);
|
|
59
50
|
/**
|
|
60
51
|
* Creates a LinkIcon Icon element using the data from LinkIcon in the Flexible UI Context.
|
|
61
52
|
* @see Icon
|
|
62
53
|
*/
|
|
63
|
-
|
|
64
54
|
export var LinkIcon = createElement(ElementName.LinkIcon);
|
|
65
55
|
/**
|
|
66
56
|
* Creates a ModifiedBy Text element using the data from ModifiedBy in the Flexible UI Context.
|
|
67
57
|
* @see Text
|
|
68
58
|
*/
|
|
69
|
-
|
|
70
59
|
export var ModifiedBy = createElement(ElementName.ModifiedBy);
|
|
71
60
|
/**
|
|
72
61
|
* Creates a ModifiedOn DateTime element using the data from ModifiedOn in the Flexible UI Context.
|
|
73
62
|
* @see DateTime
|
|
74
63
|
*/
|
|
75
|
-
|
|
76
64
|
export var ModifiedOn = createElement(ElementName.ModifiedOn);
|
|
77
65
|
/**
|
|
78
66
|
* Creates a Preview element using the data from Preview in the Flexible UI Context.
|
|
79
67
|
* @see Preview
|
|
80
68
|
*/
|
|
81
|
-
|
|
82
69
|
export var Preview = createElement(ElementName.Preview);
|
|
83
70
|
/**
|
|
84
71
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
85
72
|
* @see Badge
|
|
86
73
|
*/
|
|
87
|
-
|
|
88
74
|
export var Priority = createElement(ElementName.Priority);
|
|
89
75
|
/**
|
|
90
76
|
* Creates a ProgrammingLanguage Badge element using the data from ProgrammingLanguage in the Flexible UI Context.
|
|
91
77
|
* @see Badge
|
|
92
78
|
*/
|
|
93
|
-
|
|
94
79
|
export var ProgrammingLanguage = createElement(ElementName.ProgrammingLanguage);
|
|
95
80
|
/**
|
|
96
81
|
* Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
|
|
97
82
|
* @see Badge
|
|
98
83
|
*/
|
|
99
|
-
|
|
100
84
|
export var Provider = createElement(ElementName.Provider);
|
|
101
85
|
/**
|
|
102
86
|
* Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
|
|
103
87
|
* @see Badge
|
|
104
88
|
*/
|
|
105
|
-
|
|
106
89
|
export var ReactCount = createElement(ElementName.ReactCount);
|
|
107
90
|
/**
|
|
108
91
|
* Creates a Snippet element using the data from Snippet in the Flexible UI Context.
|
|
109
92
|
* @see Text
|
|
110
93
|
*/
|
|
111
|
-
|
|
112
94
|
export var Snippet = createElement(ElementName.Snippet);
|
|
113
95
|
/**
|
|
114
96
|
* Creates a SourceBranch Text element using the data from sourceBranch in the Flexible UI Context.
|
|
115
97
|
* @see Text
|
|
116
98
|
*/
|
|
117
|
-
|
|
118
99
|
export var SourceBranch = createElement(ElementName.SourceBranch);
|
|
119
100
|
/**
|
|
120
101
|
* Creates a State Lozenge element using the data from State in the Flexible UI Context.
|
|
121
102
|
* @see Lozenge
|
|
122
103
|
*/
|
|
123
|
-
|
|
124
104
|
export var State = createElement(ElementName.State);
|
|
125
105
|
/**
|
|
126
106
|
* Creates a SubscriberCount Badge element using the data from SubscriberCount in the Flexible UI Context.
|
|
127
107
|
* @see Badge
|
|
128
108
|
*/
|
|
129
|
-
|
|
130
109
|
export var SubscriberCount = createElement(ElementName.SubscriberCount);
|
|
131
110
|
/**
|
|
132
111
|
* Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
|
|
133
112
|
* @see Text
|
|
134
113
|
*/
|
|
135
|
-
|
|
136
114
|
export var TargetBranch = createElement(ElementName.TargetBranch);
|
|
137
115
|
/**
|
|
138
116
|
* Creates a Title Link element using the data from Title in the Flexible UI Context.
|
|
139
117
|
* This represents the main link text within the Smart Link.
|
|
140
118
|
* @see Link
|
|
141
119
|
*/
|
|
142
|
-
|
|
143
120
|
export var Title = createElement(ElementName.Title);
|
|
144
121
|
/**
|
|
145
122
|
* Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
|
|
146
123
|
* @see Badge
|
|
147
124
|
*/
|
|
148
|
-
|
|
149
125
|
export var ViewCount = createElement(ElementName.ViewCount);
|
|
150
126
|
/**
|
|
151
127
|
* Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
|
|
152
128
|
* @see Badge
|
|
153
129
|
*/
|
|
154
|
-
|
|
155
130
|
export var VoteCount = createElement(ElementName.VoteCount);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import React, { useMemo } from 'react';
|
|
7
5
|
import { css, jsx } from '@emotion/react';
|
|
@@ -13,36 +11,29 @@ var DEFAULT_MAX_LINES = 2;
|
|
|
13
11
|
var MAXIMUM_MAX_LINES = 2;
|
|
14
12
|
var MINIMUM_MAX_LINES = 1;
|
|
15
13
|
var containerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n"])));
|
|
16
|
-
|
|
17
14
|
var getThemeStyles = function getThemeStyles(theme) {
|
|
18
15
|
switch (theme) {
|
|
19
16
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
20
17
|
case SmartLinkTheme.Black:
|
|
21
18
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), tokens.blackLink, tokens.blackLinkPressed, tokens.blackLink);
|
|
22
|
-
|
|
23
19
|
case SmartLinkTheme.Link:
|
|
24
20
|
default:
|
|
25
21
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), tokens.blueLink, tokens.blueLinkPressed, tokens.blueLink);
|
|
26
22
|
}
|
|
27
23
|
};
|
|
28
|
-
|
|
29
24
|
var getAnchorStyles = function getAnchorStyles(size, theme, maxLines, hasSpace) {
|
|
30
25
|
var sizeStyles = getLinkSizeStyles(size);
|
|
31
26
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n ", "\n ", "\n // Theme should be last to be spread because it contains override values\n ", "\n "])), sizeStyles, getTruncateStyles(maxLines, getLinkLineHeight(size), hasSpace ? 'break-word' : 'break-all'), getThemeStyles(theme));
|
|
32
27
|
};
|
|
33
|
-
|
|
34
28
|
var getMaxLines = function getMaxLines(maxLines) {
|
|
35
29
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
36
30
|
return DEFAULT_MAX_LINES;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
if (maxLines < MINIMUM_MAX_LINES) {
|
|
40
33
|
return MINIMUM_MAX_LINES;
|
|
41
34
|
}
|
|
42
|
-
|
|
43
35
|
return maxLines;
|
|
44
36
|
};
|
|
45
|
-
|
|
46
37
|
var withTooltip = function withTooltip(trigger, content, testId) {
|
|
47
38
|
return jsx(Tooltip, {
|
|
48
39
|
content: content,
|
|
@@ -50,30 +41,29 @@ var withTooltip = function withTooltip(trigger, content, testId) {
|
|
|
50
41
|
tag: "span"
|
|
51
42
|
}, trigger);
|
|
52
43
|
};
|
|
44
|
+
|
|
53
45
|
/**
|
|
54
46
|
* A base element that represent an anchor.
|
|
55
47
|
* @internal
|
|
56
48
|
* @param {LinkProps} LinkProps - The props necessary for the Link element.
|
|
57
49
|
* @see LinkIcon
|
|
58
50
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
51
|
var Link = function Link(_ref) {
|
|
62
52
|
var hideTooltip = _ref.hideTooltip,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
_ref$maxLines = _ref.maxLines,
|
|
54
|
+
maxLines = _ref$maxLines === void 0 ? DEFAULT_MAX_LINES : _ref$maxLines,
|
|
55
|
+
name = _ref.name,
|
|
56
|
+
overrideCss = _ref.overrideCss,
|
|
57
|
+
_ref$size = _ref.size,
|
|
58
|
+
size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
|
|
59
|
+
_ref$testId = _ref.testId,
|
|
60
|
+
testId = _ref$testId === void 0 ? 'smart-element-link' : _ref$testId,
|
|
61
|
+
text = _ref.text,
|
|
62
|
+
_ref$theme = _ref.theme,
|
|
63
|
+
theme = _ref$theme === void 0 ? SmartLinkTheme.Link : _ref$theme,
|
|
64
|
+
url = _ref.url,
|
|
65
|
+
onClick = _ref.onClick,
|
|
66
|
+
target = _ref.target;
|
|
77
67
|
var hasSpace = useMemo(function () {
|
|
78
68
|
return text ? hasWhiteSpace(text) : false;
|
|
79
69
|
}, [text]);
|
|
@@ -90,5 +80,4 @@ var Link = function Link(_ref) {
|
|
|
90
80
|
css: containerStyles
|
|
91
81
|
}, hideTooltip || text === undefined ? anchor : withTooltip(anchor, text, testId));
|
|
92
82
|
};
|
|
93
|
-
|
|
94
83
|
export default Link;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
|
|
4
3
|
var _templateObject, _templateObject2;
|
|
5
|
-
|
|
6
4
|
/** @jsx jsx */
|
|
7
5
|
import React, { useCallback, useState } from 'react';
|
|
8
6
|
import { css, jsx } from '@emotion/react';
|
|
@@ -10,28 +8,26 @@ import AtlaskitLozenge from '@atlaskit/lozenge';
|
|
|
10
8
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
11
9
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n line-height: inherit;\n"])));
|
|
12
10
|
var actionStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n > span > span {\n display: inline-flex;\n align-items: center;\n margin-right: -2px;\n }\n\n svg {\n width: unset;\n height: unset;\n margin: -4px 0;\n }\n\n :hover {\n cursor: pointer;\n }\n"])));
|
|
11
|
+
|
|
13
12
|
/**
|
|
14
13
|
* A base element that displays a Lozenge.
|
|
15
14
|
* @internal
|
|
16
15
|
* @param {LozengeProps} LozengeProps - The props necessary for the Lozenge element.
|
|
17
16
|
* @see State
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
18
|
var Lozenge = function Lozenge(_ref) {
|
|
21
19
|
var _ref$appearance = _ref.appearance,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
21
|
+
name = _ref.name,
|
|
22
|
+
onClick = _ref.onClick,
|
|
23
|
+
overrideCss = _ref.overrideCss,
|
|
24
|
+
text = _ref.text,
|
|
25
|
+
_ref$testId = _ref.testId,
|
|
26
|
+
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId;
|
|
30
27
|
var _useState = useState(false),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
isBold = _useState2[0],
|
|
30
|
+
setIsBold = _useState2[1];
|
|
35
31
|
var onHover = useCallback(function (isHover) {
|
|
36
32
|
if (onClick) {
|
|
37
33
|
setIsBold(isHover);
|
|
@@ -43,11 +39,9 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
43
39
|
var onMouseLeave = useCallback(function () {
|
|
44
40
|
return onHover(false);
|
|
45
41
|
}, [onHover]);
|
|
46
|
-
|
|
47
42
|
if (!text) {
|
|
48
43
|
return null;
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
return jsx("span", {
|
|
52
46
|
css: [styles, onClick ? actionStyles : undefined, overrideCss],
|
|
53
47
|
"data-fit-to-content": true,
|
|
@@ -67,5 +61,4 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
67
61
|
testId: "".concat(testId, "-action")
|
|
68
62
|
})));
|
|
69
63
|
};
|
|
70
|
-
|
|
71
64
|
export default Lozenge;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import { css, jsx } from '@emotion/react';
|
|
8
6
|
import ImageIcon from '../../common/image-icon';
|
|
9
|
-
|
|
10
7
|
/**
|
|
11
8
|
* Media: Image
|
|
12
9
|
* [aspect-ratio: 16 / 9] The context box is fixed to aspect ratio of 16:9.
|
|
@@ -18,27 +15,25 @@ import ImageIcon from '../../common/image-icon';
|
|
|
18
15
|
* contents within the element's box.
|
|
19
16
|
*/
|
|
20
17
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n aspect-ratio: 16 / 9;\n display: flex;\n width: 100%;\n height: fit-content; // Fix Safari height not respecting aspect-ratio\n\n // fallback\n @supports not (aspect-ratio: auto) {\n padding-top: 56.25%; // 16:9 ratio (9 / 16 = 0.5625)\n height: 0;\n position: relative;\n overflow: hidden;\n }\n\n > img,\n > span {\n min-height: 100%;\n min-width: 100%;\n max-height: 100%;\n max-width: 100%;\n object-fit: cover;\n object-position: center center;\n\n // fallback\n @supports not (aspect-ratio: auto) {\n position: absolute;\n transform: translate(-50%, -50%);\n left: 50%;\n top: 50%;\n width: auto;\n height: auto;\n }\n }\n"])));
|
|
18
|
+
|
|
21
19
|
/**
|
|
22
20
|
* A base element that displays a Media.
|
|
23
21
|
* @internal
|
|
24
22
|
* @param {MediaProps} MediaProps - The props necessary for the Media element.
|
|
25
23
|
* @see Preview
|
|
26
24
|
*/
|
|
27
|
-
|
|
28
25
|
var Media = function Media(_ref) {
|
|
29
26
|
var name = _ref.name,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
overrideCss = _ref.overrideCss,
|
|
28
|
+
_ref$testId = _ref.testId,
|
|
29
|
+
testId = _ref$testId === void 0 ? 'smart-element-media' : _ref$testId,
|
|
30
|
+
type = _ref.type,
|
|
31
|
+
url = _ref.url,
|
|
32
|
+
onLoad = _ref.onLoad,
|
|
33
|
+
onError = _ref.onError;
|
|
38
34
|
if (!type || !url) {
|
|
39
35
|
return null;
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
return jsx("div", {
|
|
43
38
|
css: [styles, overrideCss],
|
|
44
39
|
"data-smart-element": name,
|
|
@@ -52,5 +47,4 @@ var Media = function Media(_ref) {
|
|
|
52
47
|
defaultIcon: null
|
|
53
48
|
}));
|
|
54
49
|
};
|
|
55
|
-
|
|
56
50
|
export default Media;
|
|
@@ -1,38 +1,32 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import React from 'react';
|
|
7
5
|
import { css, jsx } from '@emotion/react';
|
|
8
6
|
import { getFormattedMessage, getTruncateStyles } from '../../utils';
|
|
9
7
|
import { tokens } from '../../../../../utils/token';
|
|
10
|
-
|
|
11
8
|
var getStyles = function getStyles(maxLines) {
|
|
12
9
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])), tokens.text, getTruncateStyles(maxLines));
|
|
13
10
|
};
|
|
11
|
+
|
|
14
12
|
/**
|
|
15
13
|
* A base element that displays some Text.
|
|
16
14
|
* @internal
|
|
17
15
|
* @param {TextProps} TextProps - The props necessary for the Text element.
|
|
18
16
|
* @see Title
|
|
19
17
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
18
|
var Text = function Text(_ref) {
|
|
23
19
|
var content = _ref.content,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
_ref$maxLines = _ref.maxLines,
|
|
21
|
+
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
22
|
+
message = _ref.message,
|
|
23
|
+
name = _ref.name,
|
|
24
|
+
overrideCss = _ref.overrideCss,
|
|
25
|
+
_ref$testId = _ref.testId,
|
|
26
|
+
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId;
|
|
32
27
|
if (!message && !content) {
|
|
33
28
|
return null;
|
|
34
29
|
}
|
|
35
|
-
|
|
36
30
|
return jsx("span", {
|
|
37
31
|
css: [getStyles(maxLines), overrideCss],
|
|
38
32
|
"data-separator": true,
|
|
@@ -41,5 +35,4 @@ var Text = function Text(_ref) {
|
|
|
41
35
|
"data-testid": testId
|
|
42
36
|
}, getFormattedMessage(message) || content);
|
|
43
37
|
};
|
|
44
|
-
|
|
45
38
|
export default Text;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
|
|
5
4
|
var _templateObject, _elementMappings;
|
|
6
|
-
|
|
7
5
|
import React, { useContext } from 'react';
|
|
8
6
|
import { FormattedDate } from 'react-intl-next';
|
|
9
7
|
import { css } from '@emotion/react';
|
|
@@ -102,25 +100,20 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
|
|
|
102
100
|
}), _defineProperty(_elementMappings, ElementName.Title, {
|
|
103
101
|
component: Link
|
|
104
102
|
}), _elementMappings);
|
|
105
|
-
|
|
106
103
|
var getContextKey = function getContextKey(name) {
|
|
107
104
|
// Attempt to predict context prop name in advance to reduce the amount of
|
|
108
105
|
// code run during runtime
|
|
109
106
|
return name.length > 0 ? name.charAt(0).toLowerCase() + name.slice(1) : undefined;
|
|
110
107
|
};
|
|
111
|
-
|
|
112
108
|
var getData = function getData(elementName, contextKey, context) {
|
|
113
109
|
if (!context) {
|
|
114
110
|
return undefined;
|
|
115
111
|
}
|
|
116
|
-
|
|
117
112
|
var data = context[contextKey];
|
|
118
|
-
|
|
119
113
|
switch (elementName) {
|
|
120
114
|
case ElementName.AuthorGroup:
|
|
121
115
|
case ElementName.CollaboratorGroup:
|
|
122
116
|
return toAvatarGroupProps(data);
|
|
123
|
-
|
|
124
117
|
case ElementName.AttachmentCount:
|
|
125
118
|
case ElementName.ChecklistProgress:
|
|
126
119
|
case ElementName.CommentCount:
|
|
@@ -131,47 +124,36 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
131
124
|
case ElementName.SubscriberCount:
|
|
132
125
|
case ElementName.LatestCommit:
|
|
133
126
|
return toBadgeProps(data);
|
|
134
|
-
|
|
135
127
|
case ElementName.CreatedBy:
|
|
136
128
|
return toFormattedTextProps(messages.created_by, context.createdBy);
|
|
137
|
-
|
|
138
129
|
case ElementName.CreatedOn:
|
|
139
130
|
return toDateTimeProps('created', context.createdOn);
|
|
140
|
-
|
|
141
131
|
case ElementName.DueOn:
|
|
142
132
|
return toDateLozengeProps(context.dueOn);
|
|
143
|
-
|
|
144
133
|
case ElementName.ModifiedBy:
|
|
145
134
|
return toFormattedTextProps(messages.modified_by, context.modifiedBy);
|
|
146
|
-
|
|
147
135
|
case ElementName.ModifiedOn:
|
|
148
136
|
return toDateTimeProps('modified', context.modifiedOn);
|
|
149
|
-
|
|
150
137
|
case ElementName.Snippet:
|
|
151
138
|
case ElementName.SourceBranch:
|
|
152
139
|
case ElementName.TargetBranch:
|
|
153
140
|
return toTextProps(data);
|
|
154
|
-
|
|
155
141
|
case ElementName.Title:
|
|
156
142
|
return toLinkProps(context.title, context.url);
|
|
157
|
-
|
|
158
143
|
default:
|
|
159
144
|
return data;
|
|
160
145
|
}
|
|
161
146
|
};
|
|
162
|
-
|
|
163
147
|
var toAvatarGroupProps = function toAvatarGroupProps(items) {
|
|
164
148
|
return items ? {
|
|
165
149
|
items: items
|
|
166
150
|
} : undefined;
|
|
167
151
|
};
|
|
168
|
-
|
|
169
152
|
var toBadgeProps = function toBadgeProps(label) {
|
|
170
153
|
return label ? {
|
|
171
154
|
label: label
|
|
172
155
|
} : undefined;
|
|
173
156
|
};
|
|
174
|
-
|
|
175
157
|
var toDateLozengeProps = function toDateLozengeProps(dateString) {
|
|
176
158
|
if (dateString) {
|
|
177
159
|
var text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
|
|
@@ -186,14 +168,12 @@ var toDateLozengeProps = function toDateLozengeProps(dateString) {
|
|
|
186
168
|
};
|
|
187
169
|
}
|
|
188
170
|
};
|
|
189
|
-
|
|
190
171
|
var toDateTimeProps = function toDateTimeProps(type, dateString) {
|
|
191
172
|
return dateString ? {
|
|
192
173
|
date: new Date(dateString),
|
|
193
174
|
type: type
|
|
194
175
|
} : undefined;
|
|
195
176
|
};
|
|
196
|
-
|
|
197
177
|
var toFormattedTextProps = function toFormattedTextProps(descriptor, context) {
|
|
198
178
|
return context ? {
|
|
199
179
|
message: {
|
|
@@ -204,31 +184,25 @@ var toFormattedTextProps = function toFormattedTextProps(descriptor, context) {
|
|
|
204
184
|
}
|
|
205
185
|
} : undefined;
|
|
206
186
|
};
|
|
207
|
-
|
|
208
187
|
var toLinkProps = function toLinkProps(text, url) {
|
|
209
188
|
return text ? {
|
|
210
189
|
text: text,
|
|
211
190
|
url: url
|
|
212
191
|
} : undefined;
|
|
213
192
|
};
|
|
214
|
-
|
|
215
193
|
var toTextProps = function toTextProps(content) {
|
|
216
194
|
return content ? {
|
|
217
195
|
content: content
|
|
218
196
|
} : undefined;
|
|
219
197
|
};
|
|
220
|
-
|
|
221
198
|
export var createElement = function createElement(name) {
|
|
222
199
|
var _ref = elementMappings[name] || {},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
200
|
+
BaseElement = _ref.component,
|
|
201
|
+
props = _ref.props;
|
|
226
202
|
var contextKey = getContextKey(name);
|
|
227
|
-
|
|
228
203
|
if (!BaseElement) {
|
|
229
204
|
throw Error("Element ".concat(name, " does not exist."));
|
|
230
205
|
}
|
|
231
|
-
|
|
232
206
|
return function (overrides) {
|
|
233
207
|
var context = useContext(FlexibleUiContext);
|
|
234
208
|
var data = getData(name, contextKey, context);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
|
|
5
4
|
var _sizeToButtonSpacing, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
6
|
-
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import { css } from '@emotion/react';
|
|
9
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -12,17 +10,15 @@ export var sizeToButtonSpacing = (_sizeToButtonSpacing = {}, _defineProperty(_si
|
|
|
12
10
|
export var getFormattedMessage = function getFormattedMessage(message) {
|
|
13
11
|
if (message) {
|
|
14
12
|
var descriptor = message.descriptor,
|
|
15
|
-
|
|
13
|
+
values = message.values;
|
|
16
14
|
return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
17
15
|
values: values
|
|
18
16
|
}));
|
|
19
17
|
}
|
|
20
18
|
};
|
|
21
|
-
|
|
22
19
|
var getIconDimensionStyles = function getIconDimensionStyles(value) {
|
|
23
20
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", ";\n min-height: ", ";\n max-height: ", ";\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n"])), value, value, value, value, value, value);
|
|
24
21
|
};
|
|
25
|
-
|
|
26
22
|
export var getIconSizeStyles = function getIconSizeStyles(width) {
|
|
27
23
|
var sizeStyles = getIconDimensionStyles(width);
|
|
28
24
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n ", "\n span,\n svg,\n img {\n ", "\n }\n svg {\n padding: 0;\n }\n "])), sizeStyles, sizeStyles);
|
|
@@ -31,13 +27,10 @@ export var getIconWidth = function getIconWidth(size) {
|
|
|
31
27
|
switch (size) {
|
|
32
28
|
case SmartLinkSize.XLarge:
|
|
33
29
|
return '2rem';
|
|
34
|
-
|
|
35
30
|
case SmartLinkSize.Large:
|
|
36
31
|
return '1.5rem';
|
|
37
|
-
|
|
38
32
|
case SmartLinkSize.Medium:
|
|
39
33
|
return '1rem';
|
|
40
|
-
|
|
41
34
|
case SmartLinkSize.Small:
|
|
42
35
|
default:
|
|
43
36
|
return '.75rem';
|
|
@@ -47,7 +40,6 @@ export var getLinkLineHeight = function getLinkLineHeight(size) {
|
|
|
47
40
|
switch (size) {
|
|
48
41
|
case SmartLinkSize.XLarge:
|
|
49
42
|
return '1.5rem';
|
|
50
|
-
|
|
51
43
|
case SmartLinkSize.Large:
|
|
52
44
|
case SmartLinkSize.Medium:
|
|
53
45
|
case SmartLinkSize.Small:
|
|
@@ -59,11 +51,9 @@ export var getLinkSizeStyles = function getLinkSizeStyles(size) {
|
|
|
59
51
|
switch (size) {
|
|
60
52
|
case SmartLinkSize.XLarge:
|
|
61
53
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 1.25rem;\n font-weight: 400;\n letter-spacing: -0.008em;\n line-height: ", ";\n "])), getLinkLineHeight(size));
|
|
62
|
-
|
|
63
54
|
case SmartLinkSize.Large:
|
|
64
55
|
case SmartLinkSize.Medium:
|
|
65
56
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: 0.875rem;\n font-weight: 400;\n letter-spacing: -0.003em;\n line-height: ", ";\n "])), getLinkLineHeight(size));
|
|
66
|
-
|
|
67
57
|
case SmartLinkSize.Small:
|
|
68
58
|
default:
|
|
69
59
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: 0.75rem;\n font-weight: 400;\n letter-spacing: 0em;\n line-height: ", ";\n "])), getLinkLineHeight(size));
|
|
@@ -76,7 +66,6 @@ export var getMaxLineHeight = function getMaxLineHeight(size) {
|
|
|
76
66
|
case SmartLinkSize.XLarge:
|
|
77
67
|
case SmartLinkSize.Large:
|
|
78
68
|
return 1.75;
|
|
79
|
-
|
|
80
69
|
case SmartLinkSize.Medium:
|
|
81
70
|
case SmartLinkSize.Small:
|
|
82
71
|
default:
|
|
@@ -87,11 +76,9 @@ export var getMaxLines = function getMaxLines(value, defaultValue, max, min) {
|
|
|
87
76
|
if (value > max) {
|
|
88
77
|
return defaultValue;
|
|
89
78
|
}
|
|
90
|
-
|
|
91
79
|
if (value < min) {
|
|
92
80
|
return min;
|
|
93
81
|
}
|
|
94
|
-
|
|
95
82
|
return value;
|
|
96
83
|
};
|
|
97
84
|
export var getTruncateStyles = function getTruncateStyles(maxLines) {
|