@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
@@ -4,9 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.currentSiteCloudIdService = exports.CurrentSiteCloudIdService = exports.CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY = exports.CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = void 0;
8
- exports.getCachedCurrentSiteCloudIdAndRefresh = getCachedCurrentSiteCloudIdAndRefresh;
9
- exports.getCurrentSiteCloudId = void 0;
7
+ exports.getCurrentSiteCloudIdLocalStorageKey = exports.getCurrentSiteCloudId = exports.currentSiteCloudIdService = exports.CurrentSiteCloudIdService = exports.CURRENT_SITE_CLOUD_ID_TTL_MS = exports.CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY_PREFIX = exports.CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = void 0;
8
+ exports.getCurrentSiteCloudIdSync = getCurrentSiteCloudIdSync;
10
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -14,31 +13,38 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
14
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
14
  var _storageClient = require("@atlaskit/frontend-utilities/storage-client");
16
15
  var _linkingCommon = require("@atlaskit/linking-common");
17
- /**
18
- * Logical key shape matches smart-card storage conventions (see personalization-service). {@link StorageClient}
19
- * stores rows as `<clientKey>_<itemKey>` with `clientKey === '@atlaskit/smart-card'` and
20
- * `itemKey === 'site-cloud-id:v1'` (no further scope segments; unlike `pct-map:v1:`, this is a single fixed row).
21
- */
22
- var SMART_CARD_STORAGE_SCOPE = '@atlaskit/smart-card';
23
- var CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY = exports.CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY = 'site-cloud-id:v1';
16
+ var SMART_CARD_STORAGE_SCOPE = 'smart-card-social-proof';
17
+ var CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY_PREFIX = exports.CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY_PREFIX = 'site-cloud-id:v1:';
18
+ var CURRENT_SITE_CLOUD_ID_TTL_MS = exports.CURRENT_SITE_CLOUD_ID_TTL_MS = 24 * 60 * 60 * 1000;
24
19
  var smartCardStorage = new _storageClient.StorageClient(SMART_CARD_STORAGE_SCOPE);
20
+ function normalizeBaseUri() {
21
+ var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
22
+ return baseUriWithNoTrailingSlash.replace(/\/$/, '');
23
+ }
24
+ function cloudIdStorageItemKey() {
25
+ var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
26
+ return "".concat(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY_PREFIX).concat(encodeURIComponent(normalizeBaseUri(baseUriWithNoTrailingSlash)));
27
+ }
25
28
 
26
29
  /** Keys written by this service in localStorage when using {@link smartCardStorage}. */
