@atlaskit/smart-card 18.0.22 → 19.0.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 +48 -0
- package/dist/cjs/client/index.js +6 -379
- package/dist/cjs/constants.js +4 -4
- package/dist/cjs/extractors/embed/index.js +2 -2
- package/dist/cjs/index.js +7 -13
- package/dist/cjs/state/actions/constants.js +1 -13
- package/dist/cjs/state/actions/index.js +20 -22
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +2 -2
- package/dist/cjs/state/config/index.js +2 -2
- package/dist/cjs/state/helpers.js +1 -9
- package/dist/cjs/state/hooks/usePrefetch.js +2 -2
- package/dist/cjs/state/index.js +4 -4
- package/dist/cjs/state/renderers/index.js +2 -2
- package/dist/cjs/state/store/index.js +5 -5
- package/dist/cjs/utils/mocks.js +2 -2
- package/dist/cjs/utils/test-utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +6 -2
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +15 -2
- package/dist/cjs/view/CardWithUrl/loader.js +5 -7
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/container/index.js +19 -6
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +2 -2
- package/dist/es2019/client/index.js +1 -214
- package/dist/es2019/constants.js +4 -4
- package/dist/es2019/extractors/embed/index.js +1 -1
- package/dist/es2019/index.js +4 -4
- package/dist/es2019/state/actions/constants.js +0 -6
- package/dist/es2019/state/actions/index.js +4 -4
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +1 -1
- package/dist/es2019/state/config/index.js +1 -1
- package/dist/es2019/state/helpers.js +0 -5
- package/dist/es2019/state/hooks/usePrefetch.js +1 -1
- package/dist/es2019/state/index.js +1 -1
- package/dist/es2019/state/renderers/index.js +1 -1
- package/dist/es2019/state/store/index.js +2 -2
- package/dist/es2019/utils/mocks.js +1 -1
- package/dist/es2019/utils/test-utils.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +6 -3
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +8 -2
- package/dist/es2019/view/CardWithUrl/loader.js +5 -7
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/container/index.js +19 -6
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +5 -0
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +2 -2
- package/dist/esm/client/index.js +1 -360
- package/dist/esm/constants.js +4 -4
- package/dist/esm/extractors/embed/index.js +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/state/actions/constants.js +0 -6
- package/dist/esm/state/actions/index.js +4 -4
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +1 -1
- package/dist/esm/state/config/index.js +1 -1
- package/dist/esm/state/helpers.js +0 -5
- package/dist/esm/state/hooks/usePrefetch.js +1 -1
- package/dist/esm/state/index.js +1 -1
- package/dist/esm/state/renderers/index.js +1 -1
- package/dist/esm/state/store/index.js +2 -2
- package/dist/esm/utils/mocks.js +1 -1
- package/dist/esm/utils/test-utils.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +6 -3
- package/dist/esm/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +8 -2
- package/dist/esm/view/CardWithUrl/loader.js +5 -7
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/container/index.js +19 -6
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +5 -0
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +3 -3
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/media/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +2 -2
- package/dist/types/__tests_external__/page-objects/BaseCard.d.ts +1 -2
- package/dist/types/client/index.d.ts +1 -18
- package/dist/types/constants.d.ts +4 -4
- package/dist/types/extractors/block/index.d.ts +1 -1
- package/dist/types/extractors/common/title-prefix/extractTitlePrefix.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/extract-icon-renderer.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/index.d.ts +1 -1
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/extractors/inline/index.d.ts +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/model/invoke-opts.d.ts +1 -14
- package/dist/types/state/actions/constants.d.ts +0 -6
- package/dist/types/state/actions/types.d.ts +2 -13
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -2
- package/dist/types/state/config/index.d.ts +1 -1
- package/dist/types/state/helpers.d.ts +1 -3
- package/dist/types/state/hooks/useSmartLink.d.ts +6 -6
- package/dist/types/state/index.d.ts +3 -3
- package/dist/types/state/reducers/types.d.ts +1 -1
- package/dist/types/state/renderers/index.d.ts +1 -1
- package/dist/types/state/store/index.d.ts +2 -2
- package/dist/types/state/types.d.ts +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/utils/analytics/analytics.d.ts +1 -1
- package/dist/types/utils/analytics/index.d.ts +1 -2
- package/dist/types/utils/performance.d.ts +1 -1
- package/dist/types/view/BlockCard/types.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -3
- package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +43 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +25 -0
- package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +3 -2
- package/dist/types/view/FlexibleCard/components/blocks/element-group/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +8 -2
- package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/metadata-block/types.d.ts +22 -2
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +6 -2
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +63 -13
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +68 -2
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/container/index.d.ts +5 -1
- package/dist/types/view/FlexibleCard/components/container/layered-link/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/container/types.d.ts +20 -10
- package/dist/types/view/FlexibleCard/components/elements/avatar-group/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/avatar-group/types.d.ts +12 -0
- package/dist/types/view/FlexibleCard/components/elements/badge/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/badge/types.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/elements/date-time/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/date-time/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/icon/types.d.ts +16 -3
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/link/index.d.ts +3 -3
- package/dist/types/view/FlexibleCard/components/elements/link/types.d.ts +21 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/elements/media/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/elements/text/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/text/types.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/elements/types.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/types.d.ts +73 -3
- package/dist/types/view/FlexibleCard/utils.d.ts +1 -1
- package/dist/types/view/InlineCard/types.d.ts +1 -1
- package/dist/types/view/__mocks__/intersection-observer.d.ts +3 -0
- package/docs-helpers/flexible-ui-action-item.tsx +6 -0
- package/docs-helpers/flexible-ui-actions-prop.tsx +6 -0
- package/docs-helpers/flexible-ui-element-item.tsx +6 -0
- package/docs-helpers/flexible-ui-prop.tsx +6 -0
- package/docs-helpers/flexible-ui.tsx +28 -0
- package/package.json +3 -9
- package/dist/cjs/client/api.js +0 -119
- package/dist/cjs/client/errors.js +0 -55
- package/dist/cjs/client/types/index.js +0 -5
- package/dist/cjs/client/types/requests.js +0 -5
- package/dist/cjs/client/types/responses.js +0 -31
- package/dist/cjs/client/utils/environments.js +0 -47
- package/dist/cjs/providers/editor/index.js +0 -283
- package/dist/cjs/providers/editor/transformer.js +0 -84
- package/dist/cjs/providers/editor/types.js +0 -5
- package/dist/cjs/state/actions/helpers.js +0 -18
- package/dist/cjs/state/context/index.js +0 -34
- package/dist/cjs/state/context/provider.js +0 -74
- package/dist/cjs/state/context/types.js +0 -5
- package/dist/cjs/state/reducers/index.js +0 -89
- package/dist/cjs/state/store/types.js +0 -5
- package/dist/es2019/client/api.js +0 -38
- package/dist/es2019/client/errors.js +0 -19
- package/dist/es2019/client/types/index.js +0 -1
- package/dist/es2019/client/types/requests.js +0 -1
- package/dist/es2019/client/types/responses.js +0 -19
- package/dist/es2019/client/utils/environments.js +0 -33
- package/dist/es2019/providers/editor/index.js +0 -82
- package/dist/es2019/providers/editor/transformer.js +0 -53
- package/dist/es2019/providers/editor/types.js +0 -1
- package/dist/es2019/state/actions/helpers.js +0 -8
- package/dist/es2019/state/context/index.js +0 -14
- package/dist/es2019/state/context/provider.js +0 -51
- package/dist/es2019/state/context/types.js +0 -1
- package/dist/es2019/state/reducers/index.js +0 -74
- package/dist/es2019/state/store/types.js +0 -1
- package/dist/esm/client/api.js +0 -98
- package/dist/esm/client/errors.js +0 -40
- package/dist/esm/client/types/index.js +0 -1
- package/dist/esm/client/types/requests.js +0 -1
- package/dist/esm/client/types/responses.js +0 -19
- package/dist/esm/client/utils/environments.js +0 -33
- package/dist/esm/providers/editor/index.js +0 -257
- package/dist/esm/providers/editor/transformer.js +0 -73
- package/dist/esm/providers/editor/types.js +0 -1
- package/dist/esm/state/actions/helpers.js +0 -9
- package/dist/esm/state/context/index.js +0 -14
- package/dist/esm/state/context/provider.js +0 -50
- package/dist/esm/state/context/types.js +0 -1
- package/dist/esm/state/reducers/index.js +0 -69
- package/dist/esm/state/store/types.js +0 -1
- package/dist/types/client/api.d.ts +0 -5
- package/dist/types/client/errors.d.ts +0 -9
- package/dist/types/client/types/index.d.ts +0 -13
- package/dist/types/client/types/requests.d.ts +0 -9
- package/dist/types/client/types/responses.d.ts +0 -19
- package/dist/types/client/utils/environments.d.ts +0 -12
- package/dist/types/providers/editor/index.d.ts +0 -22
- package/dist/types/providers/editor/transformer.d.ts +0 -8
- package/dist/types/providers/editor/types.d.ts +0 -19
- package/dist/types/state/actions/helpers.d.ts +0 -2
- package/dist/types/state/context/index.d.ts +0 -8
- package/dist/types/state/context/provider.d.ts +0 -5
- package/dist/types/state/context/types.d.ts +0 -39
- package/dist/types/state/reducers/index.d.ts +0 -4
- package/dist/types/state/store/types.d.ts +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import { useSmartLinkContext } from '
|
|
4
|
-
import { getUrl } from '
|
|
3
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
|
+
import { getUrl } from '@atlaskit/linking-common';
|
|
5
5
|
export function useSmartCardState(url) {
|
|
6
6
|
var _useSmartLinkContext = useSmartLinkContext(),
|
|
7
7
|
store = _useSmartLinkContext.store; // Initially, card state should be pending and 'empty'.
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -10,7 +10,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
-
import CardClient from '
|
|
13
|
+
import { CardClient } from '@atlaskit/link-provider';
|
|
14
14
|
export var mockContext = {
|
|
15
15
|
'@vocab': 'https://www.w3.org/ns/activitystreams#',
|
|
16
16
|
atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
|
package/dist/esm/version.json
CHANGED
|
@@ -3,7 +3,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { useCallback, useState } from 'react';
|
|
4
4
|
import { usePrefetch } from '../../../state';
|
|
5
5
|
import { CardWithUrlContent } from '../component';
|
|
6
|
-
import { LoadingCardLink } from './LazyFallback';
|
|
6
|
+
import { LoadingCardLink } from './LazyFallback';
|
|
7
|
+
import { startUfoExperience } from '../../../state/analytics/ufoExperiences'; // This property enables the intersection observer to be run once the
|
|
7
8
|
// HTML element being observed is within `X` px of the target container it is
|
|
8
9
|
// being compared to. Since the default container is the `document`, we set this
|
|
9
10
|
// up to check once a Smart Link is within `X` px from the bottom of the viewport.
|
|
@@ -17,7 +18,8 @@ export function LazyIntersectionObserverCard(props) {
|
|
|
17
18
|
|
|
18
19
|
var showActions = props.showActions,
|
|
19
20
|
appearance = props.appearance,
|
|
20
|
-
url = props.url
|
|
21
|
+
url = props.url,
|
|
22
|
+
id = props.id;
|
|
21
23
|
var prefetch = usePrefetch(url);
|
|
22
24
|
var Component = appearance === 'inline' ? 'span' : 'div';
|
|
23
25
|
var ComponentObserver = Component;
|
|
@@ -27,12 +29,13 @@ export function LazyIntersectionObserverCard(props) {
|
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
if (isVisible) {
|
|
32
|
+
startUfoExperience('smart-link-rendered', id);
|
|
30
33
|
setIsIntersecting(true);
|
|
31
34
|
observer.disconnect();
|
|
32
35
|
} else {
|
|
33
36
|
prefetch();
|
|
34
37
|
}
|
|
35
|
-
}, [prefetch]);
|
|
38
|
+
}, [prefetch, id]);
|
|
36
39
|
var onRef = useCallback(function (element) {
|
|
37
40
|
if (!element) {
|
|
38
41
|
return;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import LazilyRender from 'react-lazily-render';
|
|
4
4
|
import { CardWithUrlContent } from '../component';
|
|
5
5
|
import { LoadingCardLink } from './LazyFallback';
|
|
6
|
+
import { startUfoExperience } from '../../../state/analytics/ufoExperiences';
|
|
6
7
|
export function LazyLazilyRenderCard(props) {
|
|
7
8
|
var appearance = props.appearance,
|
|
8
9
|
container = props.container,
|
|
9
|
-
showActions = props.showActions
|
|
10
|
+
showActions = props.showActions,
|
|
11
|
+
id = props.id;
|
|
10
12
|
var offset = Math.ceil(window.innerHeight / 4);
|
|
13
|
+
useState(function () {
|
|
14
|
+
// Start of experience when intersectionObserver is not supported.
|
|
15
|
+
startUfoExperience('smart-link-rendered', id);
|
|
16
|
+
});
|
|
11
17
|
return /*#__PURE__*/React.createElement(LazilyRender, {
|
|
12
18
|
offset: offset,
|
|
13
19
|
component: appearance === 'inline' ? 'span' : 'div',
|
|
@@ -16,13 +16,8 @@ export function CardWithURLRenderer(props) {
|
|
|
16
16
|
return uuid();
|
|
17
17
|
}),
|
|
18
18
|
_useState2 = _slicedToArray(_useState, 1),
|
|
19
|
-
id = _useState2[0];
|
|
19
|
+
id = _useState2[0];
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
useState(function () {
|
|
23
|
-
// We want to start timing of render event only once and right at the start
|
|
24
|
-
startUfoExperience('smart-link-rendered', id);
|
|
25
|
-
});
|
|
26
21
|
useEffect(function () {
|
|
27
22
|
// ComponentWillUnmount
|
|
28
23
|
return function () {
|
|
@@ -72,7 +67,10 @@ export function CardWithURLRenderer(props) {
|
|
|
72
67
|
else {
|
|
73
68
|
var errorInfo = {
|
|
74
69
|
componentStack: componentStack
|
|
75
|
-
};
|
|
70
|
+
}; // Start and fail the smart-link-rendered experience. If it has already
|
|
71
|
+
// been started nothing happens.
|
|
72
|
+
|
|
73
|
+
startUfoExperience('smart-link-rendered', id);
|
|
76
74
|
failUfoExperience('smart-link-rendered', id);
|
|
77
75
|
failUfoExperience('smart-link-authenticated', id);
|
|
78
76
|
dispatchAnalytics(uiRenderFailedEvent(appearance, error, errorInfo));
|
|
@@ -58,8 +58,8 @@ var ActionIcon = function ActionIcon(_ref) {
|
|
|
58
58
|
|
|
59
59
|
export var sizeToSpacing = (_sizeToSpacing = {}, _defineProperty(_sizeToSpacing, SmartLinkSize.Small, 'none'), _defineProperty(_sizeToSpacing, SmartLinkSize.Medium, 'compact'), _defineProperty(_sizeToSpacing, SmartLinkSize.Large, 'compact'), _defineProperty(_sizeToSpacing, SmartLinkSize.XLarge, 'default'), _sizeToSpacing);
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @
|
|
61
|
+
* A base action that can be triggered with an on click.
|
|
62
|
+
* @internal
|
|
63
63
|
* @param {ActionProps} ActionProps - The props necessary for the Action.
|
|
64
64
|
* @see DeleteAction
|
|
65
65
|
* @see EditAction
|
|
@@ -19,6 +19,7 @@ var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["
|
|
|
19
19
|
/**
|
|
20
20
|
* Creates a group of Action components. Accepts an array of Actions, in addition to some styling
|
|
21
21
|
* preferences.
|
|
22
|
+
* @internal
|
|
22
23
|
* @param {ActionGroupProps} ActionGroupProps
|
|
23
24
|
* @see Action
|
|
24
25
|
*/
|
|
@@ -12,8 +12,9 @@ var getBlockStyles = function getBlockStyles(direction, size) {
|
|
|
12
12
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n justify-content: flex-start;\n [data-separator] + [data-separator]:before {\n content: '\u2022';\n margin-right: ", "rem;\n }\n"])), getBaseStyles(direction, size), getGapSize(size));
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* A block represents a collection of elements and actions that are arranged
|
|
16
|
-
* All elements and actions should be contained within a Block.
|
|
15
|
+
* A block represents a collection of elements and actions that are arranged
|
|
16
|
+
* in a row. All elements and actions should be contained within a Block.
|
|
17
|
+
* @internal
|
|
17
18
|
* @param {ActionGroupProps} ActionGroupProps
|
|
18
19
|
* @see Action
|
|
19
20
|
*/
|
|
@@ -25,6 +25,7 @@ export var getElementGroupStyles = function getElementGroupStyles(direction, siz
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a group of Action components. Accepts an array of Actions, in addition to some styling
|
|
27
27
|
* preferences.
|
|
28
|
+
* @internal
|
|
28
29
|
* @param {ActionGroupProps} ActionGroupProps
|
|
29
30
|
* @see Action
|
|
30
31
|
*/
|
|
@@ -59,6 +59,7 @@ var getMaxLines = function getMaxLines(maxLines) {
|
|
|
59
59
|
/**
|
|
60
60
|
* Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
|
|
61
61
|
* Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
|
|
62
|
+
* @public
|
|
62
63
|
* @param {MetadataBlockProps} MetadataBlockProps
|
|
63
64
|
* @see Block
|
|
64
65
|
*/
|
|
@@ -40,10 +40,11 @@ var getTitleBlockViewComponent = function getTitleBlockViewComponent(status) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
* Represents a TitleBlock, which is the foundation of
|
|
43
|
+
* Represents a TitleBlock, which is the foundation of Flexible UI.
|
|
44
44
|
* This contains an icon, the link, and any associated metadata and actions in one block.
|
|
45
45
|
* The TitleBlock will also render differently given the state of the smart link.
|
|
46
46
|
* This can be found in the corresponding Resolving, Resolved and Errored views.
|
|
47
|
+
* @public
|
|
47
48
|
* @param {TitleBlockProps} TitleBlockProps
|
|
48
49
|
* @see Block
|
|
49
50
|
* @see TitleBlockResolvingView
|
|
@@ -55,12 +55,21 @@ var renderChildren = function renderChildren(children, containerSize, containerT
|
|
|
55
55
|
return React.Children.map(children, function (child) {
|
|
56
56
|
if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child)) {
|
|
57
57
|
var blockSize = child.props.size;
|
|
58
|
+
var size = blockSize || containerSize;
|
|
59
|
+
|
|
60
|
+
if (isFlexibleUiTitleBlock(child)) {
|
|
61
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
62
|
+
onClick: onClick,
|
|
63
|
+
retry: retry,
|
|
64
|
+
size: size,
|
|
65
|
+
status: status,
|
|
66
|
+
theme: containerTheme
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
size: blockSize || containerSize,
|
|
62
|
-
status: status,
|
|
63
|
-
theme: containerTheme
|
|
71
|
+
size: size,
|
|
72
|
+
status: status
|
|
64
73
|
});
|
|
65
74
|
}
|
|
66
75
|
});
|
|
@@ -94,7 +103,11 @@ var getLayeredLink = function getLayeredLink(testId, context, children) {
|
|
|
94
103
|
});
|
|
95
104
|
};
|
|
96
105
|
/**
|
|
97
|
-
*
|
|
106
|
+
* A container is a hidden component that build the Flexible Smart Link.
|
|
107
|
+
* All of the Flexible UI components are wrapped inside the container.
|
|
108
|
+
* It inherits the ui props from Card component and applies the custom styling
|
|
109
|
+
* accordingly.
|
|
110
|
+
* @internal
|
|
98
111
|
* @see Block
|
|
99
112
|
*/
|
|
100
113
|
|
|
@@ -6,6 +6,11 @@ var _templateObject;
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { jsx, css } from '@emotion/core';
|
|
8
8
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // Stretch the invisible link over the whole of the post.\n // Hide the link\u2019s text.\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow-x: hidden;\n text-indent: 100%;\n white-space: nowrap;\n\n // Needs a heightened specificity to trump other anchor.\n // Stack it under all other links in the post text.\n a&.layered-link {\n position: absolute;\n z-index: 0;\n }\n\n // When hovering over the layered link, any hidden action buttons inside\n // the Container should become visible.\n // As actions resides inside blocks and layered link is expected to be\n // on the same level of blocks. That makes the blocks, e.g. TitleBlock,\n // its sibling. Using general sibling combinator here to apply styling to\n // all the siblings of layered link.\n // The general sibling combinator (~) separates two selectors and matches all\n // iterations of the second element, that are following the first element\n // (though not necessarily immediately), and are children of the same parent\n // element.\n &:hover ~ * {\n .actions-button-group {\n opacity: 1;\n }\n }\n"])));
|
|
9
|
+
/**
|
|
10
|
+
* An anchor component to cover the entire container creating a clickable area.
|
|
11
|
+
* @internal
|
|
12
|
+
* @see `clickableContainer`
|
|
13
|
+
*/
|
|
9
14
|
|
|
10
15
|
var LayeredLink = function LayeredLink(_ref) {
|
|
11
16
|
var target = _ref.target,
|
|
@@ -23,8 +23,8 @@ var getStyles = function getStyles(size) {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
26
|
+
* A base element that displays a group of avatars.
|
|
27
|
+
* @internal
|
|
28
28
|
* @param {AvatarGroupProps} AvatarGroupProps - The props necessary for the AvatarGroup.
|
|
29
29
|
* @see AuthorGroup
|
|
30
30
|
* @see CollaboratorGroup
|
|
@@ -48,8 +48,8 @@ var renderImageIcon = function renderImageIcon(url, testId) {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @
|
|
51
|
+
* A base element that displays some text with an associated icon.
|
|
52
|
+
* @internal
|
|
53
53
|
* @param {BadgeProps} BadgeProps - The props necessary for the Badge.
|
|
54
54
|
* @see CommentCount
|
|
55
55
|
* @see ViewCount
|
|
@@ -17,8 +17,8 @@ var typeToDescriptorMap = {
|
|
|
17
17
|
modified: messages.modified_on
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
20
|
+
* A base element that displays an ISO Timestamp in text.
|
|
21
|
+
* @internal
|
|
22
22
|
* @param {DateTimeProps} DateTimeProps - The props necessary for the DateTime element.
|
|
23
23
|
* @see CreatedOn
|
|
24
24
|
* @see ModifiedOn
|
|
@@ -57,8 +57,8 @@ var renderImageIcon = function renderImageIcon(defaultIcon, icon, url, testId) {
|
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @
|
|
60
|
+
* A base element that displays an Icon or favicon.
|
|
61
|
+
* @internal
|
|
62
62
|
* @param {IconProps} IconProps - The props necessary for the Icon element.
|
|
63
63
|
* @see LinkIcon
|
|
64
64
|
*/
|
|
@@ -5,12 +5,12 @@ import { ElementName } from '../../../../constants';
|
|
|
5
5
|
// createElement and renderElementItems
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* An AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
|
|
9
9
|
* @see AvatarGroup
|
|
10
10
|
*/
|
|
11
11
|
export var AuthorGroup = createElement(ElementName.AuthorGroup);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
|
|
14
14
|
* @see AvatarGroup
|
|
15
15
|
*/
|
|
16
16
|
|
|
@@ -43,9 +43,9 @@ var getMaxLines = function getMaxLines(maxLines) {
|
|
|
43
43
|
return maxLines;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
* @
|
|
48
|
-
* @param {LinkProps} LinkProps - The props necessary for the
|
|
46
|
+
* A base element that represent an anchor.
|
|
47
|
+
* @internal
|
|
48
|
+
* @param {LinkProps} LinkProps - The props necessary for the Link element.
|
|
49
49
|
* @see LinkIcon
|
|
50
50
|
*/
|
|
51
51
|
|
|
@@ -8,8 +8,8 @@ import { css, jsx } from '@emotion/core';
|
|
|
8
8
|
import AtlaskitLozenge from '@atlaskit/lozenge';
|
|
9
9
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: inherit;\n"])));
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
11
|
+
* A base element that displays a Lozenge.
|
|
12
|
+
* @internal
|
|
13
13
|
* @param {LozengeProps} LozengeProps - The props necessary for the Lozenge element.
|
|
14
14
|
* @see State
|
|
15
15
|
*/
|
|
@@ -19,8 +19,8 @@ import ImageIcon from '../../common/image-icon';
|
|
|
19
19
|
*/
|
|
20
20
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n aspect-ratio: 16 / 9;\n display: flex;\n width: 100%;\n\n // fallback\n @supports not (aspect-ratio: auto) {\n padding-top: 56.25%; // 16:9 ratio (9 / 16 = 0.5625)\n height: 0;\n position: relative;\n overflow: hidden;\n }\n\n > img {\n min-height: 100%;\n min-width: 100%;\n max-height: 100%;\n max-width: 100%;\n object-fit: cover;\n object-position: center center;\n\n // fallback\n @supports not (aspect-ratio: auto) {\n position: absolute;\n transform: translate(-50%, -50%);\n left: 50%;\n top: 50%;\n width: auto;\n height: auto;\n }\n }\n"])));
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
22
|
+
* A base element that displays a Media.
|
|
23
|
+
* @internal
|
|
24
24
|
* @param {MediaProps} MediaProps - The props necessary for the Media element.
|
|
25
25
|
* @see Preview
|
|
26
26
|
*/
|
|
@@ -12,8 +12,8 @@ var getStyles = function getStyles(maxLines) {
|
|
|
12
12
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])), tokens.text, getTruncateStyles(maxLines));
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
15
|
+
* A base element that displays some Text.
|
|
16
|
+
* @internal
|
|
17
17
|
* @param {TextProps} TextProps - The props necessary for the Text element.
|
|
18
18
|
* @see Title
|
|
19
19
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="cypress" />
|
|
2
2
|
import { InProductTestPageObject, CypressType } from '@atlaskit/in-product-testing';
|
|
3
|
-
import { CardType } from '
|
|
4
|
-
import { CardAppearance } from '../../view/Card';
|
|
3
|
+
import { CardType, CardAppearance } from '@atlaskit/linking-common';
|
|
5
4
|
export declare class BaseCardPageObject extends InProductTestPageObject {
|
|
6
5
|
protected cy: CypressType;
|
|
7
6
|
protected appearance: CardAppearance;
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { JsonLd } from 'json-ld-types';
|
|
3
|
-
import { CardClient as CardClientInterface, EnvironmentsKeys } from './types';
|
|
4
|
-
import { InvokePayload } from '../model/invoke-opts';
|
|
5
|
-
import { InvokeRequest } from './types/requests';
|
|
6
|
-
export default class CardClient implements CardClientInterface {
|
|
7
|
-
private resolverUrl;
|
|
8
|
-
private loadersByDomain;
|
|
9
|
-
private retryConfig;
|
|
10
|
-
private resolvedCache;
|
|
11
|
-
constructor(envKey?: EnvironmentsKeys);
|
|
12
|
-
private batchResolve;
|
|
13
|
-
private createLoader;
|
|
14
|
-
private getLoader;
|
|
15
|
-
prefetchData(url: string): Promise<JsonLd.Response | undefined>;
|
|
16
|
-
fetchData(url: string): Promise<JsonLd.Response>;
|
|
17
|
-
postData(data: InvokePayload<InvokeRequest>): Promise<JsonLd.Response>;
|
|
18
|
-
}
|
|
1
|
+
export { CardClient as default } from '@atlaskit/link-provider';
|
|
@@ -83,9 +83,6 @@ export declare enum ElementName {
|
|
|
83
83
|
AuthorGroup = "AuthorGroup",
|
|
84
84
|
CollaboratorGroup = "CollaboratorGroup",
|
|
85
85
|
CommentCount = "CommentCount",
|
|
86
|
-
ViewCount = "ViewCount",
|
|
87
|
-
ReactCount = "ReactCount",
|
|
88
|
-
VoteCount = "VoteCount",
|
|
89
86
|
CreatedBy = "CreatedBy",
|
|
90
87
|
CreatedOn = "CreatedOn",
|
|
91
88
|
LinkIcon = "LinkIcon",
|
|
@@ -94,11 +91,14 @@ export declare enum ElementName {
|
|
|
94
91
|
Preview = "Preview",
|
|
95
92
|
Priority = "Priority",
|
|
96
93
|
ProgrammingLanguage = "ProgrammingLanguage",
|
|
94
|
+
Provider = "Provider",
|
|
95
|
+
ReactCount = "ReactCount",
|
|
97
96
|
Snippet = "Snippet",
|
|
98
97
|
State = "State",
|
|
99
98
|
SubscriberCount = "SubscriberCount",
|
|
100
99
|
Title = "Title",
|
|
101
|
-
|
|
100
|
+
ViewCount = "ViewCount",
|
|
101
|
+
VoteCount = "VoteCount"
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* Flexible UI action (button)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
+
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
2
3
|
import { LinkPerson } from '../common/person/types';
|
|
3
4
|
import { ExtractBlockOpts } from './types';
|
|
4
|
-
import { CardProviderRenderers } from '../../state/context/types';
|
|
5
5
|
import { BlockCardResolvedViewProps } from '../../view/BlockCard';
|
|
6
6
|
import { ActionProps } from '../../view/BlockCard/components/Action';
|
|
7
7
|
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts | undefined, platform?: JsonLd.Primitives.Platforms | undefined) => ActionProps[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { JsonLd } from 'json-ld-types';
|
|
3
|
-
import { CardProviderRenderers } from '
|
|
3
|
+
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
4
4
|
import { CardAppearance } from '../../../view/Card';
|
|
5
5
|
export declare const extractTitlePrefix: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers | undefined, type?: CardAppearance | undefined) => string | React.ReactNode | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
-
import { CardProviderRenderers } from '
|
|
2
|
+
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
3
3
|
declare const extractIconRenderer: (data: JsonLd.Data.BaseData, renderers?: CardProviderRenderers | undefined) => (() => React.ReactNode) | undefined;
|
|
4
4
|
export default extractIconRenderer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { JsonLd } from 'json-ld-types';
|
|
3
|
+
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
3
4
|
import { IconType, SmartLinkStatus } from '../../../constants';
|
|
4
|
-
import { CardProviderRenderers } from '../../../state/context/types';
|
|
5
5
|
export declare const extractLinkIcon: (response: JsonLd.Response, renderers?: CardProviderRenderers | undefined) => {
|
|
6
6
|
render: (() => import("react").ReactNode) | undefined;
|
|
7
7
|
icon?: IconType | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
+
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
2
3
|
import { FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
3
|
-
import { CardProviderRenderers } from '../../state/context/types';
|
|
4
4
|
declare const extractFlexibleUiContext: (response?: JsonLd.Response<JsonLd.Data.BaseData> | undefined, renderers?: CardProviderRenderers | undefined) => FlexibleUiDataContext | undefined;
|
|
5
5
|
export default extractFlexibleUiContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { JsonLd } from 'json-ld-types';
|
|
3
|
-
import { CardProviderRenderers } from '
|
|
3
|
+
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
4
4
|
import { InlineCardResolvedViewProps } from '../../view/InlineCard/ResolvedView';
|
|
5
5
|
export declare const extractInlineIcon: (jsonLd: JsonLd.Data.BaseData) => import("react").ReactNode;
|
|
6
6
|
export declare const extractInlineProps: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers | undefined) => InlineCardResolvedViewProps;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { JsonLd } from 'json-ld-types';
|
|
|
2
2
|
export declare type ResolveResponse = JsonLd.Response;
|
|
3
3
|
export { SmartCardProvider as Provider, SmartCardContext } from './state';
|
|
4
4
|
export type { ProviderProps, CardType } from './state';
|
|
5
|
-
export { EditorCardProvider, editorCardProvider } from '
|
|
6
|
-
export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, } from '
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
5
|
+
export { EditorCardProvider, editorCardProvider, } from '@atlaskit/link-provider';
|
|
6
|
+
export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, } from '@atlaskit/linking-common';
|
|
7
|
+
export { APIError } from '@atlaskit/linking-common';
|
|
8
|
+
export { CardClient as Client } from '@atlaskit/link-provider';
|
|
9
9
|
export { Card } from './view/Card';
|
|
10
10
|
export type { CardProps, CardAppearance, CardPlatform } from './view/Card';
|
|
11
|
-
export {
|
|
12
|
-
export type { CardContext } from '
|
|
11
|
+
export { SmartCardContext as Context } from '@atlaskit/link-provider';
|
|
12
|
+
export type { CardContext } from '@atlaskit/link-provider';
|
|
13
13
|
export { EmbedResizeMessageListener } from './view/EmbedCard/EmbedResizeMessageListener';
|
|
14
14
|
export { embedHeaderHeight } from './view/EmbedCard/components/styled';
|
|
15
15
|
export { SmartLinkEvents } from './utils/analytics/analytics';
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InvokePayload, ServerActionOpts } from '@atlaskit/linking-common';
|
|
2
2
|
import { CardInnerAppearance } from '../view/Card/types';
|
|
3
3
|
export declare type InvokeType = 'server' | 'client';
|
|
4
|
-
export interface InvokePayload<T> {
|
|
5
|
-
key: string;
|
|
6
|
-
context?: string;
|
|
7
|
-
action: T;
|
|
8
|
-
}
|
|
9
4
|
export declare type InvokeOpts<T> = {
|
|
10
5
|
type: InvokeType;
|
|
11
6
|
source?: CardInnerAppearance;
|
|
@@ -16,14 +11,6 @@ export declare type InvokeClientOpts = InvokeOpts<ClientActionOpts> & {
|
|
|
16
11
|
export declare type InvokeServerOpts = InvokeOpts<ServerActionOpts> & {
|
|
17
12
|
type: 'server';
|
|
18
13
|
};
|
|
19
|
-
export interface ServerActionOpts {
|
|
20
|
-
type: string;
|
|
21
|
-
payload: ServerActionPayload;
|
|
22
|
-
}
|
|
23
|
-
export interface ServerActionPayload {
|
|
24
|
-
id: string;
|
|
25
|
-
context?: JsonLd.Primitives.Object | JsonLd.Primitives.Link;
|
|
26
|
-
}
|
|
27
14
|
export interface ClientActionOpts {
|
|
28
15
|
type: string;
|
|
29
16
|
promise: () => Promise<void>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export declare const ACTION_PENDING = "pending";
|
|
2
|
-
export declare const ACTION_RESOLVING = "resolving";
|
|
3
|
-
export declare const ACTION_RESOLVED = "resolved";
|
|
4
|
-
export declare const ACTION_ERROR = "errored";
|
|
5
|
-
export declare const ACTION_ERROR_FALLBACK = "fallback";
|
|
6
|
-
export declare const ACTION_PRELOAD = "preload";
|
|
7
1
|
export declare const ANALYTICS_RESOLVING = "resolving";
|
|
8
2
|
export declare const ANALYTICS_ERROR = "errored";
|
|
9
3
|
export declare const ANALYTICS_FALLBACK = "fallback";
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { APIError } from '../../client/errors';
|
|
4
|
-
export declare type CardActionType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback';
|
|
5
|
-
export interface CardAction<T = JsonLd.Response> extends AnyAction {
|
|
6
|
-
type: CardActionType;
|
|
7
|
-
url: string;
|
|
8
|
-
payload?: T;
|
|
9
|
-
}
|
|
10
|
-
export declare type CardActionParams = {
|
|
11
|
-
url: string;
|
|
12
|
-
};
|
|
13
|
-
export declare type CardBaseActionCreator<T = JsonLd.Response> = (type: CardActionType, params: CardActionParams, payload?: T, error?: APIError) => CardAction<T>;
|
|
1
|
+
import { CardActionType } from '@atlaskit/linking-common';
|
|
2
|
+
export type { CardActionType };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { CardType, APIError } from '@atlaskit/linking-common';
|
|
1
2
|
import { AnalyticsHandler } from '../../utils/types';
|
|
2
3
|
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
4
|
import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
|
|
4
|
-
import { CardType } from '../store/types';
|
|
5
|
-
import { APIError } from '../../client/errors';
|
|
6
5
|
import { InvokeType } from '../../model/invoke-opts';
|
|
7
6
|
export declare const useSmartLinkAnalytics: (dispatchAnalytics: AnalyticsHandler) => {
|
|
8
7
|
ui: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CardContext } from '
|
|
1
|
+
import { CardContext } from '@atlaskit/link-provider';
|
|
2
2
|
export declare const useSmartLinkConfig: () => CardContext['config'] | undefined;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
-
import { CardType, CardStore } from '
|
|
3
|
-
import { Store } from 'redux';
|
|
2
|
+
import { CardType, CardStore } from '@atlaskit/linking-common';
|
|
4
3
|
export declare const getByDefinitionId: (definitionId: string | undefined, store: CardStore) => string[];
|
|
5
|
-
export declare const getUrl: (store: Store<CardStore>, url: string) => import("./store/types").CardState;
|
|
6
4
|
export declare const getClickUrl: (url: string, jsonLd?: JsonLd.Response<JsonLd.Data.BaseData> | undefined) => string;
|
|
7
5
|
export declare const getDefinitionId: (details?: JsonLd.Response<JsonLd.Data.BaseData> | undefined) => any;
|
|
8
6
|
export declare const getExtensionKey: (details?: JsonLd.Response<JsonLd.Data.BaseData> | undefined) => any;
|