@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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { useIntl, FormattedMessage } from 'react-intl-next';
|
|
@@ -24,6 +23,7 @@ const typeToDescriptorMap = {
|
|
|
24
23
|
absolute: messages.modified_on_absolute
|
|
25
24
|
}
|
|
26
25
|
};
|
|
26
|
+
|
|
27
27
|
/**
|
|
28
28
|
* A base element that displays an ISO Timestamp in text.
|
|
29
29
|
* @internal
|
|
@@ -31,7 +31,6 @@ const typeToDescriptorMap = {
|
|
|
31
31
|
* @see CreatedOn
|
|
32
32
|
* @see ModifiedOn
|
|
33
33
|
*/
|
|
34
|
-
|
|
35
34
|
const DateTime = ({
|
|
36
35
|
date,
|
|
37
36
|
name,
|
|
@@ -44,15 +43,12 @@ const DateTime = ({
|
|
|
44
43
|
formatRelativeTime,
|
|
45
44
|
formatDate
|
|
46
45
|
} = useIntl();
|
|
47
|
-
|
|
48
46
|
if (!type || !date) {
|
|
49
47
|
return null;
|
|
50
48
|
}
|
|
51
|
-
|
|
52
49
|
const isLongerThenWeek = Math.abs(date.getTime() - Date.now()) > 1000 * 60 * 60 * 24 * 7;
|
|
53
50
|
let context;
|
|
54
51
|
let typeVariant;
|
|
55
|
-
|
|
56
52
|
if (isLongerThenWeek) {
|
|
57
53
|
typeVariant = 'absolute';
|
|
58
54
|
context = formatDate(date, {
|
|
@@ -70,7 +66,6 @@ const DateTime = ({
|
|
|
70
66
|
numeric: 'auto'
|
|
71
67
|
});
|
|
72
68
|
}
|
|
73
|
-
|
|
74
69
|
return jsx("span", {
|
|
75
70
|
css: [styles, overrideCss],
|
|
76
71
|
"data-separator": true,
|
|
@@ -83,5 +78,4 @@ const DateTime = ({
|
|
|
83
78
|
}
|
|
84
79
|
})));
|
|
85
80
|
};
|
|
86
|
-
|
|
87
81
|
export default DateTime;
|
|
@@ -6,14 +6,12 @@ import { SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
|
6
6
|
import AtlaskitIcon from '../../common/atlaskit-icon';
|
|
7
7
|
import ImageIcon from '../../common/image-icon';
|
|
8
8
|
import { getIconSizeStyles, getIconWidth, getTruncateStyles } from '../../utils';
|
|
9
|
-
|
|
10
9
|
const getPositionStyles = (size, position) => {
|
|
11
10
|
switch (position) {
|
|
12
11
|
case SmartLinkPosition.Center:
|
|
13
12
|
return css`
|
|
14
13
|
align-self: center;
|
|
15
14
|
`;
|
|
16
|
-
|
|
17
15
|
case SmartLinkPosition.Top:
|
|
18
16
|
default:
|
|
19
17
|
return css`
|
|
@@ -22,12 +20,10 @@ const getPositionStyles = (size, position) => {
|
|
|
22
20
|
`;
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
const getIconStyles = (size, position, width) => css`
|
|
27
24
|
${getPositionStyles(size, position)}
|
|
28
25
|
${getIconSizeStyles(width)}
|
|
29
26
|
`;
|
|
30
|
-
|
|
31
27
|
const getCustomRenderStyles = value => css`
|
|
32
28
|
${getTruncateStyles(1, value)}
|
|
33
29
|
line-height: ${value};
|
|
@@ -41,7 +37,6 @@ const getCustomRenderStyles = value => css`
|
|
|
41
37
|
vertical-align: baseline;
|
|
42
38
|
}
|
|
43
39
|
`;
|
|
44
|
-
|
|
45
40
|
const renderAtlaskitIcon = (icon, label, testId) => {
|
|
46
41
|
if (icon) {
|
|
47
42
|
return jsx(AtlaskitIcon, {
|
|
@@ -51,12 +46,10 @@ const renderAtlaskitIcon = (icon, label, testId) => {
|
|
|
51
46
|
});
|
|
52
47
|
}
|
|
53
48
|
};
|
|
54
|
-
|
|
55
49
|
const renderDefaultIcon = (label, testId) => jsx(LinkIcon, {
|
|
56
50
|
label: label,
|
|
57
51
|
testId: `${testId}-default`
|
|
58
52
|
});
|
|
59
|
-
|
|
60
53
|
const renderImageIcon = (defaultIcon, icon, url, testId) => {
|
|
61
54
|
if (url) {
|
|
62
55
|
return jsx(ImageIcon, {
|
|
@@ -66,14 +59,13 @@ const renderImageIcon = (defaultIcon, icon, url, testId) => {
|
|
|
66
59
|
});
|
|
67
60
|
}
|
|
68
61
|
};
|
|
62
|
+
|
|
69
63
|
/**
|
|
70
64
|
* A base element that displays an Icon or favicon.
|
|
71
65
|
* @internal
|
|
72
66
|
* @param {IconProps} IconProps - The props necessary for the Icon element.
|
|
73
67
|
* @see LinkIcon
|
|
74
68
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
69
|
const Icon = ({
|
|
78
70
|
icon,
|
|
79
71
|
label = 'Link',
|
|
@@ -100,5 +92,4 @@ const Icon = ({
|
|
|
100
92
|
"data-testid": testId
|
|
101
93
|
}, element);
|
|
102
94
|
};
|
|
103
|
-
|
|
104
95
|
export default Icon;
|
|
@@ -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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const DueOn = createElement(ElementName.DueOn);
|
|
54
46
|
/**
|
|
55
47
|
* Creates an element that contains Last Commit hash
|
|
56
48
|
*/
|
|
57
|
-
|
|
58
49
|
export const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const 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 const VoteCount = createElement(ElementName.VoteCount);
|
|
@@ -11,7 +11,6 @@ const MINIMUM_MAX_LINES = 1;
|
|
|
11
11
|
const containerStyles = css`
|
|
12
12
|
flex: 1 1 auto;
|
|
13
13
|
`;
|
|
14
|
-
|
|
15
14
|
const getThemeStyles = theme => {
|
|
16
15
|
switch (theme) {
|
|
17
16
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
@@ -26,7 +25,6 @@ const getThemeStyles = theme => {
|
|
|
26
25
|
text-decoration: underline;
|
|
27
26
|
}
|
|
28
27
|
`;
|
|
29
|
-
|
|
30
28
|
case SmartLinkTheme.Link:
|
|
31
29
|
default:
|
|
32
30
|
return css`
|
|
@@ -41,7 +39,6 @@ const getThemeStyles = theme => {
|
|
|
41
39
|
`;
|
|
42
40
|
}
|
|
43
41
|
};
|
|
44
|
-
|
|
45
42
|
const getAnchorStyles = (size, theme, maxLines, hasSpace) => {
|
|
46
43
|
const sizeStyles = getLinkSizeStyles(size);
|
|
47
44
|
return css`
|
|
@@ -52,32 +49,27 @@ const getAnchorStyles = (size, theme, maxLines, hasSpace) => {
|
|
|
52
49
|
${getThemeStyles(theme)}
|
|
53
50
|
`;
|
|
54
51
|
};
|
|
55
|
-
|
|
56
52
|
const getMaxLines = maxLines => {
|
|
57
53
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
58
54
|
return DEFAULT_MAX_LINES;
|
|
59
55
|
}
|
|
60
|
-
|
|
61
56
|
if (maxLines < MINIMUM_MAX_LINES) {
|
|
62
57
|
return MINIMUM_MAX_LINES;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
59
|
return maxLines;
|
|
66
60
|
};
|
|
67
|
-
|
|
68
61
|
const withTooltip = (trigger, content, testId) => jsx(Tooltip, {
|
|
69
62
|
content: content,
|
|
70
63
|
testId: `${testId}-tooltip`,
|
|
71
64
|
tag: "span"
|
|
72
65
|
}, trigger);
|
|
66
|
+
|
|
73
67
|
/**
|
|
74
68
|
* A base element that represent an anchor.
|
|
75
69
|
* @internal
|
|
76
70
|
* @param {LinkProps} LinkProps - The props necessary for the Link element.
|
|
77
71
|
* @see LinkIcon
|
|
78
72
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
73
|
const Link = ({
|
|
82
74
|
hideTooltip,
|
|
83
75
|
maxLines = DEFAULT_MAX_LINES,
|
|
@@ -105,5 +97,4 @@ const Link = ({
|
|
|
105
97
|
css: containerStyles
|
|
106
98
|
}, hideTooltip || text === undefined ? anchor : withTooltip(anchor, text, testId));
|
|
107
99
|
};
|
|
108
|
-
|
|
109
100
|
export default Link;
|
|
@@ -24,13 +24,13 @@ const actionStyles = css`
|
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
|
+
|
|
27
28
|
/**
|
|
28
29
|
* A base element that displays a Lozenge.
|
|
29
30
|
* @internal
|
|
30
31
|
* @param {LozengeProps} LozengeProps - The props necessary for the Lozenge element.
|
|
31
32
|
* @see State
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
34
|
const Lozenge = ({
|
|
35
35
|
appearance = 'default',
|
|
36
36
|
name,
|
|
@@ -47,11 +47,9 @@ const Lozenge = ({
|
|
|
47
47
|
}, [onClick]);
|
|
48
48
|
const onMouseEnter = useCallback(() => onHover(true), [onHover]);
|
|
49
49
|
const onMouseLeave = useCallback(() => onHover(false), [onHover]);
|
|
50
|
-
|
|
51
50
|
if (!text) {
|
|
52
51
|
return null;
|
|
53
52
|
}
|
|
54
|
-
|
|
55
53
|
return jsx("span", {
|
|
56
54
|
css: [styles, onClick ? actionStyles : undefined, overrideCss],
|
|
57
55
|
"data-fit-to-content": true,
|
|
@@ -71,5 +69,4 @@ const Lozenge = ({
|
|
|
71
69
|
testId: `${testId}-action`
|
|
72
70
|
})));
|
|
73
71
|
};
|
|
74
|
-
|
|
75
72
|
export default Lozenge;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import ImageIcon from '../../common/image-icon';
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Media: Image
|
|
8
7
|
* [aspect-ratio: 16 / 9] The context box is fixed to aspect ratio of 16:9.
|
|
@@ -47,13 +46,13 @@ const styles = css`
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
`;
|
|
49
|
+
|
|
50
50
|
/**
|
|
51
51
|
* A base element that displays a Media.
|
|
52
52
|
* @internal
|
|
53
53
|
* @param {MediaProps} MediaProps - The props necessary for the Media element.
|
|
54
54
|
* @see Preview
|
|
55
55
|
*/
|
|
56
|
-
|
|
57
56
|
const Media = ({
|
|
58
57
|
name,
|
|
59
58
|
overrideCss,
|
|
@@ -66,7 +65,6 @@ const Media = ({
|
|
|
66
65
|
if (!type || !url) {
|
|
67
66
|
return null;
|
|
68
67
|
}
|
|
69
|
-
|
|
70
68
|
return jsx("div", {
|
|
71
69
|
css: [styles, overrideCss],
|
|
72
70
|
"data-smart-element": name,
|
|
@@ -80,5 +78,4 @@ const Media = ({
|
|
|
80
78
|
defaultIcon: null
|
|
81
79
|
}));
|
|
82
80
|
};
|
|
83
|
-
|
|
84
81
|
export default Media;
|
|
@@ -3,21 +3,19 @@ import React from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { getFormattedMessage, getTruncateStyles } from '../../utils';
|
|
5
5
|
import { tokens } from '../../../../../utils/token';
|
|
6
|
-
|
|
7
6
|
const getStyles = maxLines => css`
|
|
8
7
|
color: ${tokens.text};
|
|
9
8
|
font-size: 0.75rem;
|
|
10
9
|
line-height: 1rem;
|
|
11
10
|
${getTruncateStyles(maxLines)}
|
|
12
11
|
`;
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* A base element that displays some Text.
|
|
15
15
|
* @internal
|
|
16
16
|
* @param {TextProps} TextProps - The props necessary for the Text element.
|
|
17
17
|
* @see Title
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
19
|
const Text = ({
|
|
22
20
|
content,
|
|
23
21
|
maxLines = 1,
|
|
@@ -29,7 +27,6 @@ const Text = ({
|
|
|
29
27
|
if (!message && !content) {
|
|
30
28
|
return null;
|
|
31
29
|
}
|
|
32
|
-
|
|
33
30
|
return jsx("span", {
|
|
34
31
|
css: [getStyles(maxLines), overrideCss],
|
|
35
32
|
"data-separator": true,
|
|
@@ -38,5 +35,4 @@ const Text = ({
|
|
|
38
35
|
"data-testid": testId
|
|
39
36
|
}, getFormattedMessage(message) || content);
|
|
40
37
|
};
|
|
41
|
-
|
|
42
38
|
export default Text;
|
|
@@ -125,25 +125,20 @@ const elementMappings = {
|
|
|
125
125
|
component: Link
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
|
|
129
128
|
const getContextKey = name => {
|
|
130
129
|
// Attempt to predict context prop name in advance to reduce the amount of
|
|
131
130
|
// code run during runtime
|
|
132
131
|
return name.length > 0 ? name.charAt(0).toLowerCase() + name.slice(1) : undefined;
|
|
133
132
|
};
|
|
134
|
-
|
|
135
133
|
const getData = (elementName, contextKey, context) => {
|
|
136
134
|
if (!context) {
|
|
137
135
|
return undefined;
|
|
138
136
|
}
|
|
139
|
-
|
|
140
137
|
const data = context[contextKey];
|
|
141
|
-
|
|
142
138
|
switch (elementName) {
|
|
143
139
|
case ElementName.AuthorGroup:
|
|
144
140
|
case ElementName.CollaboratorGroup:
|
|
145
141
|
return toAvatarGroupProps(data);
|
|
146
|
-
|
|
147
142
|
case ElementName.AttachmentCount:
|
|
148
143
|
case ElementName.ChecklistProgress:
|
|
149
144
|
case ElementName.CommentCount:
|
|
@@ -154,47 +149,36 @@ const getData = (elementName, contextKey, context) => {
|
|
|
154
149
|
case ElementName.SubscriberCount:
|
|
155
150
|
case ElementName.LatestCommit:
|
|
156
151
|
return toBadgeProps(data);
|
|
157
|
-
|
|
158
152
|
case ElementName.CreatedBy:
|
|
159
153
|
return toFormattedTextProps(messages.created_by, context.createdBy);
|
|
160
|
-
|
|
161
154
|
case ElementName.CreatedOn:
|
|
162
155
|
return toDateTimeProps('created', context.createdOn);
|
|
163
|
-
|
|
164
156
|
case ElementName.DueOn:
|
|
165
157
|
return toDateLozengeProps(context.dueOn);
|
|
166
|
-
|
|
167
158
|
case ElementName.ModifiedBy:
|
|
168
159
|
return toFormattedTextProps(messages.modified_by, context.modifiedBy);
|
|
169
|
-
|
|
170
160
|
case ElementName.ModifiedOn:
|
|
171
161
|
return toDateTimeProps('modified', context.modifiedOn);
|
|
172
|
-
|
|
173
162
|
case ElementName.Snippet:
|
|
174
163
|
case ElementName.SourceBranch:
|
|
175
164
|
case ElementName.TargetBranch:
|
|
176
165
|
return toTextProps(data);
|
|
177
|
-
|
|
178
166
|
case ElementName.Title:
|
|
179
167
|
return toLinkProps(context.title, context.url);
|
|
180
|
-
|
|
181
168
|
default:
|
|
182
169
|
return data;
|
|
183
170
|
}
|
|
184
171
|
};
|
|
185
|
-
|
|
186
172
|
const toAvatarGroupProps = items => {
|
|
187
173
|
return items ? {
|
|
188
174
|
items
|
|
189
175
|
} : undefined;
|
|
190
176
|
};
|
|
191
|
-
|
|
192
177
|
const toBadgeProps = label => {
|
|
193
178
|
return label ? {
|
|
194
179
|
label
|
|
195
180
|
} : undefined;
|
|
196
181
|
};
|
|
197
|
-
|
|
198
182
|
const toDateLozengeProps = dateString => {
|
|
199
183
|
if (dateString) {
|
|
200
184
|
const text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
|
|
@@ -209,14 +193,12 @@ const toDateLozengeProps = dateString => {
|
|
|
209
193
|
};
|
|
210
194
|
}
|
|
211
195
|
};
|
|
212
|
-
|
|
213
196
|
const toDateTimeProps = (type, dateString) => {
|
|
214
197
|
return dateString ? {
|
|
215
198
|
date: new Date(dateString),
|
|
216
199
|
type
|
|
217
200
|
} : undefined;
|
|
218
201
|
};
|
|
219
|
-
|
|
220
202
|
const toFormattedTextProps = (descriptor, context) => {
|
|
221
203
|
return context ? {
|
|
222
204
|
message: {
|
|
@@ -227,31 +209,26 @@ const toFormattedTextProps = (descriptor, context) => {
|
|
|
227
209
|
}
|
|
228
210
|
} : undefined;
|
|
229
211
|
};
|
|
230
|
-
|
|
231
212
|
const toLinkProps = (text, url) => {
|
|
232
213
|
return text ? {
|
|
233
214
|
text,
|
|
234
215
|
url
|
|
235
216
|
} : undefined;
|
|
236
217
|
};
|
|
237
|
-
|
|
238
218
|
const toTextProps = content => {
|
|
239
219
|
return content ? {
|
|
240
220
|
content
|
|
241
221
|
} : undefined;
|
|
242
222
|
};
|
|
243
|
-
|
|
244
223
|
export const createElement = name => {
|
|
245
224
|
const {
|
|
246
225
|
component: BaseElement,
|
|
247
226
|
props
|
|
248
227
|
} = elementMappings[name] || {};
|
|
249
228
|
const contextKey = getContextKey(name);
|
|
250
|
-
|
|
251
229
|
if (!BaseElement) {
|
|
252
230
|
throw Error(`Element ${name} does not exist.`);
|
|
253
231
|
}
|
|
254
|
-
|
|
255
232
|
return overrides => {
|
|
256
233
|
const context = useContext(FlexibleUiContext);
|
|
257
234
|
const data = getData(name, contextKey, context);
|
|
@@ -20,7 +20,6 @@ export const getFormattedMessage = message => {
|
|
|
20
20
|
}));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
24
23
|
const getIconDimensionStyles = value => css`
|
|
25
24
|
height: ${value};
|
|
26
25
|
min-height: ${value};
|
|
@@ -29,7 +28,6 @@ const getIconDimensionStyles = value => css`
|
|
|
29
28
|
min-width: ${value};
|
|
30
29
|
max-width: ${value};
|
|
31
30
|
`;
|
|
32
|
-
|
|
33
31
|
export const getIconSizeStyles = width => {
|
|
34
32
|
const sizeStyles = getIconDimensionStyles(width);
|
|
35
33
|
return css`
|
|
@@ -49,13 +47,10 @@ export const getIconWidth = size => {
|
|
|
49
47
|
switch (size) {
|
|
50
48
|
case SmartLinkSize.XLarge:
|
|
51
49
|
return '2rem';
|
|
52
|
-
|
|
53
50
|
case SmartLinkSize.Large:
|
|
54
51
|
return '1.5rem';
|
|
55
|
-
|
|
56
52
|
case SmartLinkSize.Medium:
|
|
57
53
|
return '1rem';
|
|
58
|
-
|
|
59
54
|
case SmartLinkSize.Small:
|
|
60
55
|
default:
|
|
61
56
|
return '.75rem';
|
|
@@ -65,7 +60,6 @@ export const getLinkLineHeight = size => {
|
|
|
65
60
|
switch (size) {
|
|
66
61
|
case SmartLinkSize.XLarge:
|
|
67
62
|
return '1.5rem';
|
|
68
|
-
|
|
69
63
|
case SmartLinkSize.Large:
|
|
70
64
|
case SmartLinkSize.Medium:
|
|
71
65
|
case SmartLinkSize.Small:
|
|
@@ -82,7 +76,6 @@ export const getLinkSizeStyles = size => {
|
|
|
82
76
|
letter-spacing: -0.008em;
|
|
83
77
|
line-height: ${getLinkLineHeight(size)};
|
|
84
78
|
`;
|
|
85
|
-
|
|
86
79
|
case SmartLinkSize.Large:
|
|
87
80
|
case SmartLinkSize.Medium:
|
|
88
81
|
return css`
|
|
@@ -91,7 +84,6 @@ export const getLinkSizeStyles = size => {
|
|
|
91
84
|
letter-spacing: -0.003em;
|
|
92
85
|
line-height: ${getLinkLineHeight(size)};
|
|
93
86
|
`;
|
|
94
|
-
|
|
95
87
|
case SmartLinkSize.Small:
|
|
96
88
|
default:
|
|
97
89
|
return css`
|
|
@@ -109,7 +101,6 @@ export const getMaxLineHeight = size => {
|
|
|
109
101
|
case SmartLinkSize.XLarge:
|
|
110
102
|
case SmartLinkSize.Large:
|
|
111
103
|
return 1.75;
|
|
112
|
-
|
|
113
104
|
case SmartLinkSize.Medium:
|
|
114
105
|
case SmartLinkSize.Small:
|
|
115
106
|
default:
|
|
@@ -120,11 +111,9 @@ export const getMaxLines = (value, defaultValue, max, min) => {
|
|
|
120
111
|
if (value > max) {
|
|
121
112
|
return defaultValue;
|
|
122
113
|
}
|
|
123
|
-
|
|
124
114
|
if (value < min) {
|
|
125
115
|
return min;
|
|
126
116
|
}
|
|
127
|
-
|
|
128
117
|
return value;
|
|
129
118
|
};
|
|
130
119
|
export const getTruncateStyles = (maxLines, lineHeight = '1rem', wordBreak = 'break-word') => css`
|
|
@@ -4,13 +4,13 @@ import { SmartLinkStatus } from '../../constants';
|
|
|
4
4
|
import Container from './components/container';
|
|
5
5
|
import { FlexibleUiAnalyticsContext, FlexibleUiContext } from '../../state/flexible-ui-context';
|
|
6
6
|
import { getContextByStatus, getRetryOptions } from './utils';
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
9
10
|
* This is the container in which all Flexible UI Blocks and Elements exist.
|
|
10
11
|
* Note: TitleBlock is mandatory for a Flexible Card to render.
|
|
11
12
|
* @see Container
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
14
|
const FlexibleCard = ({
|
|
15
15
|
cardState,
|
|
16
16
|
children,
|
|
@@ -44,9 +44,7 @@ const FlexibleCard = ({
|
|
|
44
44
|
url
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
|
|
48
47
|
break;
|
|
49
|
-
|
|
50
48
|
case SmartLinkStatus.Errored:
|
|
51
49
|
case SmartLinkStatus.Fallback:
|
|
52
50
|
case SmartLinkStatus.Forbidden:
|
|
@@ -58,7 +56,6 @@ const FlexibleCard = ({
|
|
|
58
56
|
url
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
|
-
|
|
62
59
|
break;
|
|
63
60
|
}
|
|
64
61
|
}, [onError, onResolve, status, title, url]);
|
|
@@ -75,5 +72,4 @@ const FlexibleCard = ({
|
|
|
75
72
|
status: status
|
|
76
73
|
}), children)));
|
|
77
74
|
};
|
|
78
|
-
|
|
79
75
|
export default FlexibleCard;
|