@atlaskit/smart-card 44.9.9 → 44.9.11
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 +18 -0
- package/analytics.spec.yaml +0 -8
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-all-card-examples-in-text--default--jfp-magma-platform-lozenge-jump-fix-false.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-all-card-examples-in-text--default--jfp-magma-platform-lozenge-jump-fix-true.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-default-state--default.png +0 -0
- package/dist/cjs/state/hooks/use-intersection-observer/index.js +2 -1
- package/dist/cjs/state/hooks/use-smart-link-seen-event/index.js +66 -0
- package/dist/cjs/state/hooks/use-social-proof-experiment/index.js +3 -41
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +31 -8
- package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +9 -18
- package/dist/cjs/view/CardWithUrl/card-intersection-observer/index.js +25 -20
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +24 -4
- package/dist/cjs/view/CardWithUrl/component.js +4 -47
- package/dist/cjs/view/InlineCard/Frame/index.js +3 -2
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +0 -41
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-all-card-examples-in-text--default--jfp-magma-platform-lozenge-jump-fix-false.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-all-card-examples-in-text--default--jfp-magma-platform-lozenge-jump-fix-true.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-default-state--default.png +0 -0
- package/dist/es2019/state/hooks/use-intersection-observer/index.js +2 -1
- package/dist/es2019/state/hooks/use-smart-link-seen-event/index.js +60 -0
- package/dist/es2019/state/hooks/use-social-proof-experiment/index.js +2 -38
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +28 -6
- package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +9 -18
- package/dist/es2019/view/CardWithUrl/card-intersection-observer/index.js +28 -11
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +25 -4
- package/dist/es2019/view/CardWithUrl/component.js +3 -48
- package/dist/es2019/view/InlineCard/Frame/index.js +3 -2
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +1 -40
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-all-card-examples-in-text--default--jfp-magma-platform-lozenge-jump-fix-false.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-all-card-examples-in-text--default--jfp-magma-platform-lozenge-jump-fix-true.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-default-state--default.png +0 -0
- package/dist/esm/state/hooks/use-intersection-observer/index.js +2 -1
- package/dist/esm/state/hooks/use-smart-link-seen-event/index.js +60 -0
- package/dist/esm/state/hooks/use-social-proof-experiment/index.js +2 -40
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +31 -8
- package/dist/esm/view/BlockCard/views/UnauthorisedView.js +9 -18
- package/dist/esm/view/CardWithUrl/card-intersection-observer/index.js +26 -21
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +24 -4
- package/dist/esm/view/CardWithUrl/component.js +5 -48
- package/dist/esm/view/InlineCard/Frame/index.js +3 -2
- package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +1 -42
- package/dist/types/common/analytics/generated/analytics.types.d.ts +0 -1
- package/dist/types/state/hooks/use-smart-link-seen-event/index.d.ts +14 -0
- package/dist/types/state/hooks/use-social-proof-experiment/index.d.ts +0 -22
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +10 -0
- package/dist/types/view/CardWithUrl/card-intersection-observer/index.d.ts +3 -5
- package/dist/types/view/CardWithUrl/types.d.ts +0 -1
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +0 -1
- package/dist/types-ts4.5/state/hooks/use-smart-link-seen-event/index.d.ts +14 -0
- package/dist/types-ts4.5/state/hooks/use-social-proof-experiment/index.d.ts +0 -22
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +10 -0
- package/dist/types-ts4.5/view/CardWithUrl/card-intersection-observer/index.d.ts +3 -5
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +0 -1
- package/package.json +8 -5
- package/dist/cjs/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-default-state-without-connect-button-functionality--default.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-resolved-state-with-feature-flag-enabled-should-show-no-connect-button---default--platform-editor-resolve-hyperlinks-killswitch-false.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-resolved-state-with-feature-flag-enabled-should-show-no-connect-button---default--platform-editor-resolve-hyperlinks-killswitch-true.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-unauthorized-state-with-connect-button-direct-render---always-visible---default.png +0 -0
- package/dist/cjs/view/CardWithUrl/experiment-meta-event-attributes/index.js +0 -39
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/unauthorize-view.js +0 -30
- package/dist/es2019/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-default-state-without-connect-button-functionality--default.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-resolved-state-with-feature-flag-enabled-should-show-no-connect-button---default--platform-editor-resolve-hyperlinks-killswitch-false.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-resolved-state-with-feature-flag-enabled-should-show-no-connect-button---default--platform-editor-resolve-hyperlinks-killswitch-true.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-unauthorized-state-with-connect-button-direct-render---always-visible---default.png +0 -0
- package/dist/es2019/view/CardWithUrl/experiment-meta-event-attributes/index.js +0 -40
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/unauthorize-view.js +0 -22
- package/dist/esm/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-default-state-without-connect-button-functionality--default.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-resolved-state-with-feature-flag-enabled-should-show-no-connect-button---default--platform-editor-resolve-hyperlinks-killswitch-false.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-resolved-state-with-feature-flag-enabled-should-show-no-connect-button---default--platform-editor-resolve-hyperlinks-killswitch-true.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/link-url-connect-button/linkurl-unauthorized-state-with-connect-button-direct-render---always-visible---default.png +0 -0
- package/dist/esm/view/CardWithUrl/experiment-meta-event-attributes/index.js +0 -32
- package/dist/esm/view/LinkUrl/HyperlinkResolver/unauthorize-view.js +0 -23
- package/dist/types/view/CardWithUrl/experiment-meta-event-attributes/index.d.ts +0 -9
- package/dist/types/view/LinkUrl/HyperlinkResolver/unauthorize-view.d.ts +0 -10
- package/dist/types-ts4.5/view/CardWithUrl/experiment-meta-event-attributes/index.d.ts +0 -9
- package/dist/types-ts4.5/view/LinkUrl/HyperlinkResolver/unauthorize-view.d.ts +0 -10
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CardProps } from '../../Card';
|
|
3
|
-
type WithCardIntersectionObserverProps =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const _default: <T extends WithCardIntersectionObserverProps>(Component: React.ComponentType<T>) => ((props: T) => React.JSX.Element);
|
|
7
|
-
export default _default;
|
|
3
|
+
type WithCardIntersectionObserverProps = Pick<CardProps, 'appearance' | 'children' | 'onError' | 'id' | 'ui' | 'url'>;
|
|
4
|
+
declare const withCardIntersectionObserver: <T extends WithCardIntersectionObserverProps>(Component: React.ComponentType<T>) => ((props: T) => React.JSX.Element);
|
|
5
|
+
export default withCardIntersectionObserver;
|
|
@@ -24,7 +24,6 @@ export type CardWithUrlContentProps = {
|
|
|
24
24
|
inheritDimensions?: boolean;
|
|
25
25
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
26
26
|
isHovered?: boolean;
|
|
27
|
-
isIntersected?: boolean;
|
|
28
27
|
isSelected?: boolean;
|
|
29
28
|
onClick?: EventHandler<MouseEvent | KeyboardEvent>;
|
|
30
29
|
onError?: OnErrorCallback;
|
|
@@ -261,7 +261,6 @@ export type ButtonClickedEmbedPreviewResizeAttributesType = {
|
|
|
261
261
|
export type SmartLinkRenderSuccessAttributesType = {
|
|
262
262
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
263
263
|
rovoActionsCtaShown?: boolean | null;
|
|
264
|
-
experimentMeta?: Record<string, unknown> | null;
|
|
265
264
|
};
|
|
266
265
|
export type SmartLinkRenderFailedAttributesType = {
|
|
267
266
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CardType } from '@atlaskit/linking-common';
|
|
2
|
+
import type { CardProps } from '../../../view/Card';
|
|
3
|
+
type UseSmartLinkSeenEventProps = Pick<CardProps, 'appearance' | 'children' | 'id' | 'ui' | 'url'>;
|
|
4
|
+
type UseSmartLinkSeenEventReturn = {
|
|
5
|
+
onIntersecting: () => void;
|
|
6
|
+
onStatusSettled: (status: CardType) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Fires `ui.smartLink.seen` once when a smart link with status `unauthorized`
|
|
10
|
+
* enters the viewport. Uses refs internally so it never causes re-renders,
|
|
11
|
+
* which is important for SSR.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useSmartLinkSeenEvent({ appearance, children, id, ui, url, }: UseSmartLinkSeenEventProps): UseSmartLinkSeenEventReturn;
|
|
14
|
+
export {};
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
export type SocialProofTier = 'low' | 'not-low';
|
|
2
|
-
export declare const SOCIAL_PROOF_3P_UNAUTH_BLOCK_EXPERIMENT_KEY = "social_proof_3p_unauth_block_exp";
|
|
3
|
-
export declare const INLINE_SOCIAL_PROOF_EXPERIMENT_KEY = "platform_sl_3p_preauth_social_proof_inline_cta";
|
|
4
|
-
type SocialProofExperimentMetadata = {
|
|
5
|
-
isEligible: boolean;
|
|
6
|
-
tier?: SocialProofTier;
|
|
7
|
-
};
|
|
8
|
-
export type BlockCardSocialProofExperimentMeta = {
|
|
9
|
-
[SOCIAL_PROOF_3P_UNAUTH_BLOCK_EXPERIMENT_KEY]: SocialProofExperimentMetadata;
|
|
10
|
-
};
|
|
11
|
-
export type InlineSocialProofExperimentMeta = {
|
|
12
|
-
[INLINE_SOCIAL_PROOF_EXPERIMENT_KEY]: SocialProofExperimentMetadata;
|
|
13
|
-
};
|
|
14
2
|
export interface SocialProofExperiment {
|
|
15
3
|
/**
|
|
16
4
|
* The raw connected users percentage for the current provider, or undefined if not loaded/available.
|
|
@@ -32,16 +20,6 @@ export interface SocialProofExperiment {
|
|
|
32
20
|
*/
|
|
33
21
|
tier: SocialProofTier;
|
|
34
22
|
}
|
|
35
|
-
export declare const SOCIAL_PROOF_TIER_THRESHOLD = 30;
|
|
36
|
-
export declare const getSocialProofTier: (connectedPct?: number) => SocialProofTier | undefined;
|
|
37
|
-
export declare const getSocialProofExperimentMeta: (params: {
|
|
38
|
-
baseUriWithNoTrailingSlash?: string;
|
|
39
|
-
extensionKey?: string;
|
|
40
|
-
}) => BlockCardSocialProofExperimentMeta;
|
|
41
|
-
export declare const getInlineSocialProofExperimentMeta: (params: {
|
|
42
|
-
baseUriWithNoTrailingSlash?: string;
|
|
43
|
-
extensionKey?: string;
|
|
44
|
-
}) => InlineSocialProofExperimentMeta;
|
|
45
23
|
/**
|
|
46
24
|
* Returns enrollment and treatment state for the social proof unauth block card experiment.
|
|
47
25
|
*
|
|
@@ -15,9 +15,19 @@ type SmartLinkAnalyticsContextType = {
|
|
|
15
15
|
};
|
|
16
16
|
source?: string;
|
|
17
17
|
};
|
|
18
|
+
type GetByUrlFn = (url: string, props: Omit<SmartLinkAnalyticsContextProps, 'children' | 'url'>) => SmartLinkAnalyticsContextType;
|
|
19
|
+
type UseSmartLinkAnalyticsUtilsReturn = {
|
|
20
|
+
getByUrl: GetByUrlFn;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Provides an analytics context data to supply attributes to events based on a URL
|
|
24
|
+
* and the link state in the store
|
|
25
|
+
*/
|
|
26
|
+
export declare const useSmartLinkAnalyticsUtils: () => UseSmartLinkAnalyticsUtilsReturn;
|
|
18
27
|
/**
|
|
19
28
|
* Provides an analytics context data to supply attributes to events based on a URL
|
|
20
29
|
* and the link state in the store
|
|
30
|
+
* @deprecated Use useSmartLinkAnalyticsUtils instead
|
|
21
31
|
*/
|
|
22
32
|
export declare const useSmartLinkAnalyticsContext: ({ display, id, source, url, }: Exclude<SmartLinkAnalyticsContextProps, "children">) => SmartLinkAnalyticsContextType | undefined;
|
|
23
33
|
/**
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CardProps } from '../../Card';
|
|
3
|
-
type WithCardIntersectionObserverProps =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare const _default: <T extends WithCardIntersectionObserverProps>(Component: React.ComponentType<T>) => ((props: T) => React.JSX.Element);
|
|
7
|
-
export default _default;
|
|
3
|
+
type WithCardIntersectionObserverProps = Pick<CardProps, 'appearance' | 'children' | 'onError' | 'id' | 'ui' | 'url'>;
|
|
4
|
+
declare const withCardIntersectionObserver: <T extends WithCardIntersectionObserverProps>(Component: React.ComponentType<T>) => ((props: T) => React.JSX.Element);
|
|
5
|
+
export default withCardIntersectionObserver;
|
|
@@ -24,7 +24,6 @@ export type CardWithUrlContentProps = {
|
|
|
24
24
|
inheritDimensions?: boolean;
|
|
25
25
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
26
26
|
isHovered?: boolean;
|
|
27
|
-
isIntersected?: boolean;
|
|
28
27
|
isSelected?: boolean;
|
|
29
28
|
onClick?: EventHandler<MouseEvent | KeyboardEvent>;
|
|
30
29
|
onError?: OnErrorCallback;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "44.9.
|
|
3
|
+
"version": "44.9.11",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
52
52
|
"@atlaskit/flag": "^17.11.0",
|
|
53
53
|
"@atlaskit/form": "^15.5.0",
|
|
54
|
-
"@atlaskit/frontend-utilities": "^3.
|
|
54
|
+
"@atlaskit/frontend-utilities": "^3.3.0",
|
|
55
55
|
"@atlaskit/heading": "^5.4.0",
|
|
56
56
|
"@atlaskit/icon": "^34.5.0",
|
|
57
57
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/object": "^1.0.0",
|
|
74
74
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
75
75
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
76
|
-
"@atlaskit/platform-feature-flags-react": "^0.
|
|
76
|
+
"@atlaskit/platform-feature-flags-react": "^0.5.0",
|
|
77
77
|
"@atlaskit/popup": "^4.19.0",
|
|
78
78
|
"@atlaskit/primitives": "^19.0.0",
|
|
79
79
|
"@atlaskit/react-ufo": "^5.20.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@atlaskit/tmp-editor-statsig": "^80.0.0",
|
|
90
90
|
"@atlaskit/tokens": "^13.0.0",
|
|
91
91
|
"@atlaskit/tooltip": "^22.2.0",
|
|
92
|
-
"@atlaskit/ufo": "^0.
|
|
92
|
+
"@atlaskit/ufo": "^0.5.0",
|
|
93
93
|
"@atlaskit/width-detector": "^5.1.0",
|
|
94
94
|
"@babel/runtime": "^7.0.0",
|
|
95
95
|
"@compiled/react": "^0.20.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@af/integration-testing": "workspace:^",
|
|
116
116
|
"@af/visual-regression": "workspace:^",
|
|
117
|
-
"@atlaskit/analytics-listeners": "^10.
|
|
117
|
+
"@atlaskit/analytics-listeners": "^10.1.0",
|
|
118
118
|
"@atlaskit/css-reset": "^7.4.0",
|
|
119
119
|
"@atlaskit/media-test-helpers": "^41.0.0",
|
|
120
120
|
"@atlaskit/ssr": "workspace:^",
|
|
@@ -278,6 +278,9 @@
|
|
|
278
278
|
},
|
|
279
279
|
"platform_navx_block_card_footer_spacing": {
|
|
280
280
|
"type": "boolean"
|
|
281
|
+
},
|
|
282
|
+
"navx-3611-inline-card-a11y-role-fix": {
|
|
283
|
+
"type": "boolean"
|
|
281
284
|
}
|
|
282
285
|
},
|
|
283
286
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|
|
Binary file
|
|
Binary file
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
-
var _state = require("../../../state");
|
|
11
|
-
var _helpers = require("../../../state/helpers");
|
|
12
|
-
var _useSocialProofExperiment = require("../../../state/hooks/use-social-proof-experiment");
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
var useExperimentMetaEventAttributes = function useExperimentMetaEventAttributes(_ref) {
|
|
16
|
-
var appearance = _ref.appearance,
|
|
17
|
-
state = _ref.state;
|
|
18
|
-
var _useSmartLinkContext = (0, _state.useSmartLinkContext)(),
|
|
19
|
-
baseUriWithNoTrailingSlash = _useSmartLinkContext.connections.client.baseUrlOverride;
|
|
20
|
-
var details = state.details,
|
|
21
|
-
status = state.status;
|
|
22
|
-
var extensionKey = (0, _helpers.getExtensionKey)(details);
|
|
23
|
-
if (!(0, _platformFeatureFlags.fg)('social-proof-3p-unauth-block-fg') && !(0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_soc_proof_inline_killswitch')) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
var blockSocialProofExperimentMeta = appearance === 'block' && status === 'unauthorized' && (0, _platformFeatureFlags.fg)('social-proof-3p-unauth-block-fg') ? (0, _useSocialProofExperiment.getSocialProofExperimentMeta)({
|
|
27
|
-
extensionKey: extensionKey,
|
|
28
|
-
baseUriWithNoTrailingSlash: baseUriWithNoTrailingSlash
|
|
29
|
-
}) : undefined;
|
|
30
|
-
var inlineSocialProofExperimentMeta = appearance === 'inline' && status === 'unauthorized' && (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_soc_proof_inline_killswitch') ? (0, _useSocialProofExperiment.getInlineSocialProofExperimentMeta)({
|
|
31
|
-
extensionKey: extensionKey,
|
|
32
|
-
baseUriWithNoTrailingSlash: baseUriWithNoTrailingSlash
|
|
33
|
-
}) : undefined;
|
|
34
|
-
var experimentMeta = _objectSpread(_objectSpread({}, blockSocialProofExperimentMeta), inlineSocialProofExperimentMeta);
|
|
35
|
-
if (Object.keys(experimentMeta).length > 0) {
|
|
36
|
-
return experimentMeta;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var _default = exports.default = useExperimentMetaEventAttributes;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _reactIntl = require("react-intl");
|
|
12
|
-
var _messages = require("../../../messages");
|
|
13
|
-
var _actionButton = require("../../InlineCard/common/action-button");
|
|
14
|
-
var _Hyperlink = _interopRequireDefault(require("../Hyperlink"));
|
|
15
|
-
var _excluded = ["onAuthorize", "provider", "showConnectBtn"];
|
|
16
|
-
var HyperlinkUnauthorizedView = function HyperlinkUnauthorizedView(_ref) {
|
|
17
|
-
var onAuthorize = _ref.onAuthorize,
|
|
18
|
-
provider = _ref.provider,
|
|
19
|
-
showConnectBtn = _ref.showConnectBtn,
|
|
20
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Hyperlink.default, props), showConnectBtn && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ' ', /*#__PURE__*/_react.default.createElement(_actionButton.ActionButton, {
|
|
22
|
-
onClick: onAuthorize,
|
|
23
|
-
testId: "button-connect-account"
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_link_account_card_name, {
|
|
25
|
-
values: {
|
|
26
|
-
context: provider === null || provider === void 0 ? void 0 : provider.text
|
|
27
|
-
}
|
|
28
|
-
})))));
|
|
29
|
-
};
|
|
30
|
-
var _default = exports.default = HyperlinkUnauthorizedView;
|
|
Binary file
|
|
Binary file
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { fg } from "@atlaskit/platform-feature-flags";
|
|
2
|
-
import { useSmartLinkContext } from "../../../state";
|
|
3
|
-
import { getExtensionKey } from "../../../state/helpers";
|
|
4
|
-
import { getSocialProofExperimentMeta, getInlineSocialProofExperimentMeta } from "../../../state/hooks/use-social-proof-experiment";
|
|
5
|
-
const useExperimentMetaEventAttributes = ({
|
|
6
|
-
appearance,
|
|
7
|
-
state
|
|
8
|
-
}) => {
|
|
9
|
-
const {
|
|
10
|
-
connections: {
|
|
11
|
-
client: {
|
|
12
|
-
baseUrlOverride: baseUriWithNoTrailingSlash
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
} = useSmartLinkContext();
|
|
16
|
-
const {
|
|
17
|
-
details,
|
|
18
|
-
status
|
|
19
|
-
} = state;
|
|
20
|
-
const extensionKey = getExtensionKey(details);
|
|
21
|
-
if (!fg('social-proof-3p-unauth-block-fg') && !fg('platform_sl_3p_preauth_soc_proof_inline_killswitch')) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const blockSocialProofExperimentMeta = appearance === 'block' && status === 'unauthorized' && fg('social-proof-3p-unauth-block-fg') ? getSocialProofExperimentMeta({
|
|
25
|
-
extensionKey,
|
|
26
|
-
baseUriWithNoTrailingSlash
|
|
27
|
-
}) : undefined;
|
|
28
|
-
const inlineSocialProofExperimentMeta = appearance === 'inline' && status === 'unauthorized' && fg('platform_sl_3p_preauth_soc_proof_inline_killswitch') ? getInlineSocialProofExperimentMeta({
|
|
29
|
-
extensionKey,
|
|
30
|
-
baseUriWithNoTrailingSlash
|
|
31
|
-
}) : undefined;
|
|
32
|
-
const experimentMeta = {
|
|
33
|
-
...blockSocialProofExperimentMeta,
|
|
34
|
-
...inlineSocialProofExperimentMeta
|
|
35
|
-
};
|
|
36
|
-
if (Object.keys(experimentMeta).length > 0) {
|
|
37
|
-
return experimentMeta;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
export default useExperimentMetaEventAttributes;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { FormattedMessage } from 'react-intl';
|
|
4
|
-
import { messages } from '../../../messages';
|
|
5
|
-
import { ActionButton } from '../../InlineCard/common/action-button';
|
|
6
|
-
import Hyperlink from '../Hyperlink';
|
|
7
|
-
const HyperlinkUnauthorizedView = ({
|
|
8
|
-
onAuthorize,
|
|
9
|
-
provider,
|
|
10
|
-
showConnectBtn,
|
|
11
|
-
...props
|
|
12
|
-
}) => {
|
|
13
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Hyperlink, props), showConnectBtn && /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(ActionButton, {
|
|
14
|
-
onClick: onAuthorize,
|
|
15
|
-
testId: "button-connect-account"
|
|
16
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
17
|
-
values: {
|
|
18
|
-
context: provider === null || provider === void 0 ? void 0 : provider.text
|
|
19
|
-
}
|
|
20
|
-
})))));
|
|
21
|
-
};
|
|
22
|
-
export default HyperlinkUnauthorizedView;
|
|
Binary file
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { fg } from "@atlaskit/platform-feature-flags";
|
|
5
|
-
import { useSmartLinkContext } from "../../../state";
|
|
6
|
-
import { getExtensionKey } from "../../../state/helpers";
|
|
7
|
-
import { getSocialProofExperimentMeta, getInlineSocialProofExperimentMeta } from "../../../state/hooks/use-social-proof-experiment";
|
|
8
|
-
var useExperimentMetaEventAttributes = function useExperimentMetaEventAttributes(_ref) {
|
|
9
|
-
var appearance = _ref.appearance,
|
|
10
|
-
state = _ref.state;
|
|
11
|
-
var _useSmartLinkContext = useSmartLinkContext(),
|
|
12
|
-
baseUriWithNoTrailingSlash = _useSmartLinkContext.connections.client.baseUrlOverride;
|
|
13
|
-
var details = state.details,
|
|
14
|
-
status = state.status;
|
|
15
|
-
var extensionKey = getExtensionKey(details);
|
|
16
|
-
if (!fg('social-proof-3p-unauth-block-fg') && !fg('platform_sl_3p_preauth_soc_proof_inline_killswitch')) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
var blockSocialProofExperimentMeta = appearance === 'block' && status === 'unauthorized' && fg('social-proof-3p-unauth-block-fg') ? getSocialProofExperimentMeta({
|
|
20
|
-
extensionKey: extensionKey,
|
|
21
|
-
baseUriWithNoTrailingSlash: baseUriWithNoTrailingSlash
|
|
22
|
-
}) : undefined;
|
|
23
|
-
var inlineSocialProofExperimentMeta = appearance === 'inline' && status === 'unauthorized' && fg('platform_sl_3p_preauth_soc_proof_inline_killswitch') ? getInlineSocialProofExperimentMeta({
|
|
24
|
-
extensionKey: extensionKey,
|
|
25
|
-
baseUriWithNoTrailingSlash: baseUriWithNoTrailingSlash
|
|
26
|
-
}) : undefined;
|
|
27
|
-
var experimentMeta = _objectSpread(_objectSpread({}, blockSocialProofExperimentMeta), inlineSocialProofExperimentMeta);
|
|
28
|
-
if (Object.keys(experimentMeta).length > 0) {
|
|
29
|
-
return experimentMeta;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export default useExperimentMetaEventAttributes;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["onAuthorize", "provider", "showConnectBtn"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { FormattedMessage } from 'react-intl';
|
|
6
|
-
import { messages } from '../../../messages';
|
|
7
|
-
import { ActionButton } from '../../InlineCard/common/action-button';
|
|
8
|
-
import Hyperlink from '../Hyperlink';
|
|
9
|
-
var HyperlinkUnauthorizedView = function HyperlinkUnauthorizedView(_ref) {
|
|
10
|
-
var onAuthorize = _ref.onAuthorize,
|
|
11
|
-
provider = _ref.provider,
|
|
12
|
-
showConnectBtn = _ref.showConnectBtn,
|
|
13
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Hyperlink, props), showConnectBtn && /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(ActionButton, {
|
|
15
|
-
onClick: onAuthorize,
|
|
16
|
-
testId: "button-connect-account"
|
|
17
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
18
|
-
values: {
|
|
19
|
-
context: provider === null || provider === void 0 ? void 0 : provider.text
|
|
20
|
-
}
|
|
21
|
-
})))));
|
|
22
|
-
};
|
|
23
|
-
export default HyperlinkUnauthorizedView;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CardAppearance, CardState } from "@atlaskit/linking-common";
|
|
2
|
-
import { type BlockCardSocialProofExperimentMeta, type InlineSocialProofExperimentMeta } from "../../../state/hooks/use-social-proof-experiment";
|
|
3
|
-
type ExperimentMetaEventAttributes = Partial<BlockCardSocialProofExperimentMeta & InlineSocialProofExperimentMeta>;
|
|
4
|
-
type ExperimentMetaEventAttributesParams = {
|
|
5
|
-
appearance: CardAppearance;
|
|
6
|
-
state: CardState;
|
|
7
|
-
};
|
|
8
|
-
declare const useExperimentMetaEventAttributes: ({ appearance, state, }: ExperimentMetaEventAttributesParams) => ExperimentMetaEventAttributes | undefined;
|
|
9
|
-
export default useExperimentMetaEventAttributes;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { LinkProvider } from '@atlaskit/link-extractors';
|
|
3
|
-
import type { LinkUrlProps } from '../types';
|
|
4
|
-
type HyperlinkUnauthorizedViewProps = LinkUrlProps & {
|
|
5
|
-
onAuthorize?: () => void;
|
|
6
|
-
provider?: LinkProvider;
|
|
7
|
-
showConnectBtn?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const HyperlinkUnauthorizedView: ({ onAuthorize, provider, showConnectBtn, ...props }: HyperlinkUnauthorizedViewProps) => React.JSX.Element;
|
|
10
|
-
export default HyperlinkUnauthorizedView;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CardAppearance, CardState } from "@atlaskit/linking-common";
|
|
2
|
-
import { type BlockCardSocialProofExperimentMeta, type InlineSocialProofExperimentMeta } from "../../../state/hooks/use-social-proof-experiment";
|
|
3
|
-
type ExperimentMetaEventAttributes = Partial<BlockCardSocialProofExperimentMeta & InlineSocialProofExperimentMeta>;
|
|
4
|
-
type ExperimentMetaEventAttributesParams = {
|
|
5
|
-
appearance: CardAppearance;
|
|
6
|
-
state: CardState;
|
|
7
|
-
};
|
|
8
|
-
declare const useExperimentMetaEventAttributes: ({ appearance, state, }: ExperimentMetaEventAttributesParams) => ExperimentMetaEventAttributes | undefined;
|
|
9
|
-
export default useExperimentMetaEventAttributes;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { LinkProvider } from '@atlaskit/link-extractors';
|
|
3
|
-
import type { LinkUrlProps } from '../types';
|
|
4
|
-
type HyperlinkUnauthorizedViewProps = LinkUrlProps & {
|
|
5
|
-
onAuthorize?: () => void;
|
|
6
|
-
provider?: LinkProvider;
|
|
7
|
-
showConnectBtn?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const HyperlinkUnauthorizedView: ({ onAuthorize, provider, showConnectBtn, ...props }: HyperlinkUnauthorizedViewProps) => React.JSX.Element;
|
|
10
|
-
export default HyperlinkUnauthorizedView;
|