27
- var CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = exports.CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = "".concat(SMART_CARD_STORAGE_SCOPE, "_").concat(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY);
30
+ var getCurrentSiteCloudIdLocalStorageKey = exports.getCurrentSiteCloudIdLocalStorageKey = function getCurrentSiteCloudIdLocalStorageKey() {
31
+ var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
32
+ return "".concat(SMART_CARD_STORAGE_SCOPE, "_").concat(cloudIdStorageItemKey(baseUriWithNoTrailingSlash));
33
+ };
34
+
35
+ /** Backwards-compatible default-scope key for existing tests and external assertions. */
36
+ var CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = exports.CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY = getCurrentSiteCloudIdLocalStorageKey();
28
37
  var CurrentSiteCloudIdService = exports.CurrentSiteCloudIdService = /*#__PURE__*/function () {
29
38
  function CurrentSiteCloudIdService() {
30
39
  (0, _classCallCheck2.default)(this, CurrentSiteCloudIdService);
31
- /**
32
- * Holds the shared tenant_info work: one in-flight fetch, then (on success) a settled promise for the session cloud
33
- * id so later callers never trigger another `tenant_info` in the same page lifetime (until {@link clearCache}).
34
- */
35
- (0, _defineProperty2.default)(this, "tenantInfoInflightPromise", null);
40
+ (0, _defineProperty2.default)(this, "tenantInfoInflightPromises", new Map());
36
41
  }
37
42
  return (0, _createClass2.default)(CurrentSiteCloudIdService, [{
38
43
  key: "readStoredCloudId",
39
44
  value: function readStoredCloudId() {
45
+ var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
40
46
  try {
41
- var cloudId = smartCardStorage.getItem(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY);
47
+ var cloudId = smartCardStorage.getItem(cloudIdStorageItemKey(baseUriWithNoTrailingSlash));
42
48
  if (typeof cloudId !== 'string' || !cloudId || cloudId === 'undefined') {
43
49
  return undefined;
44
50
  }
@@ -49,12 +55,12 @@ var CurrentSiteCloudIdService = exports.CurrentSiteCloudIdService = /*#__PURE__*
49
55
  }
50
56
  }, {
51
57
  key: "writeStoredCloudId",
52
- value: function writeStoredCloudId(cloudId) {
58
+ value: function writeStoredCloudId(baseUriWithNoTrailingSlash, cloudId) {
53
59
  if (!cloudId) {
54
60
  return;
55
61
  }
56
62
  try {
57
- smartCardStorage.setItemWithExpiry(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY, cloudId);
63
+ smartCardStorage.setItemWithExpiry(cloudIdStorageItemKey(baseUriWithNoTrailingSlash), cloudId, CURRENT_SITE_CLOUD_ID_TTL_MS);
58
64
  } catch (_unused2) {
59
65
  // Quota, private-mode, SSR, etc. — same intent as personalization-service.
60
66
  }
@@ -63,67 +69,62 @@ var CurrentSiteCloudIdService = exports.CurrentSiteCloudIdService = /*#__PURE__*
63
69
  key: "ensureTenantInfoInflightStarted",
64
70
  value: function ensureTenantInfoInflightStarted(baseUriWithNoTrailingSlash) {
65
71
  var _this = this;
66
- if (this.tenantInfoInflightPromise !== null) {
67
- return;
72
+ var baseUri = normalizeBaseUri(baseUriWithNoTrailingSlash);
73
+ var existing = this.tenantInfoInflightPromises.get(baseUri);
74
+ if (existing) {
75
+ return existing;
68
76
  }
69
- this.tenantInfoInflightPromise = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
77
+ var promise = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
70
78
  var response, cloudId;
71
79
  return _regenerator.default.wrap(function _callee$(_context) {
72
80
  while (1) switch (_context.prev = _context.next) {
73
81
  case 0:
74
82
  _context.prev = 0;
75
83
  _context.next = 3;
76
- return (0, _linkingCommon.request)('get', baseUriWithNoTrailingSlash + '/_edge/tenant_info');
84
+ return (0, _linkingCommon.request)('get', "".concat(baseUri, "/_edge/tenant_info"));
77
85
  case 3:
78
86
  response = _context.sent;
79
87
  cloudId = response === null || response === void 0 ? void 0 : response.cloudId;
80
88
  if (cloudId) {
81
- _this.writeStoredCloudId(cloudId);
89
+ _this.writeStoredCloudId(baseUri, cloudId);
82
90
  }
83
- return _context.abrupt("return", cloudId ? cloudId : _this.readStoredCloudId());
91
+ return _context.abrupt("return", cloudId ? cloudId : _this.readStoredCloudId(baseUri));
84
92
  case 9:
85
93
  _context.prev = 9;
86
94
  _context.t0 = _context["catch"](0);
87
- _this.tenantInfoInflightPromise = null;
88
- return _context.abrupt("return", _this.readStoredCloudId());
89
- case 13:
95
+ return _context.abrupt("return", _this.readStoredCloudId(baseUri));
96
+ case 12:
97
+ _context.prev = 12;
98
+ _this.tenantInfoInflightPromises.delete(baseUri);
99
+ return _context.finish(12);
100
+ case 15:
90
101
  case "end":
91
102
  return _context.stop();
92
103
  }
93
- }, _callee, null, [[0, 9]]);
104
+ }, _callee, null, [[0, 9, 12, 15]]);
94
105
  }))();
106
+ this.tenantInfoInflightPromises.set(baseUri, promise);
107
+ return promise;
95
108
  }
96
109
 
97
- /**
98
- * Returns the currently cached cloud id synchronously and starts a background refresh.
99
- * The refresh result is persisted for future calls but is not awaited by this call.
100
- */
110
+ /** Pure synchronous read scoped to the given base URI. */
101
111
  }, {
102
- key: "getCachedCloudIdAndRefresh",
103
- value: function getCachedCloudIdAndRefresh() {
104
- this.ensureTenantInfoInflightStarted('');
105
- return this.readStoredCloudId();
112
+ key: "getStoredCloudId",
113
+ value: function getStoredCloudId() {
114
+ var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
115
+ return this.readStoredCloudId(baseUriWithNoTrailingSlash);
106
116
  }
107
117
 
108
118
  /** Writes tenant cloud id for tests or callers that intentionally warm storage before edge resolves. */
109
119
  }, {
110
120
  key: "persistStoredCloudId",
111
121
  value: function persistStoredCloudId(cloudId) {
112
- this.writeStoredCloudId(cloudId);
122
+ var baseUriWithNoTrailingSlash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
123
+ this.writeStoredCloudId(baseUriWithNoTrailingSlash, cloudId);
113
124
  }
114
-
115
- /**
116
- * When local storage already has a tenant cloud id, it is returned immediately; a background tenant_info refresh
117
- * is still kicked off unless one is already in flight.
118
- *
119
- * Without storage, this awaits the deduped in-flight tenant_info (first concurrent caller chooses the URL;
120
- * all share one promise regardless of subsequent `baseUriWithNoTrailingSlash`).
121
- *
122
- * On network success with no cloud id, or on failure: falls back via {@link readStoredCloudId}.
123
- */
124
125
  }, {
125
126
  key: "get",
126
- value: (function () {
127
+ value: function () {
127
128
  var _get = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
128
129
  var baseUriWithNoTrailingSlash,
129
130
  fromStorage,
@@ -132,16 +133,15 @@ var CurrentSiteCloudIdService = exports.CurrentSiteCloudIdService = /*#__PURE__*
132
133
  while (1) switch (_context2.prev = _context2.next) {
133
134
  case 0:
134
135
  baseUriWithNoTrailingSlash = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : '';
135
- fromStorage = this.readStoredCloudId();
136
- this.ensureTenantInfoInflightStarted(baseUriWithNoTrailingSlash);
136
+ fromStorage = this.readStoredCloudId(baseUriWithNoTrailingSlash);
137
137
  if (!fromStorage) {
138
- _context2.next = 5;
138
+ _context2.next = 4;
139
139
  break;
140
140
  }
141
141
  return _context2.abrupt("return", fromStorage);
142
+ case 4:
143
+ return _context2.abrupt("return", this.ensureTenantInfoInflightStarted(baseUriWithNoTrailingSlash));
142
144
  case 5:
143
- return _context2.abrupt("return", this.tenantInfoInflightPromise);
144
- case 6:
145
145
  case "end":
146
146
  return _context2.stop();
147
147
  }
@@ -151,33 +151,20 @@ var CurrentSiteCloudIdService = exports.CurrentSiteCloudIdService = /*#__PURE__*
151
151
  return _get.apply(this, arguments);
152
152
  }
153
153
  return get;
154
- }() /** Clears session pin and persisted storage so the next {@link get} is a fresh tenant_info fetch. */)
154
+ }() /** Clears session pin and persisted storage so the next {@link get} is a fresh tenant_info fetch. */
155
155
  }, {
156
156
  key: "clearCache",
157
157
  value: function clearCache() {
158
- this.tenantInfoInflightPromise = null;
159
- smartCardStorage.removeItem(CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY);
158
+ this.tenantInfoInflightPromises.clear();
160
159
  }
161
160
  }]);
162
161
  }();
163
162
  var currentSiteCloudIdService = exports.currentSiteCloudIdService = new CurrentSiteCloudIdService();
164
-
165
- /**
166
- * Resolves the current site cloud id through the module-level {@link currentSiteCloudIdService}.
167
- * Returns a stored cloud id immediately when one exists; otherwise waits for the shared
168
- * `tenant_info` request and persists the result for subsequent cached reads.
169
- */
163
+ function getCurrentSiteCloudIdSync() {
164
+ var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
165
+ return currentSiteCloudIdService.getStoredCloudId(baseUriWithNoTrailingSlash);
166
+ }
170
167
  var getCurrentSiteCloudId = exports.getCurrentSiteCloudId = function getCurrentSiteCloudId() {
171
168
  var baseUriWithNoTrailingSlash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
172
169
  return currentSiteCloudIdService.get(baseUriWithNoTrailingSlash);
173
- };
174
-
175
- /**
176
- * Reads the current site cloud id from browser storage (the `site-cloud-id:v1` row) via the
177
- * module-level {@link currentSiteCloudIdService} singleton, without awaiting network work.
178
- * Calling this also starts the shared `tenant_info` refresh in the background when one is not
179
- * already running, so a later call can observe a refreshed value when available.
180
- */
181
- function getCachedCurrentSiteCloudIdAndRefresh() {
182
- return currentSiteCloudIdService.getCachedCloudIdAndRefresh();
183
- }
170
+ };
@@ -4,9 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.PersonalizationService = exports.PERSONALIZATION_STORAGE_SCOPE = exports.PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX = void 0;
7
+ exports.SOCIAL_PROOF_TRAIT_NAME = exports.PersonalizationService = exports.PERSONALIZATION_STORAGE_SCOPE = exports.PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX = exports.PERSONALIZATION_PROVIDER_PCT_TTL_MS = void 0;
8
8
  exports.getCachedProviderPctMapAndRefresh = getCachedProviderPctMapAndRefresh;
9
- exports.personalizationService = exports.getProviderPctMap = void 0;
9
+ exports.getProviderPctMap = void 0;
10
+ exports.getProviderPctMapSync = getProviderPctMapSync;
11
+ exports.personalizationService = void 0;
10
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
13
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
14
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -17,19 +19,17 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
17
19
  var _storageClient = require("@atlaskit/frontend-utilities/storage-client");
18
20
  var _currentSiteCloudId = require("../current-site-cloud-id");
19
21
  var BASE_URL = '/gateway/api/tap-delivery/api/v3/personalization';
20
-
21
- /**
22
- * Logical key shape: `@atlaskit/smart-card:<feature>:<schema-version>:<scope>` (see smart-card
23
- * storage conventions). {@link StorageClient} narrows the localStorage key to
24
- * `<clientKey>_<itemKey>` with `clientKey === '@atlaskit/smart-card'` and
25
- * `itemKey === 'pct-map:v1:<cloudId>:<traitName>'` (scope segments URI-encoded).
26
- */
27
- var PERSONALIZATION_STORAGE_SCOPE = exports.PERSONALIZATION_STORAGE_SCOPE = '@atlaskit/smart-card';
22
+ var PERSONALIZATION_STORAGE_SCOPE = exports.PERSONALIZATION_STORAGE_SCOPE = 'smart-card-social-proof';
28
23
  var PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX = exports.PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX = 'pct-map:v1:';
24
+ var PERSONALIZATION_PROVIDER_PCT_TTL_MS = exports.PERSONALIZATION_PROVIDER_PCT_TTL_MS = 24 * 60 * 60 * 1000;
25
+ var SOCIAL_PROOF_TRAIT_NAME = exports.SOCIAL_PROOF_TRAIT_NAME = 'sl_3p_connected_providers_site_pct';
29
26
  var smartCardStorage = new _storageClient.StorageClient(PERSONALIZATION_STORAGE_SCOPE);
30
27
 
31
28
  /** Keys written by this service in localStorage when using {@link smartCardStorage}. */
32
29
  var LOCAL_STORAGE_ROW_KEY_PREFIX = "".concat(PERSONALIZATION_STORAGE_SCOPE, "_").concat(PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX);
30
+ function scopedCacheKey(cloudId, traitName) {
31
+ return "".concat(cloudId, ":").concat(traitName);
32
+ }
33
33
  function pctMapStorageItemKey(cloudId, traitName) {
34
34
  return "".concat(PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX).concat(encodeURIComponent(cloudId), ":").concat(encodeURIComponent(traitName));
35
35
  }
@@ -81,53 +81,46 @@ var PersonalizationService = exports.PersonalizationService = /*#__PURE__*/funct
81
81
  (0, _defineProperty2.default)(this, "cache", new Map());
82
82
  }
83
83
  return (0, _createClass2.default)(PersonalizationService, [{
84
- key: "getCachedProviderPctMapAndRefresh",
85
- value:
86
- /**
87
- * Returns the currently cached provider percentage map synchronously and starts a background refresh.
88
- * The refresh result is persisted for future calls but is not awaited by this call.
89
- */
90
- function getCachedProviderPctMapAndRefresh(traitName) {
91
- var cloudId = (0, _currentSiteCloudId.getCachedCurrentSiteCloudIdAndRefresh)();
92
- var fromStorage = cloudId && this.readStoredProviderPctMap(cloudId, traitName) || null;
93
- void this.getProviderPctMap(traitName);
94
- return fromStorage;
84
+ key: "getProviderPctMapSync",
85
+ value: /** Pure synchronous read for an explicit cloud id / trait pair. */
86
+ function getProviderPctMapSync(cloudId, traitName) {
87
+ if (!cloudId) {
88
+ return null;
89
+ }
90
+ return this.readStoredProviderPctMap(cloudId, traitName);
95
91
  }
96
92
  }, {
97
93
  key: "getProviderPctMap",
98
94
  value: function () {
99
- var _getProviderPctMap = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(traitName) {
95
+ var _getProviderPctMap = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(cloudId, traitName) {
100
96
  var _this = this;
101
- var cachedPromise, promise;
97
+ var cacheKey, cachedPromise, promise, retryablePromise;
102
98
  return _regenerator.default.wrap(function _callee2$(_context2) {
103
99
  while (1) switch (_context2.prev = _context2.next) {
104
100
  case 0:
105
- cachedPromise = this.cache.get(traitName);
101
+ if (cloudId) {
102
+ _context2.next = 2;
103
+ break;
104
+ }
105
+ return _context2.abrupt("return", undefined);
106
+ case 2:
107
+ cacheKey = scopedCacheKey(cloudId, traitName);
108
+ cachedPromise = this.cache.get(cacheKey);
106
109
  if (!cachedPromise) {
107
- _context2.next = 3;
110
+ _context2.next = 6;
108
111
  break;
109
112
  }
110
113
  return _context2.abrupt("return", cachedPromise);
111
- case 3:
114
+ case 6:
112
115
  promise = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
113
- var cloudId, traits, trait, mapped;
116
+ var traits, trait, mapped;
114
117
  return _regenerator.default.wrap(function _callee$(_context) {
115
118
  while (1) switch (_context.prev = _context.next) {
116
119
  case 0:
117
120
  _context.prev = 0;
118
121
  _context.next = 3;
119
- return (0, _currentSiteCloudId.getCurrentSiteCloudId)();
120
- case 3:
121
- cloudId = _context.sent;
122
- if (cloudId) {
123
- _context.next = 6;
124
- break;
125
- }
126
- return _context.abrupt("return", undefined);
127
- case 6:
128
- _context.next = 8;
129
122
  return fetchSiteTraits(cloudId);
130
- case 8:
123
+ case 3:
131
124
  traits = _context.sent;
132
125
  trait = traits.find(function (t) {
133
126
  return t.name === traitName;
@@ -137,25 +130,28 @@ var PersonalizationService = exports.PersonalizationService = /*#__PURE__*/funct
137
130
  _this.writeStoredProviderPctMap(cloudId, traitName, mapped);
138
131
  }
139
132
  return _context.abrupt("return", mapped);
140
- case 15:
141
- _context.prev = 15;
133
+ case 10:
134
+ _context.prev = 10;
142
135
  _context.t0 = _context["catch"](0);
143
136
  return _context.abrupt("return", undefined);
144
- case 18:
137
+ case 13:
145
138
  case "end":
146
139
  return _context.stop();
147
140
  }
148
- }, _callee, null, [[0, 15]]);
141
+ }, _callee, null, [[0, 10]]);
149
142
  }))();
150
- this.cache.set(traitName, promise);
151
- return _context2.abrupt("return", promise);
152
- case 6:
143
+ retryablePromise = promise.finally(function () {
144
+ _this.cache.delete(cacheKey);
145
+ });
146
+ this.cache.set(cacheKey, retryablePromise);
147
+ return _context2.abrupt("return", retryablePromise);
148
+ case 10:
153
149
  case "end":
154
150
  return _context2.stop();
155
151
  }
156
152
  }, _callee2, this);
157
153
  }));
158
- function getProviderPctMap(_x2) {
154
+ function getProviderPctMap(_x2, _x3) {
159
155
  return _getProviderPctMap.apply(this, arguments);
160
156
  }
161
157
  return getProviderPctMap;
@@ -177,7 +173,7 @@ var PersonalizationService = exports.PersonalizationService = /*#__PURE__*/funct
177
173
  key: "writeStoredProviderPctMap",
178
174
  value: function writeStoredProviderPctMap(cloudId, traitName, map) {
179
175
  try {
180
- smartCardStorage.setItemWithExpiry(pctMapStorageItemKey(cloudId, traitName), map);
176
+ smartCardStorage.setItemWithExpiry(pctMapStorageItemKey(cloudId, traitName), map, PERSONALIZATION_PROVIDER_PCT_TTL_MS);
181
177
  } catch (_unused3) {
182
178
  // Quota, private-mode, etc.
183
179
  }
@@ -246,22 +242,25 @@ var PersonalizationService = exports.PersonalizationService = /*#__PURE__*/funct
246
242
  }]);
247
243
  }();
