@atlaskit/smart-card 44.6.1 → 44.7.1

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.
Files changed (212) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-cold-cache--default.png +3 -0
  3. package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-low-tier--default.png +3 -0
  4. package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-not-low-tier--default.png +3 -0
  5. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  6. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  7. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  8. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  9. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  10. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  11. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  12. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  13. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  14. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  15. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  16. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  17. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default--dfo-fix-preview-dynamic-style-false.png +3 -0
  18. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default--dfo-fix-preview-dynamic-style-true.png +3 -0
  19. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  20. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  21. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  22. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  23. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  24. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  25. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  26. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  27. package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
  28. package/dist/cjs/messages.js +12 -1
  29. package/dist/cjs/state/hooks/use-block-card-rovo-action-experiment/index.js +69 -0
  30. package/dist/cjs/state/hooks/use-current-site-cloud-id/index.js +0 -30
  31. package/dist/cjs/state/hooks/use-incoming-outgoing-links/index.js +3 -3
  32. package/dist/cjs/state/hooks/use-rovo-chat/constants.js +7 -0
  33. package/dist/cjs/state/hooks/use-rovo-chat/index.js +2 -2
  34. package/dist/cjs/state/hooks/use-social-proof/index.js +44 -28
  35. package/dist/cjs/state/hooks/use-social-proof-experiment/index.js +48 -0
  36. package/dist/cjs/state/services/current-site-cloud-id/index.js +61 -74
  37. package/dist/cjs/state/services/personalization/index.js +59 -60
  38. package/dist/cjs/utils/analytics/analytics.js +1 -1
  39. package/dist/cjs/view/BlockCard/views/ResolvedView.js +20 -21
  40. package/dist/cjs/view/BlockCard/views/SocialProofMessage.js +36 -0
  41. package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +85 -20
  42. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +3 -2
  43. package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -1
  44. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +3 -1
  45. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
  46. package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +5 -3
  47. package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +4 -3
  48. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +14 -10
  49. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -9
  50. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +20 -1
  51. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +4 -2
  52. package/dist/cjs/view/FlexibleCard/components/elements/common/base-badge-element/index.js +3 -2
  53. package/dist/cjs/view/LinkUrl/index.js +1 -1
  54. package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-cold-cache--default.png +3 -0
  55. package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-low-tier--default.png +3 -0
  56. package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-not-low-tier--default.png +3 -0
  57. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  58. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  59. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  60. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  61. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  62. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  63. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  64. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  65. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  66. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  67. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  68. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  69. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default--dfo-fix-preview-dynamic-style-false.png +3 -0
  70. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default--dfo-fix-preview-dynamic-style-true.png +3 -0
  71. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  72. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  73. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  74. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  75. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  76. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  77. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  78. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  79. package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
  80. package/dist/es2019/messages.js +12 -1
  81. package/dist/es2019/state/hooks/use-block-card-rovo-action-experiment/index.js +64 -0
  82. package/dist/es2019/state/hooks/use-current-site-cloud-id/index.js +0 -1
  83. package/dist/es2019/state/hooks/use-incoming-outgoing-links/index.js +2 -2
  84. package/dist/es2019/state/hooks/use-rovo-chat/constants.js +1 -0
  85. package/dist/es2019/state/hooks/use-rovo-chat/index.js +2 -2
  86. package/dist/es2019/state/hooks/use-social-proof/index.js +41 -22
  87. package/dist/es2019/state/hooks/use-social-proof-experiment/index.js +41 -0
  88. package/dist/es2019/state/services/current-site-cloud-id/index.js +43 -67
  89. package/dist/es2019/state/services/personalization/index.js +40 -39
  90. package/dist/es2019/utils/analytics/analytics.js +1 -1
  91. package/dist/es2019/view/BlockCard/views/ResolvedView.js +29 -31
  92. package/dist/es2019/view/BlockCard/views/SocialProofMessage.js +27 -0
  93. package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +83 -15
  94. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +3 -2
  95. package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -1
  96. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +3 -1
  97. package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
  98. package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +5 -3
  99. package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +4 -3
  100. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +14 -9
  101. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -9
  102. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +23 -1
  103. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +4 -3
  104. package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js +3 -2
  105. package/dist/es2019/view/LinkUrl/index.js +1 -1
  106. package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-cold-cache--default.png +3 -0
  107. package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-low-tier--default.png +3 -0
  108. package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-not-low-tier--default.png +3 -0
  109. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  110. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  111. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  112. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  113. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  114. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  115. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  116. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  117. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  118. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  119. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  120. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  121. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default--dfo-fix-preview-dynamic-style-false.png +3 -0
  122. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default--dfo-fix-preview-dynamic-style-true.png +3 -0
  123. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  124. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  125. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  126. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  127. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-false.png +3 -0
  128. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false-dfo-fix-preview-dynamic-style-true.png +3 -0
  129. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-false.png +3 -0
  130. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true-dfo-fix-preview-dynamic-style-true.png +3 -0
  131. package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
  132. package/dist/esm/messages.js +12 -1
  133. package/dist/esm/state/hooks/use-block-card-rovo-action-experiment/index.js +62 -0
  134. package/dist/esm/state/hooks/use-current-site-cloud-id/index.js +0 -1
  135. package/dist/esm/state/hooks/use-incoming-outgoing-links/index.js +2 -2
  136. package/dist/esm/state/hooks/use-rovo-chat/constants.js +1 -0
  137. package/dist/esm/state/hooks/use-rovo-chat/index.js +2 -2
  138. package/dist/esm/state/hooks/use-social-proof/index.js +45 -29
  139. package/dist/esm/state/hooks/use-social-proof-experiment/index.js +41 -0
  140. package/dist/esm/state/services/current-site-cloud-id/index.js +59 -72
  141. package/dist/esm/state/services/personalization/index.js +56 -59
  142. package/dist/esm/utils/analytics/analytics.js +1 -1
  143. package/dist/esm/view/BlockCard/views/ResolvedView.js +20 -21
  144. package/dist/esm/view/BlockCard/views/SocialProofMessage.js +29 -0
  145. package/dist/esm/view/BlockCard/views/UnauthorisedView.js +85 -20
  146. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +3 -2
  147. package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -1
  148. package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +3 -1
  149. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
  150. package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +5 -3
  151. package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +4 -3
  152. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +14 -10
  153. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -9
  154. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +20 -1
  155. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +4 -2
  156. package/dist/esm/view/FlexibleCard/components/elements/common/base-badge-element/index.js +3 -2
  157. package/dist/esm/view/LinkUrl/index.js +1 -1
  158. package/dist/types/messages.d.ts +1 -1
  159. package/dist/types/state/hooks/use-block-card-rovo-action-experiment/index.d.ts +27 -0
  160. package/dist/types/state/hooks/use-current-site-cloud-id/index.d.ts +0 -1
  161. package/dist/types/state/hooks/use-rovo-chat/constants.d.ts +2 -0
  162. package/dist/types/state/hooks/use-social-proof/index.d.ts +17 -4
  163. package/dist/types/state/hooks/use-social-proof-experiment/index.d.ts +39 -0
  164. package/dist/types/state/services/current-site-cloud-id/index.d.ts +9 -33
  165. package/dist/types/state/services/personalization/index.d.ts +14 -24
  166. package/dist/types/view/BlockCard/views/SocialProofMessage.d.ts +14 -0
  167. package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
  168. package/dist/types-ts4.5/messages.d.ts +1 -1
  169. package/dist/types-ts4.5/state/hooks/use-block-card-rovo-action-experiment/index.d.ts +27 -0
  170. package/dist/types-ts4.5/state/hooks/use-current-site-cloud-id/index.d.ts +0 -1
  171. package/dist/types-ts4.5/state/hooks/use-rovo-chat/constants.d.ts +2 -0
  172. package/dist/types-ts4.5/state/hooks/use-social-proof/index.d.ts +17 -4
  173. package/dist/types-ts4.5/state/hooks/use-social-proof-experiment/index.d.ts +39 -0
  174. package/dist/types-ts4.5/state/services/current-site-cloud-id/index.d.ts +9 -33
  175. package/dist/types-ts4.5/state/services/personalization/index.d.ts +14 -24
  176. package/dist/types-ts4.5/view/BlockCard/views/SocialProofMessage.d.ts +14 -0
  177. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
  178. package/package.json +11 -2
  179. package/smart-card.docs.tsx +2 -2
  180. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false.png +0 -3
  181. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true.png +0 -3
  182. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false.png +0 -3
  183. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true.png +0 -3
  184. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false.png +0 -3
  185. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true.png +0 -3
  186. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default.png +0 -3
  187. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false.png +0 -3
  188. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true.png +0 -3
  189. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false.png +0 -3
  190. package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true.png +0 -3
  191. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false.png +0 -3
  192. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true.png +0 -3
  193. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false.png +0 -3
  194. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true.png +0 -3
  195. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false.png +0 -3
  196. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true.png +0 -3
  197. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default.png +0 -3
  198. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false.png +0 -3
  199. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true.png +0 -3
  200. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false.png +0 -3
  201. package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true.png +0 -3
  202. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false.png +0 -3
  203. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true.png +0 -3
  204. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false.png +0 -3
  205. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true.png +0 -3
  206. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-false.png +0 -3
  207. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-mixed-padding--default--navx-1895-new-logo-design-true.png +0 -3
  208. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default.png +0 -3
  209. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false.png +0 -3
  210. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true.png +0 -3
  211. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false.png +0 -3
  212. package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true.png +0 -3
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:419c17c8146b68f5a03500a8fe4529930380132e63f7224bdf51c964f838612c
3
+ size 359841
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b5b73674a950c6879077c9a13a6b91d3409a74b1e8b07a5d7a06c4c8854395f
3
+ size 360369
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b5b73674a950c6879077c9a13a6b91d3409a74b1e8b07a5d7a06c4c8854395f
3
+ size 360369
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33e95b0db95d1ee939ea9c0297cb051927be09bd18e98445c49905c092782d3b
3
+ size 192028
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33e95b0db95d1ee939ea9c0297cb051927be09bd18e98445c49905c092782d3b
3
+ size 192028
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86f6e899f8bfacea29cacecc55daa2b13c1b3a9d53860d8f100c7b0f25c01a99
3
+ size 192089
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86f6e899f8bfacea29cacecc55daa2b13c1b3a9d53860d8f100c7b0f25c01a99
3
+ size 192089
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cda8c7f337a7c74428939de10935187267499070f3779d8fa083b3f3573cdaa4
3
+ size 132642
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cda8c7f337a7c74428939de10935187267499070f3779d8fa083b3f3573cdaa4
3
+ size 132642
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb42a4bf3aaa1a8fd3b0e82a8fc98a9681e5fe51c906e02e053c15757bd574e0
3
+ size 359972
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb42a4bf3aaa1a8fd3b0e82a8fc98a9681e5fe51c906e02e053c15757bd574e0
3
+ size 359972
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c4b6a81a1e515bd429c31e812901eb816a53c9c83913ac47702bc58c959cb35
3
+ size 360476
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c4b6a81a1e515bd429c31e812901eb816a53c9c83913ac47702bc58c959cb35
3
+ size 360476
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:137c8a1aa6a6b50d2d206d56cccbcb9e2fc396aac79d6e0b583439bc77b6ae58
3
+ size 361983
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:137c8a1aa6a6b50d2d206d56cccbcb9e2fc396aac79d6e0b583439bc77b6ae58
3
+ size 361983
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e80b4c107539bc0f8d65d79f59fe0983acadf717e93eebd7d9cd0b9718c022cb
3
+ size 362922
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e80b4c107539bc0f8d65d79f59fe0983acadf717e93eebd7d9cd0b9718c022cb
3
+ size 362922
@@ -3,6 +3,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
4
4
  import { ActionName } from '../../../constants';
