@atlaskit/smart-card 46.19.6 → 46.19.8
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 +17 -0
- package/dist/cjs/state/actions/index.js +1 -2
- package/dist/cjs/state/hooks/use-hydration-safe-content/index.js +6 -7
- package/dist/cjs/state/hooks/use-social-proof/index.js +2 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/actions/index.js +1 -2
- package/dist/es2019/state/hooks/use-hydration-safe-content/index.js +6 -7
- package/dist/es2019/state/hooks/use-social-proof/index.js +2 -3
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/actions/index.js +1 -2
- package/dist/esm/state/hooks/use-hydration-safe-content/index.js +7 -8
- package/dist/esm/state/hooks/use-social-proof/index.js +2 -3
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-hydration-safe-content/index.d.ts +1 -1
- package/dist/types/state/hooks/use-social-proof/index.d.ts +2 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 46.19.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`759822ed19ecb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/759822ed19ecb) -
|
|
8
|
+
Remove the fully rolled out `platform_sl_3p_post_auth_chat_open_fg` gate and its package
|
|
9
|
+
registration, retaining automatic Rovo chat launch for eligible Smart Links.
|
|
10
|
+
|
|
11
|
+
## 46.19.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`24eb3c80a0aec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24eb3c80a0aec) -
|
|
16
|
+
Cleanup experiment `platform_sl_hydration_safe_content`. Smart Link dates and social proof use
|
|
17
|
+
hydration-safe content during SSR and hydration only when the Smart Card provider's product is
|
|
18
|
+
Confluence. Other products and standalone elements retain the control behavior.
|
|
19
|
+
|
|
3
20
|
## 46.19.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@ var _extractSmartLinkTitle = require("@atlaskit/link-extractors/extract-smart-li
|
|
|
14
14
|
var _useSmartLinkContext2 = require("@atlaskit/link-provider/use-smart-link-context");
|
|
15
15
|
var _actions = require("@atlaskit/linking-common/actions");
|
|
16
16
|
var _auth = require("@atlaskit/outbound-auth-flow-client/auth");
|
|
17
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
18
17
|
var _postMessageToPubsub = require("@atlaskit/rovo-triggers/post-message-to-pubsub");
|
|
19
18
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
20
19
|
var _constants = require("../../constants");
|
|
@@ -282,7 +281,7 @@ var useSmartCardActions = exports.useSmartCardActions = function useSmartCardAct
|
|
|
282
281
|
// Post-auth Chat onboarding: auto-open Rovo Chat mini-modal with the
|
|
283
282
|
// authed 3P link as context, for supported providers (e.g. Google Drive).
|
|
284
283
|
// Provider eligibility is derived from the pre-auth SmartLink state.
|
|
285
|
-
var isEligibleForPostAuthChat = status === 'unauthorized' && isSupportedPostAuthChatExtensionKey && (0,
|
|
284
|
+
var isEligibleForPostAuthChat = status === 'unauthorized' && isSupportedPostAuthChatExtensionKey && (0, _rovo.getIsRovoChatEnabled)(rovoOptionsRef.current);
|
|
286
285
|
if (status === 'unauthorized' && !isEligibleForPostAuthChat) {
|
|
287
286
|
var provider = (0, _extractSmartLinkProvider.extractSmartLinkProvider)(details);
|
|
288
287
|
flags.showConnectFlag({
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = useHydrationSafeContent;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _context = require("@atlaskit/link-provider/context");
|
|
9
9
|
var subscribe = function subscribe() {
|
|
10
10
|
return function () {};
|
|
11
11
|
};
|
|
@@ -13,13 +13,12 @@ var getClientSnapshot = function getClientSnapshot() {
|
|
|
13
13
|
return false;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
/** Use deterministic content
|
|
16
|
+
/** Use deterministic content during SSR/hydration in Confluence only. */
|
|
17
17
|
function useHydrationSafeContent() {
|
|
18
|
+
var _useContext;
|
|
18
19
|
var isEligible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function () {
|
|
23
|
-
return isEligible && (0, _isExperimentEnabled.isExperimentEnabled)('platform_sl_hydration_safe_content');
|
|
20
|
+
var product = (_useContext = (0, _react.useContext)(_context.SmartCardContext)) === null || _useContext === void 0 ? void 0 : _useContext.product;
|
|
21
|
+
return (0, _react.useSyncExternalStore)(subscribe, getClientSnapshot, function () {
|
|
22
|
+
return isEligible && product === 'CONFLUENCE';
|
|
24
23
|
});
|
|
25
24
|
}
|
|
@@ -32,9 +32,8 @@ var NOT_ENABLED_RESULT = {
|
|
|
32
32
|
* This means:
|
|
33
33
|
* - First page visit (cold): no social proof rendered, no experiment exposure fired.
|
|
34
34
|
* Background fetch populates localStorage for next time.
|
|
35
|
-
* - Second page visit (warm): social proof renders from localStorage
|
|
36
|
-
*
|
|
37
|
-
* Background refresh keeps localStorage fresh.
|
|
35
|
+
* - Second page visit (warm): social proof renders from localStorage after hydration in Confluence
|
|
36
|
+
* (immediately in other apps and on client-only mounts). Background refresh keeps localStorage fresh.
|
|
38
37
|
*
|
|
39
38
|
* Callers decide separately (e.g. via Statsig experiment) whether to surface the data.
|
|
40
39
|
*/
|
|
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
25
25
|
var context = exports.context = {
|
|
26
26
|
componentName: 'smart-cards',
|
|
27
27
|
packageName: "@atlaskit/smart-card" || '',
|
|
28
|
-
packageVersion: "46.19.
|
|
28
|
+
packageVersion: "46.19.7" || ''
|
|
29
29
|
};
|
|
30
30
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
31
31
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "46.19.
|
|
22
|
+
packageVersion: "46.19.7",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -4,7 +4,6 @@ import { extractSmartLinkTitle } from '@atlaskit/link-extractors/extract-smart-l
|
|
|
4
4
|
import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
|
|
5
5
|
import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common/actions';
|
|
6
6
|
import { auth } from '@atlaskit/outbound-auth-flow-client/auth';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
7
|
import { ROVO_POST_MESSAGE_EVENT_TYPE } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
9
8
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
10
9
|
import { SmartLinkStatus } from '../../constants';
|
|
@@ -266,7 +265,7 @@ export const useSmartCardActions = (id, url) => {
|
|
|
266
265
|
// Post-auth Chat onboarding: auto-open Rovo Chat mini-modal with the
|
|
267
266
|
// authed 3P link as context, for supported providers (e.g. Google Drive).
|
|
268
267
|
// Provider eligibility is derived from the pre-auth SmartLink state.
|
|
269
|
-
const isEligibleForPostAuthChat = status === 'unauthorized' && isSupportedPostAuthChatExtensionKey &&
|
|
268
|
+
const isEligibleForPostAuthChat = status === 'unauthorized' && isSupportedPostAuthChatExtensionKey && getIsRovoChatEnabled(rovoOptionsRef.current);
|
|
270
269
|
if (status === 'unauthorized' && !isEligibleForPostAuthChat) {
|
|
271
270
|
const provider = extractSmartLinkProvider(details);
|
|
272
271
|
flags.showConnectFlag({
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { useSyncExternalStore } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { useContext, useSyncExternalStore } from 'react';
|
|
2
|
+
import { SmartCardContext } from '@atlaskit/link-provider/context';
|
|
3
3
|
const subscribe = () => () => {};
|
|
4
4
|
const getClientSnapshot = () => false;
|
|
5
5
|
|
|
6
|
-
/** Use deterministic content
|
|
6
|
+
/** Use deterministic content during SSR/hydration in Confluence only. */
|
|
7
7
|
export default function useHydrationSafeContent(isEligible = true) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
() => isEligible && isExperimentEnabled('platform_sl_hydration_safe_content'));
|
|
8
|
+
var _useContext;
|
|
9
|
+
const product = (_useContext = useContext(SmartCardContext)) === null || _useContext === void 0 ? void 0 : _useContext.product;
|
|
10
|
+
return useSyncExternalStore(subscribe, getClientSnapshot, () => isEligible && product === 'CONFLUENCE');
|
|
12
11
|
}
|
|
@@ -24,9 +24,8 @@ const NOT_ENABLED_RESULT = {
|
|
|
24
24
|
* This means:
|
|
25
25
|
* - First page visit (cold): no social proof rendered, no experiment exposure fired.
|
|
26
26
|
* Background fetch populates localStorage for next time.
|
|
27
|
-
* - Second page visit (warm): social proof renders from localStorage
|
|
28
|
-
*
|
|
29
|
-
* Background refresh keeps localStorage fresh.
|
|
27
|
+
* - Second page visit (warm): social proof renders from localStorage after hydration in Confluence
|
|
28
|
+
* (immediately in other apps and on client-only mounts). Background refresh keeps localStorage fresh.
|
|
30
29
|
*
|
|
31
30
|
* Callers decide separately (e.g. via Statsig experiment) whether to surface the data.
|
|
32
31
|
*/
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "46.19.
|
|
7
|
+
packageVersion: "46.19.7" || ''
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "46.19.
|
|
12
|
+
packageVersion: "46.19.7",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -9,7 +9,6 @@ import { extractSmartLinkTitle } from '@atlaskit/link-extractors/extract-smart-l
|
|
|
9
9
|
import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
|
|
10
10
|
import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common/actions';
|
|
11
11
|
import { auth } from '@atlaskit/outbound-auth-flow-client/auth';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
13
12
|
import { ROVO_POST_MESSAGE_EVENT_TYPE } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
14
13
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
15
14
|
import { SmartLinkStatus } from '../../constants';
|
|
@@ -275,7 +274,7 @@ export var useSmartCardActions = function useSmartCardActions(id, url) {
|
|
|
275
274
|
// Post-auth Chat onboarding: auto-open Rovo Chat mini-modal with the
|
|
276
275
|
// authed 3P link as context, for supported providers (e.g. Google Drive).
|
|
277
276
|
// Provider eligibility is derived from the pre-auth SmartLink state.
|
|
278
|
-
var isEligibleForPostAuthChat = status === 'unauthorized' && isSupportedPostAuthChatExtensionKey &&
|
|
277
|
+
var isEligibleForPostAuthChat = status === 'unauthorized' && isSupportedPostAuthChatExtensionKey && getIsRovoChatEnabled(rovoOptionsRef.current);
|
|
279
278
|
if (status === 'unauthorized' && !isEligibleForPostAuthChat) {
|
|
280
279
|
var provider = extractSmartLinkProvider(details);
|
|
281
280
|
flags.showConnectFlag({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSyncExternalStore } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { useContext, useSyncExternalStore } from 'react';
|
|
2
|
+
import { SmartCardContext } from '@atlaskit/link-provider/context';
|
|
3
3
|
var subscribe = function subscribe() {
|
|
4
4
|
return function () {};
|
|
5
5
|
};
|
|
@@ -7,13 +7,12 @@ var getClientSnapshot = function getClientSnapshot() {
|
|
|
7
7
|
return false;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
/** Use deterministic content
|
|
10
|
+
/** Use deterministic content during SSR/hydration in Confluence only. */
|
|
11
11
|
export default function useHydrationSafeContent() {
|
|
12
|
+
var _useContext;
|
|
12
13
|
var isEligible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function () {
|
|
17
|
-
return isEligible && isExperimentEnabled('platform_sl_hydration_safe_content');
|
|
14
|
+
var product = (_useContext = useContext(SmartCardContext)) === null || _useContext === void 0 ? void 0 : _useContext.product;
|
|
15
|
+
return useSyncExternalStore(subscribe, getClientSnapshot, function () {
|
|
16
|
+
return isEligible && product === 'CONFLUENCE';
|
|
18
17
|
});
|
|
19
18
|
}
|
|
@@ -25,9 +25,8 @@ var NOT_ENABLED_RESULT = {
|
|
|
25
25
|
* This means:
|
|
26
26
|
* - First page visit (cold): no social proof rendered, no experiment exposure fired.
|
|
27
27
|
* Background fetch populates localStorage for next time.
|
|
28
|
-
* - Second page visit (warm): social proof renders from localStorage
|
|
29
|
-
*
|
|
30
|
-
* Background refresh keeps localStorage fresh.
|
|
28
|
+
* - Second page visit (warm): social proof renders from localStorage after hydration in Confluence
|
|
29
|
+
* (immediately in other apps and on client-only mounts). Background refresh keeps localStorage fresh.
|
|
31
30
|
*
|
|
32
31
|
* Callers decide separately (e.g. via Statsig experiment) whether to surface the data.
|
|
33
32
|
*/
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "46.19.
|
|
7
|
+
packageVersion: "46.19.7" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "46.19.
|
|
15
|
+
packageVersion: "46.19.7",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Use deterministic content
|
|
1
|
+
/** Use deterministic content during SSR/hydration in Confluence only. */
|
|
2
2
|
export default function useHydrationSafeContent(isEligible?: boolean): boolean;
|
|
@@ -17,9 +17,8 @@ export interface SocialProof {
|
|
|
17
17
|
* This means:
|
|
18
18
|
* - First page visit (cold): no social proof rendered, no experiment exposure fired.
|
|
19
19
|
* Background fetch populates localStorage for next time.
|
|
20
|
-
* - Second page visit (warm): social proof renders from localStorage
|
|
21
|
-
*
|
|
22
|
-
* Background refresh keeps localStorage fresh.
|
|
20
|
+
* - Second page visit (warm): social proof renders from localStorage after hydration in Confluence
|
|
21
|
+
* (immediately in other apps and on client-only mounts). Background refresh keeps localStorage fresh.
|
|
23
22
|
*
|
|
24
23
|
* Callers decide separately (e.g. via Statsig experiment) whether to surface the data.
|
|
25
24
|
*/
|