248
244
  var personalizationService = exports.personalizationService = new PersonalizationService();
249
-
250
- /**
251
- * Resolves the provider percentage map for a TAP Delivery trait through the module-level
252
- * {@link personalizationService}. Work is deduped per trait name for the page lifetime, and a
253
- * successful response is persisted by cloud id and trait name for later cached reads.
254
- */
255
- var getProviderPctMap = exports.getProviderPctMap = function getProviderPctMap(traitName) {
256
- return personalizationService.getProviderPctMap(traitName);
245
+ var getProviderPctMap = exports.getProviderPctMap = function getProviderPctMap(cloudId, traitName) {
246
+ return personalizationService.getProviderPctMap(cloudId, traitName);
257
247
  };
248
+ function getProviderPctMapSync(cloudId, traitName) {
249
+ return personalizationService.getProviderPctMapSync(cloudId, traitName);
250
+ }
258
251
 
259
252
  /**
260
- * Reads the provider percentage map for a trait from browser storage via the module-level
261
- * {@link personalizationService} singleton, without awaiting network work.
262
- * Calling this also starts the trait-scoped shared refresh in the background, so a later call can
263
- * use a refreshed value when it becomes available.
253
+ * Backwards-compatible cache-first helper for inline-card social proof callers.
254
+ *
255
+ * Reads the persisted provider percentage map synchronously using the current site cloud id, then
256
+ * starts a background refresh for subsequent mounts. The async result intentionally does not affect
257
+ * the current call site, matching the warm-cache-only rendering contract.
264
258
  */
265
259
  function getCachedProviderPctMapAndRefresh(traitName) {
266
- return personalizationService.getCachedProviderPctMapAndRefresh(traitName);
260
+ var cloudId = (0, _currentSiteCloudId.getCurrentSiteCloudIdSync)();
261
+ var providerPctMap = getProviderPctMapSync(cloudId, traitName);
262
+ void (0, _currentSiteCloudId.getCurrentSiteCloudId)().then(function (resolvedCloudId) {
263
+ void getProviderPctMap(resolvedCloudId, traitName);
264
+ });
265
+ return providerPctMap;
267
266
  }
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card" || '',
14
- packageVersion: "44.6.0" || ''
14
+ packageVersion: "44.7.0" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -14,10 +14,10 @@ var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
16
  var _userAgent = require("@atlaskit/linking-common/user-agent");
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var _constants = require("../../../constants");
19
18
  var _extractRovoChatAction = _interopRequireDefault(require("../../../extractors/flexible/actions/extract-rovo-chat-action"));
20
19
  var _helpers = require("../../../state/helpers");
20
+ var _useBlockCardRovoActionExperiment = _interopRequireDefault(require("../../../state/hooks/use-block-card-rovo-action-experiment"));
21
21
  var _useRovoConfig = _interopRequireDefault(require("../../../state/hooks/use-rovo-config"));
22
22
  var _FlexibleCard = _interopRequireDefault(require("../../FlexibleCard"));
23
23
  var _rovoChatAction = require("../../FlexibleCard/components/actions/rovo-chat-action");
@@ -51,10 +51,12 @@ var ResolvedView = function ResolvedView(_ref) {
51
51
  isPreviewBlockErrored = _useState2[0],
52
52
  setIsPreviewBlockErrored = _useState2[1];
53
53
  var extensionKey = (0, _helpers.getExtensionKey)(cardState.details);
54
- var rovoConfig = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ?
54
+ var _useBlockCardRovoActi = (0, _useBlockCardRovoActionExperiment.default)(url, actionOptions),
55
+ is3PRovoBlockExperimentEnabled = _useBlockCardRovoActi.isEnabled;
56
+ var rovoConfig = is3PRovoBlockExperimentEnabled ?
55
57
  // eslint-disable-next-line react-hooks/rules-of-hooks
56
58
  (0, _useRovoConfig.default)() : undefined;
57
- var showRovoResolvedView = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch') ?
59
+ var showRovoResolvedView = is3PRovoBlockExperimentEnabled ?
58
60
  // eslint-disable-next-line react-hooks/rules-of-hooks
59
61
  (0, _react.useMemo)(function () {
60
62
  return (cardState === null || cardState === void 0 ? void 0 : cardState.status) === 'resolved' && cardState.details && (0, _extractRovoChatAction.default)({
@@ -78,7 +80,7 @@ var ResolvedView = function ResolvedView(_ref) {
78
80
  topMetadata = _getSimulatedBetterMe.topMetadata,
79
81
  bottomMetadata = _getSimulatedBetterMe.bottomMetadata;
80
82
  var prompts = (0, _react.useMemo)(function () {
81
- if ((0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
83
+ if (is3PRovoBlockExperimentEnabled) {
82
84
  var _cardState$details;
83
85
  var defaultPrompts = [_rovoChatAction.RovoChatPromptKey.KEY_HIGHLIGHTS];
84
86
  var linkType = (_cardState$details = cardState.details) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.data) === null || _cardState$details === void 0 ? void 0 : _cardState$details['@type'];
@@ -94,23 +96,20 @@ var ResolvedView = function ResolvedView(_ref) {
94
96
  return [_rovoChatAction.RovoChatPromptKey.SUMMARIZE_LINK].concat(defaultPrompts);
95
97
  }
96
98
  return [];
97
- }, [cardState === null || cardState === void 0 || (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey]);
99
+ }, [cardState === null || cardState === void 0 || (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey, is3PRovoBlockExperimentEnabled]);
98
100
  var footerActions = (0, _react.useMemo)(function () {
99
- if (showRovoResolvedView && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch')) {
100
- return [{
101
- name: _constants.ActionName.RovoChatAction,
102
- prompts: prompts,
103
- iconSize: 'small',
104
- cardAppearance: _constants.CardDisplay.Block
105
- }, {
106
- name: _constants.ActionName.FollowAction,
107
- iconSize: 'small'
108
- }, {
109
- name: _constants.ActionName.DownloadAction,
110
- iconSize: 'small'
111
- }];
112
- }
113
- return [{
101
+ return showRovoResolvedView && is3PRovoBlockExperimentEnabled ? [{
102
+ name: _constants.ActionName.RovoChatAction,
103
+ prompts: prompts,
104
+ iconSize: 'small',
105
+ cardAppearance: _constants.CardDisplay.Block
106
+ }, {
107
+ name: _constants.ActionName.FollowAction,
108
+ iconSize: 'small'
109
+ }, {
110
+ name: _constants.ActionName.DownloadAction,
111
+ iconSize: 'small'
112
+ }] : [{
114
113
  name: _constants.ActionName.FollowAction,
115
114
  hideIcon: true
116
115
  }, {
@@ -120,7 +119,7 @@ var ResolvedView = function ResolvedView(_ref) {
120
119
  name: _constants.ActionName.DownloadAction,
121
120
  hideIcon: true
122
121
  }];
123
- }, [showRovoResolvedView, prompts]);
122
+ }, [showRovoResolvedView, prompts, is3PRovoBlockExperimentEnabled]);
124
123
  var uiOptions = _utils.FlexibleCardUiOptions;
125
124
  uiOptions.enableSnippetRenderer = true;
126
125
  uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
@@ -0,0 +1,36 @@
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 _react = _interopRequireDefault(require("react"));
10
+ var _reactIntl = require("react-intl");
11
+ var _compiled = require("@atlaskit/primitives/compiled");
12
+ var _messages = require("../../../messages");
13
+ // TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
14
+ var SocialProofMessage = function SocialProofMessage(_ref) {
15
+ var tier = _ref.tier,
16
+ connectedPct = _ref.connectedPct,
17
+ providerName = _ref.providerName,
18
+ _ref$testId = _ref.testId,
19
+ testId = _ref$testId === void 0 ? 'smart-block-social-proof-message' : _ref$testId;
20
+ var message = tier === 'not-low' ? _messages.messages.pre_auth_block_social_proof_not_low : _messages.messages.pre_auth_block_social_proof_low;
21
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
22
+ testId: testId
23
+ }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, message, {
24
+ values: {
25
+ percentage: connectedPct !== null && connectedPct !== void 0 ? connectedPct : 0,
26
+ provider: providerName,
27
+ b: function b(chunks) {
28
+ return /*#__PURE__*/_react.default.createElement(_compiled.Text, {
29
+ as: "strong",
30
+ weight: "bold"
31
+ }, chunks);
32
+ }
33
+ }
34
+ })));
35
+ };
36
+ var _default = exports.default = SocialProofMessage;