5
5
  import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
6
+ import { isBlockCardRovoActionExperimentEnabled } from '../../../state/hooks/use-block-card-rovo-action-experiment';
6
7
  import { canShowAction } from '../../../utils/actions/can-show-action';
7
8
  import { getIsRovoChatEnabled } from '../../../utils/rovo';
8
9
  import { CardAction } from '../../../view/Card/types';
@@ -26,9 +27,10 @@ const extractRovoChatAction = ({
26
27
  }
27
28
  const extensionKey = getExtensionKey(response);
28
29
  const isGoogleProvider = extensionKey === 'google-object-provider';
30
+ const is3PBlockExperimentEnabled = isBlockCardRovoActionExperimentEnabled(product);
29
31
  const is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
30
32
  const is3PInlinePostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
31
- const is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
33
+ const is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && is3PBlockExperimentEnabled;
32
34
  const isSupportedFeature = is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
33
35
  const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
34
36
  const url = extractSmartLinkUrl(response);
@@ -988,7 +988,7 @@ export const messages = defineMessages({
988
988
  },
989
989
  rovo_prompt_message_highlight_relevant_content: {
990
990
  id: 'fabric.linking.rovo_prompt_message_highlight_relevant_content.non-final',
991
- defaultMessage: '<p>Based on this linked item (<a>{url}</a>) and the {context} Im currently viewing, highlight the parts of the linked content that are most relevant to this work. Explain briefly why each part is relevant.</p>',
991
+ defaultMessage: "<p>Based on this linked item (<a>{url}</a>) and the {context} I'm currently viewing, highlight the parts of the linked content that are most relevant to this work. Explain briefly why each part is relevant.</p>",
992
992
  description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
993
993
  },
994
994
  rovo_prompt_button_identify_key_trends: {
@@ -1050,5 +1050,16 @@ export const messages = defineMessages({
1050
1050
  id: 'fabric.linking.rovo_prompt_button_show_me_whats_relevant.non-final',
1051
1051
  defaultMessage: `Show me what's relevant`,
1052
1052
  description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
1053
+ },
1054
+ // TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
1055
+ pre_auth_block_social_proof_not_low: {
1056
+ id: 'fabric.linking.pre_auth_block_social_proof_not_low',
1057
+ defaultMessage: '<b>{percentage}%</b> of your team is previewing <b>{provider}</b>.',
1058
+ description: 'Social proof message shown on unauthorized 3P block cards when 30% or more of the tenant has connected the provider. {percentage} is a number, {provider} is the 3P app name (e.g. OneDrive).'
1059
+ },
1060
+ pre_auth_block_social_proof_low: {
1061
+ id: 'fabric.linking.pre_auth_block_social_proof_low',
1062
+ defaultMessage: 'Your team is previewing <b>{provider}</b>.',
1063
+ description: 'Social proof message shown on unauthorized 3P block cards when less than 30% of the tenant has connected the provider. {provider} is the 3P app name (e.g. OneDrive).'
1053
1064
  }
1054
1065
  });
@@ -0,0 +1,64 @@
1
+ import { useMemo } from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
5
+ import { getIsRovoChatEnabled } from '../../../utils/rovo';
6
+ import { getExtensionKey } from '../../helpers';
7
+ import { useSmartCardState } from '../../store';
8
+ import { JIRA_PRODUCTS } from '../use-rovo-chat/constants';
9
+ import useRovoConfig from '../use-rovo-config';
10
+ const ELIGIBLE_EXTENSION_KEYS = new Set(['slack-object-provider', 'google-object-provider', 'onedrive-object-provider', 'github-object-provider', 'ms-teams-object-provider', 'gitlab-object-provider', 'salesforce-object-provider']);
11
+ const NOT_ENABLED_RESULT = {
12
+ isEnabled: false
13
+ };
14
+
15
+ /**
16
+ * Returns whether the platform_sl_3p_auth_rovo_block_card_jira or platform_sl_3p_auth_rovo_block_card_confluence experiment
17
+ * is enabled for the current user and link context.
18
+ *
19
+ * All eligibility criteria are consolidated here:
20
+ * 1. Rovo chat must be enabled for the tenant.
21
+ * 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
22
+ * 3. The link must support the RovoActions feature.
23
+ * 4. The extension key must be one of the supported options.
24
+ * 5. The experiment value must be true (via tmp-editor-statsig).
25
+ *
26
+ * The extension key is derived from the card store via the resolved URL,
27
+ * so callers don't need to thread it as a prop.
28
+ */
29
+ const useBlockCardRovoActionExperiment = (url, actionOptions) => {
30
+ var _actionOptions$rovoCh, _actionOptions$rovoCh2;
31
+ const {
32
+ rovoOptions: rovoConfig,
33
+ product
34
+ } = useRovoConfig();
35
+ const isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
36
+ const cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
37
+ const extensionKey = getExtensionKey(cardState.details);
38
+ const isRovoChatActionOptedIn = (_actionOptions$rovoCh = actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh2 = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh2 === void 0 ? void 0 : _actionOptions$rovoCh2.optIn) !== null && _actionOptions$rovoCh !== void 0 ? _actionOptions$rovoCh : false;
39
+ return useMemo(() => {
40
+ if (!isRovoChatEnabled || !url || !isRovoChatActionOptedIn) {
41
+ return NOT_ENABLED_RESULT;
42
+ }
43
+ if (extensionKey && !ELIGIBLE_EXTENSION_KEYS.has(extensionKey)) {
44
+ return NOT_ENABLED_RESULT;
45
+ }
46
+ const isJiraEnabled = !!product && JIRA_PRODUCTS.includes(product) && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') && expValEquals('platform_sl_3p_auth_rovo_block_card_jira', 'isEnabled', true);
47
+ const isConfluenceEnabled = !!product && product === 'CONFLUENCE' && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') && expValEquals('platform_sl_3p_auth_rovo_block_card_confluence', 'isEnabled', true);
48
+ return {
49
+ isEnabled: isJiraEnabled || isConfluenceEnabled
50
+ };
51
+ }, [isRovoChatEnabled, extensionKey, url, isRovoChatActionOptedIn, product]);
52
+ };
53
+ export const isBlockCardRovoActionExperimentEnabled = product => {
54
+ const isJiraEnabled = !!product && JIRA_PRODUCTS.includes(product) && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_block_card_jira', 'isEnabled', true);
55
+ const isConfluenceEnabled = !!product && product === 'CONFLUENCE' && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_block_card_confluence', 'isEnabled', true);
56
+ return isJiraEnabled || isConfluenceEnabled;
57
+ };
58
+ export const useBlockCardRovoActionExperimentNoExposure = () => {
59
+ const {
60
+ product
61
+ } = useRovoConfig();
62
+ return isBlockCardRovoActionExperimentEnabled(product);
63
+ };
64
+ export default useBlockCardRovoActionExperiment;
@@ -1,6 +1,5 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { getCurrentSiteCloudId } from '../../services/current-site-cloud-id';
3
- export { CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY, CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY, currentSiteCloudIdService, getCurrentSiteCloudId, getCachedCurrentSiteCloudIdAndRefresh } from '../../services/current-site-cloud-id';
4
3
  const useCurrentSiteCloudId = () => {
5
4
  const [cloudId, setCloudId] = useState(undefined);
6
5
  const [isLoading, setIsLoading] = useState(true);
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useMemo } from 'react';
2
2
  import { request } from '@atlaskit/linking-common';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
- import { getCurrentSiteCloudId } from '../use-current-site-cloud-id';
4
+ import { getCurrentSiteCloudId } from '../../services/current-site-cloud-id';
5
5
  import { queryIncomingOutgoingLinks as queryIncomingOutgoingAris } from './query';
6
6
  /**
7
7
  * @param baseUriWithNoTrailingSlash base url which will then be appended with /gateway/api/graphql to make requests to AGG
@@ -33,7 +33,7 @@ const useIncomingOutgoingAri = (baseUriWithNoTrailingSlash = '') => {
33
33
  if (match && match[2]) {
34
34
  return match[2]; // Return the cloud_id (siteId)
35
35
  }
36
- return fg('platform_sl_3p_preauth_soc_proof_inline_killswitch') ? await getCurrentSiteCloudId(baseUriWithNoTrailingSlash) : await getCurrentSiteId();
36
+ return fg('platform_sl_incoming_outgoing_tenant_info_killswitch') ? await getCurrentSiteCloudId(baseUriWithNoTrailingSlash) : await getCurrentSiteId();
37
37
  }, [getCurrentSiteId, baseUriWithNoTrailingSlash]);
38
38
  const getIncomingOutgoingAris = useCallback(
39
39
  /**
@@ -0,0 +1 @@
1
+ export const JIRA_PRODUCTS = ['JSM', 'JWM', 'JSW', 'JPD'];
@@ -3,6 +3,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
4
4
  import { getIsRovoChatEnabled } from '../../../utils/rovo';
5
5
  import useRovoConfig from '../use-rovo-config';
6
+ import { JIRA_PRODUCTS } from './constants';
6
7
  const SMART_LINK_TO_ROVO_SOURCE = 'smart-link';
7
8
  const useRovoChat = () => {
8
9
  const {
@@ -15,7 +16,6 @@ const useRovoChat = () => {
15
16
  const isRovoChatEnabled = getIsRovoChatEnabled(config);
16
17
  const sendPromptMessage = useCallback(data => {
17
18
  var _window$parent;
18
- const jiraProducts = ['JSM', 'JWM', 'JSW', 'JPD'];
19
19
  publishWithPostMessage({
20
20
  targetWindow: (_window$parent = window.parent) !== null && _window$parent !== void 0 ? _window$parent : window,
21
21
  payload: {
@@ -27,7 +27,7 @@ const useRovoChat = () => {
27
27
  agentId: undefined
28
28
  },
29
29
  openChat: true,
30
- openChatMode: product && jiraProducts.includes(product) && (fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') || fg('rovogrowth-640-inline-action-nudge-fg')) ? 'mini-modal' : 'sidebar'
30
+ openChatMode: product && JIRA_PRODUCTS.includes(product) && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') || fg('rovogrowth-640-inline-action-nudge-fg') ? 'mini-modal' : 'sidebar'
31
31
  },
32
32
  onAcknowledgeTimeout: () => {
33
33
  // NAVX-3599: Add analytics event
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'react';
2
- import { getProviderPctMap } from '../../services/personalization';
2
+ import { getCurrentSiteCloudId, getCurrentSiteCloudIdSync } from '../../services/current-site-cloud-id';
3
+ import { getProviderPctMap, getProviderPctMapSync, SOCIAL_PROOF_TRAIT_NAME } from '../../services/personalization';
3
4
  const NOT_ENABLED_RESULT = {
4
5
  connectedPct: undefined,
5
6
  isEnabled: false,
@@ -7,39 +8,57 @@ const NOT_ENABLED_RESULT = {
7
8
  };
8
9
 
9
10
  /**
10
- * Fetches provider usage percentage from the TAP Delivery personalization service when the
11
- * killswitch allows it. Callers decide separately (e.g. via Statsig experiment) whether to
12
- * surface that data in the UI.
11
+ * Cache-first social proof hook.
12
+ *
13
+ * On mount:
14
+ * 1. Reads localStorage synchronously via `getProviderPctMapSync`.
15
+ * - If data exists (warm cache): sets `providerPctMap` immediately, `isLoading = false`.
16
+ * - If no data (cold cache): leaves `providerPctMap` undefined, `isLoading = false`.
17
+ * 2. Always kicks off an async fetch (fire-and-forget) via `getProviderPctMap` to populate
18
+ * localStorage for next page load. Does NOT update state with the async result.
19
+ *
20
+ * This means:
21
+ * - First page visit (cold): no social proof rendered, no experiment exposure fired.
22
+ * Background fetch populates localStorage for next time.
23
+ * - Second page visit (warm): social proof renders immediately from localStorage.
24
+ * Background refresh keeps localStorage fresh.
25
+ *
26
+ * Callers decide separately (e.g. via Statsig experiment) whether to surface the data.
13
27
  */
14
- const useSocialProof = (traitName, extensionKey, isKillswitchOn = false) => {
28
+ const useSocialProof = (extensionKey, isKillswitchOn = false, baseUriWithNoTrailingSlash = '') => {
15
29
  const isEnabled = isKillswitchOn;
16
- const [providerPctMap, setProviderPctMap] = useState(undefined);
17
- const [isPersonalizationLoading, setIsPersonalizationLoading] = useState(false);
30
+ const [snapshot] = useState(() => {
31
+ if (!isEnabled) {
32
+ return {
33
+ cloudId: undefined,
34
+ providerPctMap: null
35
+ };
36
+ }
37
+ const cloudId = getCurrentSiteCloudIdSync(baseUriWithNoTrailingSlash);
38
+ return {
39
+ cloudId,
40
+ providerPctMap: getProviderPctMapSync(cloudId, SOCIAL_PROOF_TRAIT_NAME)
41
+ };
42
+ });
43
+
44
+ // Fire-and-forget: warm caches for future mounts only. Never update this mount's treatment UI.
18
45
  useEffect(() => {
19
46
  if (!isEnabled) {
20
47
  return;
21
48
  }
22
- let cancelled = false;
23
- setIsPersonalizationLoading(true);
24
- getProviderPctMap(traitName).then(pctMap => {
25
- if (!cancelled) {
26
- setProviderPctMap(pctMap);
27
- setIsPersonalizationLoading(false);
28
- }
49
+ void getCurrentSiteCloudId(baseUriWithNoTrailingSlash).then(cloudId => {
50
+ void getProviderPctMap(cloudId, SOCIAL_PROOF_TRAIT_NAME);
29
51
  });
30
- return () => {
31
- cancelled = true;
32
- };
33
- }, [isEnabled, traitName]);
52
+ }, [baseUriWithNoTrailingSlash, isEnabled]);
34
53
  return useMemo(() => {
35
54
  if (!isEnabled) {
36
55
  return NOT_ENABLED_RESULT;
37
56
  }
38
57
  return {
39
- connectedPct: extensionKey && providerPctMap ? providerPctMap[extensionKey] : undefined,
40
- isEnabled,
41
- isLoading: isPersonalizationLoading
58
+ connectedPct: extensionKey && snapshot.providerPctMap ? snapshot.providerPctMap[extensionKey] : undefined,
59
+ isEnabled: Boolean(snapshot.cloudId && snapshot.providerPctMap),
60
+ isLoading: false // sync read is instant; never in "loading" state
42
61
  };
43
- }, [extensionKey, isEnabled, isPersonalizationLoading, providerPctMap]);
62
+ }, [extensionKey, isEnabled, snapshot]);
44
63
  };
45
64
  export default useSocialProof;
@@ -0,0 +1,41 @@
1
+ import { useMemo } from 'react';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
+ import useSocialProof from '../use-social-proof';
4
+ const TIER_THRESHOLD = 30;
5
+
6
+ /**
7
+ * Returns enrollment and treatment state for the social proof unauth block card experiment.
8
+ *
9
+ * Delegates data-fetching to `useSocialProof` (Sasha's shared service layer),
10
+ * which handles cloudId resolution, TAP trait fetch, localStorage caching,
11
+ * request deduping, and sync reads.
12
+ *
13
+ * This hook adds the experiment/cohort layer on top:
14
+ * - Only fires exposure (via editorExperiment) when data has loaded.
15
+ * - Derives `tier` and `isTreatment` for rendering decisions.
16
+ *
17
+ * Expected to be called only inside the fg-enabled branch (via componentWithFG).
18
+ *
19
+ * @param extensionKey - The extensionKey of the current 3P provider (e.g. 'google-object-provider').
20
+ */
21
+ const useSocialProofExperiment = (extensionKey, baseUriWithNoTrailingSlash = '') => {
22
+ const {
23
+ connectedPct,
24
+ isEnabled,
25
+ isLoading
26
+ } = useSocialProof(extensionKey, true, baseUriWithNoTrailingSlash);
27
+ return useMemo(() => {
28
+ const hasSocialProofData = connectedPct !== undefined;
29
+
30
+ // Only fire exposure when data has loaded (prevents exposure inflation)
31
+ const isTreatment = isEnabled && !isLoading && hasSocialProofData ? editorExperiment('social_proof_3p_unauth_block_exp', true) : false;
32
+ const tier = connectedPct !== undefined && connectedPct >= TIER_THRESHOLD ? 'not-low' : 'low';
33
+ return {
34
+ isTreatment,
35
+ tier,
36
+ connectedPct,
37
+ isLoading
38
+ };
39
+ }, [isEnabled, isLoading, connectedPct]);
40
+ };
41
+ export default useSocialProofExperiment;
@@ -1,29 +1,29 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
3
3
  import { request } from '@atlaskit/linking-common';
4
-
5
- /**
6
- * Logical key shape matches smart-card storage conventions (see personalization-service). {@link StorageClient}
7
- * stores rows as `<clientKey>_<itemKey>` with `clientKey === '@atlaskit/smart-card'` and
8
- * `itemKey === 'site-cloud-id:v1'` (no further scope segments; unlike `pct-map:v1:`, this is a single fixed row).
9
- */
10
- const SMART_CARD_STORAGE_SCOPE = '@atlaskit/smart-card';
11
- export const CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY = 'site-cloud-id:v1';
4
+ const SMART_CARD_STORAGE_SCOPE = 'smart-card-social-proof';
5
+ export const CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY_PREFIX = 'site-cloud-id:v1:';
6
+ export const CURRENT_SITE_CLOUD_ID_TTL_MS = 24 * 60 * 60 * 1000;
12
7
  const smartCardStorage = new StorageClient(SMART_CARD_STORAGE_SCOPE);
8
+ function normalizeBaseUri(baseUriWithNoTrailingSlash = '') {
9
+ return baseUriWithNoTrailingSlash.replace(/\/$/, '');
10
+ }
11
+ function cloudIdStorageItemKey(baseUriWithNoTrailingSlash = '') {
12
+ return `${CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY_PREFIX}${encodeURIComponent(normalizeBaseUri(baseUriWithNoTrailingSlash))}`;
13
+ }
13
14
 
14
15
  /** Keys written by this service in localStorage when using {@link smartCardStorage}. */
15
- export const CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = `${SMART_CARD_STORAGE_SCOPE}_${CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY}`;
16
+ export const getCurrentSiteCloudIdLocalStorageKey = (baseUriWithNoTrailingSlash = '') => `${SMART_CARD_STORAGE_SCOPE}_${cloudIdStorageItemKey(baseUriWithNoTrailingSlash)}`;
17
+
18
+ /** Backwards-compatible default-scope key for existing tests and external assertions. */
19
+ export const CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = getCurrentSiteCloudIdLocalStorageKey();
16
20
  export class CurrentSiteCloudIdService {
17
21
  constructor() {
18
- /**
19
- * Holds the shared tenant_info work: one in-flight fetch, then (on success) a settled promise for the session cloud
20
- * id so later callers never trigger another `tenant_info` in the same page lifetime (until {@link clearCache}).
21
- */
22
- _defineProperty(this, "tenantInfoInflightPromise", null);
22
+ _defineProperty(this, "tenantInfoInflightPromises", new Map());
23
23
  }
24
- readStoredCloudId() {
24
+ readStoredCloudId(baseUriWithNoTrailingSlash = '') {
25
25
  try {
26
- const cloudId = smartCardStorage.getItem(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY);
26
+ const cloudId = smartCardStorage.getItem(cloudIdStorageItemKey(baseUriWithNoTrailingSlash));
27
27
  if (typeof cloudId !== 'string' || !cloudId || cloudId === 'undefined') {
28
28
  return undefined;
29
29
  }
@@ -32,87 +32,63 @@ export class CurrentSiteCloudIdService {
32
32
  return undefined;
33
33
  }
34
34
  }
35
- writeStoredCloudId(cloudId) {
35
+ writeStoredCloudId(baseUriWithNoTrailingSlash, cloudId) {
36
36
  if (!cloudId) {
37
37
  return;
38
38
  }
39
39
  try {
40
- smartCardStorage.setItemWithExpiry(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY, cloudId);
40
+ smartCardStorage.setItemWithExpiry(cloudIdStorageItemKey(baseUriWithNoTrailingSlash), cloudId, CURRENT_SITE_CLOUD_ID_TTL_MS);
41
41
  } catch {
42
42
  // Quota, private-mode, SSR, etc. — same intent as personalization-service.
43
43
  }
44
44
  }
45
45
  ensureTenantInfoInflightStarted(baseUriWithNoTrailingSlash) {
46
- if (this.tenantInfoInflightPromise !== null) {
47
- return;
46
+ const baseUri = normalizeBaseUri(baseUriWithNoTrailingSlash);
47
+ const existing = this.tenantInfoInflightPromises.get(baseUri);
48
+ if (existing) {
49
+ return existing;
48
50
  }
49
- this.tenantInfoInflightPromise = (async () => {
51
+ const promise = (async () => {
50
52
  try {
51
- const response = await request('get', baseUriWithNoTrailingSlash + '/_edge/tenant_info');
53
+ const response = await request('get', `${baseUri}/_edge/tenant_info`);
52
54
  const cloudId = response === null || response === void 0 ? void 0 : response.cloudId;
53
55
  if (cloudId) {
54
- this.writeStoredCloudId(cloudId);
56
+ this.writeStoredCloudId(baseUri, cloudId);
55
57
  }
56
- return cloudId ? cloudId : this.readStoredCloudId();
58
+ return cloudId ? cloudId : this.readStoredCloudId(baseUri);
57
59
  } catch {
58
- this.tenantInfoInflightPromise = null;
59
- return this.readStoredCloudId();
60
+ return this.readStoredCloudId(baseUri);
61
+ } finally {
62
+ this.tenantInfoInflightPromises.delete(baseUri);
60
63
  }
61
64
  })();
65
+ this.tenantInfoInflightPromises.set(baseUri, promise);
66
+ return promise;
62
67
  }
63
68
 
64
- /**
65
- * Returns the currently cached cloud id synchronously and starts a background refresh.
66
- * The refresh result is persisted for future calls but is not awaited by this call.
67
- */
68
- getCachedCloudIdAndRefresh() {
69
- this.ensureTenantInfoInflightStarted('');
70
- return this.readStoredCloudId();
69
+ /** Pure synchronous read scoped to the given base URI. */
70
+ getStoredCloudId(baseUriWithNoTrailingSlash = '') {
71
+ return this.readStoredCloudId(baseUriWithNoTrailingSlash);
71
72
  }
72
73
 
73
74
  /** Writes tenant cloud id for tests or callers that intentionally warm storage before edge resolves. */
74
- persistStoredCloudId(cloudId) {
75
- this.writeStoredCloudId(cloudId);
75
+ persistStoredCloudId(cloudId, baseUriWithNoTrailingSlash = '') {
76
+ this.writeStoredCloudId(baseUriWithNoTrailingSlash, cloudId);
76
77
  }
77
-
78
- /**
79
- * When local storage already has a tenant cloud id, it is returned immediately; a background tenant_info refresh
80
- * is still kicked off unless one is already in flight.
81
- *
82
- * Without storage, this awaits the deduped in-flight tenant_info (first concurrent caller chooses the URL;
83
- * all share one promise regardless of subsequent `baseUriWithNoTrailingSlash`).
84
- *
85
- * On network success with no cloud id, or on failure: falls back via {@link readStoredCloudId}.
86
- */
87
78
  async get(baseUriWithNoTrailingSlash = '') {
88
- const fromStorage = this.readStoredCloudId();
89
- this.ensureTenantInfoInflightStarted(baseUriWithNoTrailingSlash);
79
+ const fromStorage = this.readStoredCloudId(baseUriWithNoTrailingSlash);
90
80
  if (fromStorage) {
91
81
  return fromStorage;
92
82
  }
93
- return this.tenantInfoInflightPromise;
83
+ return this.ensureTenantInfoInflightStarted(baseUriWithNoTrailingSlash);
94
84
  }
95
85
  /** Clears session pin and persisted storage so the next {@link get} is a fresh tenant_info fetch. */
96
86
  clearCache() {
97
- this.tenantInfoInflightPromise = null;
98
- smartCardStorage.removeItem(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY);
87
+ this.tenantInfoInflightPromises.clear();
99
88
  }
100
89
  }
101
90
  export const currentSiteCloudIdService = new CurrentSiteCloudIdService();
102
-
103
- /**
104
- * Resolves the current site cloud id through the module-level {@link currentSiteCloudIdService}.
105
- * Returns a stored cloud id immediately when one exists; otherwise waits for the shared
106
- * `tenant_info` request and persists the result for subsequent cached reads.
107
- */
108
- export const getCurrentSiteCloudId = (baseUriWithNoTrailingSlash = '') => currentSiteCloudIdService.get(baseUriWithNoTrailingSlash);
109
-
110
- /**
111
- * Reads the current site cloud id from browser storage (the `site-cloud-id:v1` row) via the
112
- * module-level {@link currentSiteCloudIdService} singleton, without awaiting network work.
113
- * Calling this also starts the shared `tenant_info` refresh in the background when one is not
114
- * already running, so a later call can observe a refreshed value when available.
115
- */
116
- export function getCachedCurrentSiteCloudIdAndRefresh() {
117
- return currentSiteCloudIdService.getCachedCloudIdAndRefresh();
118
- }
91
+ export function getCurrentSiteCloudIdSync(baseUriWithNoTrailingSlash = '') {
92
+ return currentSiteCloudIdService.getStoredCloudId(baseUriWithNoTrailingSlash);
93
+ }
94
+ export const getCurrentSiteCloudId = (baseUriWithNoTrailingSlash = '') => currentSiteCloudIdService.get(baseUriWithNoTrailingSlash);