@atlaskit/smart-card 46.19.5 → 46.19.7

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 46.19.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`24eb3c80a0aec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24eb3c80a0aec) -
8
+ Cleanup experiment `platform_sl_hydration_safe_content`. Smart Link dates and social proof use
9
+ hydration-safe content during SSR and hydration only when the Smart Card provider's product is
10
+ Confluence. Other products and standalone elements retain the control behavior.
11
+
12
+ ## 46.19.6
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 46.19.5
4
19
 
5
20
  ### Patch Changes
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = useHydrationSafeContent;
7
7
  var _react = require("react");
8
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
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 only during SSR/hydration in the experiment treatment. */
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
- return (0, _react.useSyncExternalStore)(subscribe, getClientSnapshot,
20
- // React only reads this snapshot during SSR/hydration, so client-only mounts
21
- // never fire an exposure. Control matches the client snapshot and needs no update.
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, after hydration
36
- * when the platform_sl_hydration_safe_content experiment is enabled (immediately on client-only mounts).
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.4" || ''
28
+ packageVersion: "46.19.6" || ''
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.4",
22
+ packageVersion: "46.19.6",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,12 +1,11 @@
1
- import { useSyncExternalStore } from 'react';
2
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
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 only during SSR/hydration in the experiment treatment. */
6
+ /** Use deterministic content during SSR/hydration in Confluence only. */
7
7
  export default function useHydrationSafeContent(isEligible = true) {
8
- return useSyncExternalStore(subscribe, getClientSnapshot,
9
- // React only reads this snapshot during SSR/hydration, so client-only mounts
10
- // never fire an exposure. Control matches the client snapshot and needs no update.
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, after hydration
28
- * when the platform_sl_hydration_safe_content experiment is enabled (immediately on client-only mounts).
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.4" || ''
7
+ packageVersion: "46.19.6" || ''
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.4",
12
+ packageVersion: "46.19.6",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -1,5 +1,5 @@
1
- import { useSyncExternalStore } from 'react';
2
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
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 only during SSR/hydration in the experiment treatment. */
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
- return useSyncExternalStore(subscribe, getClientSnapshot,
14
- // React only reads this snapshot during SSR/hydration, so client-only mounts
15
- // never fire an exposure. Control matches the client snapshot and needs no update.
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, after hydration
29
- * when the platform_sl_hydration_safe_content experiment is enabled (immediately on client-only mounts).
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.4" || ''
7
+ packageVersion: "46.19.6" || ''
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.4",
15
+ packageVersion: "46.19.6",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,2 +1,2 @@
1
- /** Use deterministic content only during SSR/hydration in the experiment treatment. */
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, after hydration
21
- * when the platform_sl_hydration_safe_content experiment is enabled (immediately on client-only mounts).
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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "46.19.5",
3
+ "version": "46.19.7",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -59,9 +59,9 @@
59
59
  "@atlaskit/form": "^18.3.0",
60
60
  "@atlaskit/frontend-utilities": "^5.1.0",
61
61
  "@atlaskit/heading": "^8.0.0",
62
- "@atlaskit/icon": "^38.1.0",
62
+ "@atlaskit/icon": "^38.2.0",
63
63
  "@atlaskit/icon-file-type": "^8.3.0",
64
- "@atlaskit/icon-lab": "^7.11.0",
64
+ "@atlaskit/icon-lab": "^7.13.0",
65
65
  "@atlaskit/image": "^5.2.0",
66
66
  "@atlaskit/json-ld-types": "^2.1.0",
67
67
  "@atlaskit/link": "^5.1.0",
@@ -69,12 +69,12 @@
69
69
  "@atlaskit/link-client-extension": "^8.0.0",
70
70
  "@atlaskit/link-extractors": "^5.0.0",
71
71
  "@atlaskit/link-test-helpers": "^11.2.0",
72
- "@atlaskit/linking-common": "^13.0.0",
72
+ "@atlaskit/linking-common": "^13.1.0",
73
73
  "@atlaskit/linking-types": "^16.1.0",
74
74
  "@atlaskit/logo": "^23.3.0",
75
75
  "@atlaskit/lozenge": "^17.0.0",
76
76
  "@atlaskit/menu": "^11.0.0",
77
- "@atlaskit/modal-dialog": "^17.2.0",
77
+ "@atlaskit/modal-dialog": "^17.3.0",
78
78
  "@atlaskit/motion": "^10.0.0",
79
79
  "@atlaskit/object": "^2.3.0",
80
80
  "@atlaskit/outbound-auth-flow-client": "^4.2.0",
@@ -95,14 +95,14 @@
95
95
  "@atlaskit/textfield": "^11.0.0",
96
96
  "@atlaskit/theme": "^28.2.0",
97
97
  "@atlaskit/tile": "^5.0.0",
98
- "@atlaskit/tmp-editor-statsig": "^266.0.0",
98
+ "@atlaskit/tmp-editor-statsig": "^267.0.0",
99
99
  "@atlaskit/tokens": "^20.14.0",
100
100
  "@atlaskit/tooltip": "^24.4.0",
101
101
  "@atlaskit/top-layer": "^8.1.0",
102
102
  "@atlaskit/ufo": "^2.0.0",
103
103
  "@atlaskit/width-detector": "^7.2.0",
104
104
  "@babel/runtime": "^7.0.0",
105
- "@compiled/react": "^1.0.2",
105
+ "@compiled/react": "^2.0.0",
106
106
  "@formatjs/intl-utils": "^3.8.4",
107
107
  "facepaint": "^1.2.1",
108
108
  "lru_map": "^0.4.1",