@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
|
@@ -5,7 +5,6 @@ import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './u
|
|
|
5
5
|
import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getSubproduct } from '../helpers';
|
|
6
6
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
7
|
import { trackLinkUpdated, uiIframeDwelledEvent, uiIframeFocusedEvent } from '../../utils/analytics/analytics';
|
|
8
|
-
|
|
9
8
|
const applyCommonAttributes = (event, commonAttributes) => {
|
|
10
9
|
if (event && event.attributes) {
|
|
11
10
|
for (const [key, value] of Object.entries(commonAttributes)) {
|
|
@@ -14,9 +13,9 @@ const applyCommonAttributes = (event, commonAttributes) => {
|
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
return event;
|
|
19
17
|
};
|
|
18
|
+
|
|
20
19
|
/**
|
|
21
20
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
22
21
|
* Can be provided to Card via the analyticsEvents prop to change the analytics events.
|
|
@@ -26,11 +25,9 @@ const applyCommonAttributes = (event, commonAttributes) => {
|
|
|
26
25
|
* @param defaultLocation location attribute to be used
|
|
27
26
|
* @returns
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
28
|
export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocation) => {
|
|
32
|
-
const defaultId = id || 'NULL';
|
|
33
|
-
|
|
29
|
+
const defaultId = id || 'NULL';
|
|
30
|
+
// We don't want to trigger a re-render by using useSmartCardState
|
|
34
31
|
const {
|
|
35
32
|
store
|
|
36
33
|
} = useSmartLinkContext();
|
|
@@ -50,8 +47,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
50
47
|
destinationProduct: extractedProduct,
|
|
51
48
|
location: defaultLocation
|
|
52
49
|
}), [defaultId, extractedDefinitionId, extractedExtensionKey, extractedResourceType, extractedSubproduct, extractedProduct, defaultLocation]);
|
|
53
|
-
/** Contains all ui analytics events */
|
|
54
50
|
|
|
51
|
+
/** Contains all ui analytics events */
|
|
55
52
|
const ui = useMemo(() => ({
|
|
56
53
|
/**
|
|
57
54
|
* This fires an event that represents when a user clicks on the authentication
|
|
@@ -78,7 +75,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
78
75
|
destinationSubproduct,
|
|
79
76
|
location
|
|
80
77
|
}), commonAttributes)),
|
|
81
|
-
|
|
82
78
|
/**
|
|
83
79
|
* This fires an event that represents when a user clicks on the authentication
|
|
84
80
|
* call to action with a forbidden authenticated account. (i.e. Try another account).
|
|
@@ -104,7 +100,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
104
100
|
destinationSubproduct,
|
|
105
101
|
location
|
|
106
102
|
}), commonAttributes)),
|
|
107
|
-
|
|
108
103
|
/**
|
|
109
104
|
* This fires an event that represents when a user
|
|
110
105
|
* click a button.
|
|
@@ -114,12 +109,12 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
114
109
|
action: 'clicked',
|
|
115
110
|
actionSubject: 'button',
|
|
116
111
|
actionSubjectId: data.actionSubjectId,
|
|
117
|
-
attributes: {
|
|
112
|
+
attributes: {
|
|
113
|
+
...context,
|
|
118
114
|
...data.attributes
|
|
119
115
|
},
|
|
120
116
|
eventType: 'ui'
|
|
121
117
|
}, commonAttributes)),
|
|
122
|
-
|
|
123
118
|
/**
|
|
124
119
|
* This fires an event that represents when a user clicks on a Smart Link.
|
|
125
120
|
* @param id The unique ID for this Smart Link.
|
|
@@ -155,7 +150,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
155
150
|
destinationSubproduct,
|
|
156
151
|
actionSubjectId
|
|
157
152
|
}), commonAttributes)),
|
|
158
|
-
|
|
159
153
|
/**
|
|
160
154
|
* This fires an event that represents when a user dwells their cursor on a Smart Link's iframe.
|
|
161
155
|
* @param id The unique ID for this Smart Link.
|
|
@@ -192,7 +186,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
192
186
|
dwellTime,
|
|
193
187
|
dwellPercentVisible
|
|
194
188
|
}), commonAttributes)),
|
|
195
|
-
|
|
196
189
|
/**
|
|
197
190
|
* This fires an event that represents when a user clicks or tabs into a Smart Link's iframe.
|
|
198
191
|
* @param id The unique ID for this Smart Link.
|
|
@@ -223,7 +216,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
223
216
|
destinationProduct,
|
|
224
217
|
destinationSubproduct
|
|
225
218
|
}), commonAttributes)),
|
|
226
|
-
|
|
227
219
|
/**
|
|
228
220
|
* This fires an event that represents when a user clicks on a Smart Link action.
|
|
229
221
|
* Note: This also starts the UFO smart-link-action-invocation experience.
|
|
@@ -264,7 +256,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
264
256
|
location
|
|
265
257
|
}), commonAttributes));
|
|
266
258
|
},
|
|
267
|
-
|
|
268
259
|
/**
|
|
269
260
|
* This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
|
|
270
261
|
* https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
|
|
@@ -293,7 +284,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
293
284
|
previewInvokeMethod
|
|
294
285
|
}), commonAttributes));
|
|
295
286
|
},
|
|
296
|
-
|
|
297
287
|
/**
|
|
298
288
|
* This fires an event that represents when a user closed the authentication window without authenticating after opening it.
|
|
299
289
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
@@ -318,7 +308,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
318
308
|
destinationSubproduct,
|
|
319
309
|
location
|
|
320
310
|
}), commonAttributes)),
|
|
321
|
-
|
|
322
311
|
/**
|
|
323
312
|
* This fires an event that represents when a user close a modal.
|
|
324
313
|
* @param data A partial analytics event payload
|
|
@@ -327,12 +316,12 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
327
316
|
action: 'closed',
|
|
328
317
|
actionSubject: 'modal',
|
|
329
318
|
actionSubjectId: data.actionSubjectId,
|
|
330
|
-
attributes: {
|
|
319
|
+
attributes: {
|
|
320
|
+
...context,
|
|
331
321
|
...data.attributes
|
|
332
322
|
},
|
|
333
323
|
eventType: 'ui'
|
|
334
324
|
}, commonAttributes)),
|
|
335
|
-
|
|
336
325
|
/**
|
|
337
326
|
* This fires an event that represents when a Smart Link was rendered successfully.
|
|
338
327
|
* Note: this fires even if the Smart Link request errored out.
|
|
@@ -356,8 +345,9 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
356
345
|
succeedUfoExperience('smart-link-rendered', experienceId, {
|
|
357
346
|
extensionKey,
|
|
358
347
|
display
|
|
359
|
-
});
|
|
348
|
+
});
|
|
360
349
|
|
|
350
|
+
// UFO will disregard this if authentication experience has not yet been started
|
|
361
351
|
succeedUfoExperience('smart-link-authenticated', experienceId, {
|
|
362
352
|
display
|
|
363
353
|
});
|
|
@@ -372,7 +362,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
372
362
|
location
|
|
373
363
|
}), commonAttributes));
|
|
374
364
|
},
|
|
375
|
-
|
|
376
365
|
/**
|
|
377
366
|
* This fires an event that represents when a Smart Link renders unsuccessfuly.
|
|
378
367
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
@@ -392,9 +381,9 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
392
381
|
destinationSubproduct,
|
|
393
382
|
location
|
|
394
383
|
}) => {
|
|
395
|
-
const experienceId = id ? id : defaultId;
|
|
384
|
+
const experienceId = id ? id : defaultId;
|
|
385
|
+
// Start and fail the smart-link-rendered experience. If it has already
|
|
396
386
|
// been started nothing happens.
|
|
397
|
-
|
|
398
387
|
startUfoExperience('smart-link-rendered', experienceId);
|
|
399
388
|
failUfoExperience('smart-link-rendered', experienceId);
|
|
400
389
|
failUfoExperience('smart-link-authenticated', experienceId);
|
|
@@ -410,7 +399,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
410
399
|
location
|
|
411
400
|
}), commonAttributes));
|
|
412
401
|
},
|
|
413
|
-
|
|
414
402
|
/**
|
|
415
403
|
* This fires an event that represents a hover preview being opened.
|
|
416
404
|
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
@@ -442,7 +430,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
442
430
|
previewInvokeMethod,
|
|
443
431
|
status
|
|
444
432
|
}), commonAttributes)),
|
|
445
|
-
|
|
446
433
|
/**
|
|
447
434
|
* This fires an event that represents a hover preview being dismissed.
|
|
448
435
|
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
@@ -477,7 +464,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
477
464
|
previewInvokeMethod,
|
|
478
465
|
status
|
|
479
466
|
}), commonAttributes)),
|
|
480
|
-
|
|
481
467
|
/**
|
|
482
468
|
* Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
|
|
483
469
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
@@ -485,8 +471,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
485
471
|
*/
|
|
486
472
|
learnMoreClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiLearnMoreLinkClickedEvent(), commonAttributes))
|
|
487
473
|
}), [defaultId, commonAttributes, dispatchAnalytics]);
|
|
488
|
-
/** Contains all operational analytics events */
|
|
489
474
|
|
|
475
|
+
/** Contains all operational analytics events */
|
|
490
476
|
const operational = useMemo(() => ({
|
|
491
477
|
/**
|
|
492
478
|
* This fires an event that represents an action being successfully invoked.
|
|
@@ -519,7 +505,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
519
505
|
location
|
|
520
506
|
}), commonAttributes));
|
|
521
507
|
},
|
|
522
|
-
|
|
523
508
|
/**
|
|
524
509
|
* This fires an event that represents an action being unsuccessfully invoked.
|
|
525
510
|
* @param id The unique ID for this Smart Link.
|
|
@@ -554,7 +539,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
554
539
|
location
|
|
555
540
|
}), commonAttributes));
|
|
556
541
|
},
|
|
557
|
-
|
|
558
542
|
/**
|
|
559
543
|
* This fires an event that represents an account successfully being connected via a Smart Link.
|
|
560
544
|
* @param id The unique ID for this Smart Link.
|
|
@@ -575,7 +559,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
575
559
|
extensionKey,
|
|
576
560
|
status: 'success'
|
|
577
561
|
});
|
|
578
|
-
dispatchAnalytics(applyCommonAttributes(connectSucceededEvent({
|
|
562
|
+
dispatchAnalytics(applyCommonAttributes(connectSucceededEvent({
|
|
563
|
+
...commonAttributes,
|
|
579
564
|
id: experienceId,
|
|
580
565
|
extensionKey,
|
|
581
566
|
definitionId,
|
|
@@ -585,7 +570,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
585
570
|
location
|
|
586
571
|
}), commonAttributes));
|
|
587
572
|
},
|
|
588
|
-
|
|
589
573
|
/**
|
|
590
574
|
* This fires an event that represents an account unsuccessfully being connected.
|
|
591
575
|
* @param id The unique ID for this Smart Link.
|
|
@@ -608,7 +592,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
608
592
|
extensionKey,
|
|
609
593
|
status: reason
|
|
610
594
|
});
|
|
611
|
-
dispatchAnalytics(applyCommonAttributes(connectFailedEvent({
|
|
595
|
+
dispatchAnalytics(applyCommonAttributes(connectFailedEvent({
|
|
596
|
+
...commonAttributes,
|
|
612
597
|
id: experienceId,
|
|
613
598
|
reason,
|
|
614
599
|
extensionKey,
|
|
@@ -619,7 +604,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
619
604
|
location
|
|
620
605
|
}), commonAttributes));
|
|
621
606
|
},
|
|
622
|
-
|
|
623
607
|
/**
|
|
624
608
|
* This fires an event which represents a Smart Link request succeeding or failing based on the status.
|
|
625
609
|
* @param id The unique ID for this Smart Link.
|
|
@@ -640,7 +624,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
640
624
|
location,
|
|
641
625
|
error
|
|
642
626
|
}) => {
|
|
643
|
-
const event = instrumentEvent({
|
|
627
|
+
const event = instrumentEvent({
|
|
628
|
+
...commonAttributes,
|
|
644
629
|
id,
|
|
645
630
|
status,
|
|
646
631
|
extensionKey,
|
|
@@ -651,12 +636,10 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
651
636
|
location,
|
|
652
637
|
error
|
|
653
638
|
});
|
|
654
|
-
|
|
655
639
|
if (event) {
|
|
656
640
|
dispatchAnalytics(applyCommonAttributes(event, commonAttributes));
|
|
657
641
|
}
|
|
658
642
|
},
|
|
659
|
-
|
|
660
643
|
/**
|
|
661
644
|
* This fires an event that represents when a Smart Link renders unsuccessfuly.
|
|
662
645
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
@@ -688,8 +671,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
688
671
|
}), commonAttributes));
|
|
689
672
|
}
|
|
690
673
|
}), [defaultId, commonAttributes, dispatchAnalytics]);
|
|
691
|
-
/** Contains all track analytics events */
|
|
692
674
|
|
|
675
|
+
/** Contains all track analytics events */
|
|
693
676
|
const track = useMemo(() => ({
|
|
694
677
|
/**
|
|
695
678
|
* This fires an event which represents a user connecting their account to view a Smart Link.
|
|
@@ -704,7 +687,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
704
687
|
destinationProduct,
|
|
705
688
|
destinationSubproduct,
|
|
706
689
|
location
|
|
707
|
-
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountConnected({
|
|
690
|
+
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountConnected({
|
|
691
|
+
...commonAttributes,
|
|
708
692
|
extensionKey,
|
|
709
693
|
definitionId,
|
|
710
694
|
resourceType,
|
|
@@ -712,7 +696,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
712
696
|
destinationSubproduct,
|
|
713
697
|
location
|
|
714
698
|
}), commonAttributes)),
|
|
715
|
-
|
|
716
699
|
/**
|
|
717
700
|
* This fires an event which represents a user starting the Smart Link connect account process.
|
|
718
701
|
* @param location a location where the Smart Link auth action was initiated.
|
|
@@ -722,20 +705,21 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
722
705
|
appAccountAuthStarted: ({
|
|
723
706
|
extensionKey,
|
|
724
707
|
location
|
|
725
|
-
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountAuthStarted({
|
|
708
|
+
}) => dispatchAnalytics(applyCommonAttributes(trackAppAccountAuthStarted({
|
|
709
|
+
...commonAttributes,
|
|
726
710
|
extensionKey,
|
|
727
711
|
location
|
|
728
712
|
}), commonAttributes)),
|
|
729
|
-
|
|
730
713
|
/**
|
|
731
714
|
* This fires a tracking event before and after link updated.
|
|
732
715
|
*/
|
|
733
|
-
linkUpdated: props => dispatchAnalytics(applyCommonAttributes(trackLinkUpdated({
|
|
716
|
+
linkUpdated: props => dispatchAnalytics(applyCommonAttributes(trackLinkUpdated({
|
|
717
|
+
...commonAttributes,
|
|
734
718
|
...props
|
|
735
719
|
}), commonAttributes))
|
|
736
720
|
}), [commonAttributes, dispatchAnalytics]);
|
|
737
|
-
/** Contains all screen analytics events */
|
|
738
721
|
|
|
722
|
+
/** Contains all screen analytics events */
|
|
739
723
|
const screen = useMemo(() => ({
|
|
740
724
|
/**
|
|
741
725
|
* This fires an event which represents the connect account page being opened.
|
|
@@ -750,7 +734,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
750
734
|
destinationProduct,
|
|
751
735
|
destinationSubproduct,
|
|
752
736
|
location
|
|
753
|
-
}) => dispatchAnalytics(applyCommonAttributes(screenAuthPopupEvent({
|
|
737
|
+
}) => dispatchAnalytics(applyCommonAttributes(screenAuthPopupEvent({
|
|
738
|
+
...commonAttributes,
|
|
754
739
|
extensionKey,
|
|
755
740
|
definitionId,
|
|
756
741
|
resourceType,
|
|
@@ -758,7 +743,6 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
758
743
|
destinationSubproduct,
|
|
759
744
|
location
|
|
760
745
|
}), commonAttributes)),
|
|
761
|
-
|
|
762
746
|
/**
|
|
763
747
|
* This fires an event that represents when a user view a modal.
|
|
764
748
|
* @param data A partial analytics event payload
|
|
@@ -766,7 +750,8 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
|
|
|
766
750
|
modalViewedEvent: data => dispatchAnalytics(applyCommonAttributes({
|
|
767
751
|
action: 'viewed',
|
|
768
752
|
actionSubject: data.name,
|
|
769
|
-
attributes: {
|
|
753
|
+
attributes: {
|
|
754
|
+
...context,
|
|
770
755
|
...data.attributes
|
|
771
756
|
},
|
|
772
757
|
eventType: 'screen',
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { useContext, createContext } from 'react';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
5
4
|
* underlying elements.
|
|
6
5
|
*/
|
|
7
6
|
export const FlexibleUiContext = /*#__PURE__*/createContext(undefined);
|
|
8
7
|
export const useFlexibleUiContext = () => useContext(FlexibleUiContext);
|
|
8
|
+
|
|
9
9
|
/**
|
|
10
10
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
11
11
|
* underlying elements.
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
export const FlexibleUiAnalyticsContext = /*#__PURE__*/createContext(undefined);
|
|
15
14
|
export const useFlexibleUiAnalyticsContext = () => useContext(FlexibleUiAnalyticsContext);
|
|
@@ -11,37 +11,30 @@ export const getByDefinitionId = (definitionId, store) => {
|
|
|
11
11
|
export const getClickUrl = (url, jsonLd) => {
|
|
12
12
|
if (jsonLd && jsonLd.data) {
|
|
13
13
|
const visitUrl = extractVisitUrl(jsonLd.data);
|
|
14
|
-
|
|
15
14
|
if (visitUrl) {
|
|
16
15
|
return visitUrl;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
return url;
|
|
21
19
|
};
|
|
22
20
|
export const getDefinitionId = details => {
|
|
23
21
|
var _details$meta;
|
|
24
|
-
|
|
25
22
|
return details === null || details === void 0 ? void 0 : (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.definitionId;
|
|
26
23
|
};
|
|
27
24
|
export const getExtensionKey = details => {
|
|
28
25
|
var _details$meta2;
|
|
29
|
-
|
|
30
26
|
return details === null || details === void 0 ? void 0 : (_details$meta2 = details.meta) === null || _details$meta2 === void 0 ? void 0 : _details$meta2.key;
|
|
31
27
|
};
|
|
32
28
|
export const getResourceType = details => {
|
|
33
29
|
var _details$meta3;
|
|
34
|
-
|
|
35
30
|
return details === null || details === void 0 ? void 0 : (_details$meta3 = details.meta) === null || _details$meta3 === void 0 ? void 0 : _details$meta3.resourceType;
|
|
36
31
|
};
|
|
37
32
|
export const getProduct = details => {
|
|
38
33
|
var _details$meta4;
|
|
39
|
-
|
|
40
34
|
return details === null || details === void 0 ? void 0 : (_details$meta4 = details.meta) === null || _details$meta4 === void 0 ? void 0 : _details$meta4.product;
|
|
41
35
|
};
|
|
42
36
|
export const getSubproduct = details => {
|
|
43
37
|
var _details$meta5;
|
|
44
|
-
|
|
45
38
|
return details === null || details === void 0 ? void 0 : (_details$meta5 = details.meta) === null || _details$meta5 === void 0 ? void 0 : _details$meta5.subproduct;
|
|
46
39
|
};
|
|
47
40
|
export const getServices = details => details && details.meta.auth || [];
|
|
@@ -55,8 +48,9 @@ export const isVisible = ({
|
|
|
55
48
|
meta: {
|
|
56
49
|
visibility
|
|
57
50
|
}
|
|
58
|
-
}) => visibility === 'restricted' || visibility === 'public';
|
|
51
|
+
}) => visibility === 'restricted' || visibility === 'public';
|
|
59
52
|
|
|
53
|
+
// Be aware, this is a copy of a function in link-provider/src/helpers
|
|
60
54
|
export const getStatus = ({
|
|
61
55
|
meta
|
|
62
56
|
}) => {
|
|
@@ -64,7 +58,6 @@ export const getStatus = ({
|
|
|
64
58
|
access,
|
|
65
59
|
visibility
|
|
66
60
|
} = meta;
|
|
67
|
-
|
|
68
61
|
switch (access) {
|
|
69
62
|
case 'forbidden':
|
|
70
63
|
if (visibility === 'not_found') {
|
|
@@ -72,10 +65,8 @@ export const getStatus = ({
|
|
|
72
65
|
} else {
|
|
73
66
|
return 'forbidden';
|
|
74
67
|
}
|
|
75
|
-
|
|
76
68
|
case 'unauthorized':
|
|
77
69
|
return 'unauthorized';
|
|
78
|
-
|
|
79
70
|
default:
|
|
80
71
|
return 'resolved';
|
|
81
72
|
}
|
|
@@ -18,47 +18,46 @@ export function usePrefetch(url) {
|
|
|
18
18
|
// If smartlink context props are undefined do nothing.
|
|
19
19
|
if (!store || !prefetchStore || !connections) {
|
|
20
20
|
return;
|
|
21
|
-
}
|
|
21
|
+
}
|
|
22
|
+
// If the link is already being prefetched, the prefetch store
|
|
22
23
|
// should have a flag set against the URL. The prefetch store is purposefully
|
|
23
24
|
// separate from the UI in order to ensure no rendering takes place;
|
|
24
25
|
// all mutations which occur are purely store-based mutations.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const isPrefetching = prefetchStore[url]; // If the link has already been registered in the store, then it no
|
|
26
|
+
const isPrefetching = prefetchStore[url];
|
|
27
|
+
// If the link has already been registered in the store, then it no
|
|
28
28
|
// longer needs to be prefetched, as the normal flow of a link being in
|
|
29
29
|
// the viewport and being fetched is now in motion.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const isFetching = getState()[url];
|
|
31
|
+
// We compute if a link needs to be prefetched thus, referencing the above.
|
|
33
32
|
const needsPrefetch = !isPrefetching && !isFetching;
|
|
34
|
-
|
|
35
33
|
if (needsPrefetch) {
|
|
36
34
|
// We specify in the prefetch store that this link no
|
|
37
35
|
// longer needs to be prefetched. Data which comes back
|
|
38
36
|
// from a successful prefetch flow here will be used to
|
|
39
37
|
// render all URLs which are the same.
|
|
40
|
-
prefetchStore[url] = true;
|
|
38
|
+
prefetchStore[url] = true;
|
|
39
|
+
// Try fetch the data for this URL from Object Resolver Service (ORS), executing batch
|
|
41
40
|
// requests by domain (as usual) to ensure we minimize the amount of connections
|
|
42
41
|
// we create between browser -> ORS when making network requests.
|
|
43
|
-
|
|
44
42
|
try {
|
|
45
|
-
const response = await client.prefetchData(url);
|
|
43
|
+
const response = await client.prefetchData(url);
|
|
44
|
+
// Once the data comes back, we put the link in the `resolved` status. This ensures
|
|
46
45
|
// that when the link enters the viewport and is rendered, we immediately show it as
|
|
47
46
|
// a Smart Link, rather than rendering a loading spinner -> immediate Smart Link.
|
|
48
|
-
|
|
49
47
|
if (response) {
|
|
50
48
|
dispatch({
|
|
51
49
|
type: 'resolved',
|
|
52
50
|
url,
|
|
53
51
|
payload: response
|
|
54
|
-
});
|
|
52
|
+
});
|
|
53
|
+
// Put the metadata in resolved state, theres no need for a pending or errored state as
|
|
55
54
|
// we are following the same render flow as described by the comments above and below.
|
|
56
|
-
|
|
57
55
|
dispatch(cardAction(ACTION_UPDATE_METADATA_STATUS, {
|
|
58
56
|
url
|
|
59
57
|
}, undefined, undefined, 'resolved'));
|
|
60
58
|
}
|
|
61
|
-
} catch (_err) {
|
|
59
|
+
} catch (_err) {
|
|
60
|
+
// Do nothing, link will be retried under the hood with exponential backoff.
|
|
62
61
|
// If it does not succeed even after those retries, the normal resolve flow
|
|
63
62
|
// will start when the link is in view. Since we have not performed any store
|
|
64
63
|
// mutations yet, the link will behave like a 'brand new' link.
|
|
@@ -13,18 +13,19 @@ export function useSmartLink(id, url, dispatchAnalytics) {
|
|
|
13
13
|
const analytics = useSmartLinkAnalytics(url, dispatchAnalytics, id);
|
|
14
14
|
const actions = useSmartLinkActions(id, url, analytics);
|
|
15
15
|
const config = useSmartLinkConfig();
|
|
16
|
-
const renderers = useSmartLinkRenderers();
|
|
17
|
-
|
|
18
|
-
const [error, setError] = useState(null); // Register the current card.
|
|
16
|
+
const renderers = useSmartLinkRenderers();
|
|
19
17
|
|
|
18
|
+
// NB: used to propagate errors from hooks to error boundaries.
|
|
19
|
+
const [error, setError] = useState(null);
|
|
20
|
+
// Register the current card.
|
|
20
21
|
const register = () => {
|
|
21
22
|
actions.register().catch(err => setError(err));
|
|
22
|
-
};
|
|
23
|
+
};
|
|
24
|
+
// AFP-2511 TODO: Fix automatic suppressions below
|
|
23
25
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
useEffect(register, [url, store]);
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
useEffect(register, [url, store]); // Provide the state and card actions to consumers.
|
|
27
|
-
|
|
28
|
+
// Provide the state and card actions to consumers.
|
|
28
29
|
return {
|
|
29
30
|
state,
|
|
30
31
|
actions,
|
|
@@ -17,33 +17,31 @@ export function useSmartLinkActions({
|
|
|
17
17
|
const [actions, setActions] = useState([]);
|
|
18
18
|
const linkState = useLinkState(url);
|
|
19
19
|
const linkAnalytics = useLinkAnalytics(url, analyticsHandler, id);
|
|
20
|
-
const linkActions = useLinkActions(id, url, linkAnalytics);
|
|
20
|
+
const linkActions = useLinkActions(id, url, linkAnalytics);
|
|
21
21
|
|
|
22
|
+
// Start: Smart ink Actions experiment
|
|
22
23
|
const enableActionableElement = useFeatureFlag('enableActionableElement');
|
|
23
24
|
const reload = useCallback(() => linkActions.reload(), [linkActions]);
|
|
24
25
|
const handleInvoke = useCallback(opts => {
|
|
25
26
|
var _opts$action;
|
|
26
|
-
|
|
27
27
|
if (enableActionableElement && opts.type === 'client' && opts.isReloadRequired && ((_opts$action = opts.action) === null || _opts$action === void 0 ? void 0 : _opts$action.type) === 'PreviewAction') {
|
|
28
28
|
// Reload when embed preview modal close
|
|
29
29
|
const {
|
|
30
30
|
promise
|
|
31
31
|
} = opts.action;
|
|
32
32
|
opts.action.type = 'StatusAction';
|
|
33
|
-
|
|
34
33
|
opts.action.promise = () => promise({
|
|
35
34
|
onClose: reload
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
return linkActions.invoke(opts, appearance);
|
|
40
|
-
}, [appearance, enableActionableElement, linkActions, reload]);
|
|
38
|
+
}, [appearance, enableActionableElement, linkActions, reload]);
|
|
39
|
+
// End: Smart ink Actions experiment
|
|
41
40
|
|
|
42
41
|
useEffect(() => {
|
|
43
42
|
if (!linkState.details) {
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
const cardProperties = extractCardProps(linkState.details.data, linkState.details.meta, {
|
|
48
46
|
handleInvoke,
|
|
49
47
|
analytics: linkAnalytics,
|
|
@@ -51,11 +49,9 @@ export function useSmartLinkActions({
|
|
|
51
49
|
extensionKey: getExtensionKey(linkState.details),
|
|
52
50
|
source: appearance
|
|
53
51
|
}, undefined, platform);
|
|
54
|
-
|
|
55
52
|
if (!cardProperties.actions || cardProperties.actions.length === 0) {
|
|
56
53
|
return;
|
|
57
54
|
}
|
|
58
|
-
|
|
59
55
|
const cardActions = cardProperties.actions.map(action => ({
|
|
60
56
|
id: action.id,
|
|
61
57
|
text: action.text,
|
|
@@ -2,7 +2,6 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import uuid from 'uuid';
|
|
3
3
|
import { useSmartCardActions as useLinkActions } from '../actions';
|
|
4
4
|
import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Exposes a programmatic way to reload the data being used to render a Smart Link.
|
|
8
7
|
* @param
|
|
@@ -4,18 +4,19 @@ import { getUrl } from '@atlaskit/linking-common';
|
|
|
4
4
|
export function useSmartCardState(url) {
|
|
5
5
|
const {
|
|
6
6
|
store
|
|
7
|
-
} = useSmartLinkContext();
|
|
8
|
-
|
|
7
|
+
} = useSmartLinkContext();
|
|
8
|
+
// Initially, card state should be pending and 'empty'.
|
|
9
9
|
const newCardState = getUrl(store, url);
|
|
10
|
-
const [, setCardState] = useState(newCardState);
|
|
11
|
-
|
|
10
|
+
const [, setCardState] = useState(newCardState);
|
|
11
|
+
// Selector for initial and subsequent states.
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
const unsubscribe = store.subscribe(() => {
|
|
14
14
|
// forcing re-renders when the store changes
|
|
15
15
|
setCardState(getUrl(store, url));
|
|
16
16
|
});
|
|
17
17
|
return () => unsubscribe();
|
|
18
|
-
}, [url, store]);
|
|
18
|
+
}, [url, store]);
|
|
19
19
|
|
|
20
|
+
// Returning fresh state for use in view components. Added as a part of the fix in EDM-4422.
|
|
20
21
|
return newCardState;
|
|
21
22
|
}
|