@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.
- package/CHANGELOG.md +25 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-cold-cache--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-low-tier--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-not-low-tier--default.png +3 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
- package/dist/cjs/messages.js +12 -1
- package/dist/cjs/state/hooks/use-block-card-rovo-action-experiment/index.js +69 -0
- package/dist/cjs/state/hooks/use-current-site-cloud-id/index.js +0 -30
- package/dist/cjs/state/hooks/use-incoming-outgoing-links/index.js +3 -3
- package/dist/cjs/state/hooks/use-rovo-chat/constants.js +7 -0
- package/dist/cjs/state/hooks/use-rovo-chat/index.js +2 -2
- package/dist/cjs/state/hooks/use-social-proof/index.js +44 -28
- package/dist/cjs/state/hooks/use-social-proof-experiment/index.js +48 -0
- package/dist/cjs/state/services/current-site-cloud-id/index.js +61 -74
- package/dist/cjs/state/services/personalization/index.js +59 -60
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +20 -21
- package/dist/cjs/view/BlockCard/views/SocialProofMessage.js +36 -0
- package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +85 -20
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +4 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +14 -10
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -9
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +20 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-badge-element/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-cold-cache--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-low-tier--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-not-low-tier--default.png +3 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
- package/dist/es2019/messages.js +12 -1
- package/dist/es2019/state/hooks/use-block-card-rovo-action-experiment/index.js +64 -0
- package/dist/es2019/state/hooks/use-current-site-cloud-id/index.js +0 -1
- package/dist/es2019/state/hooks/use-incoming-outgoing-links/index.js +2 -2
- package/dist/es2019/state/hooks/use-rovo-chat/constants.js +1 -0
- package/dist/es2019/state/hooks/use-rovo-chat/index.js +2 -2
- package/dist/es2019/state/hooks/use-social-proof/index.js +41 -22
- package/dist/es2019/state/hooks/use-social-proof-experiment/index.js +41 -0
- package/dist/es2019/state/services/current-site-cloud-id/index.js +43 -67
- package/dist/es2019/state/services/personalization/index.js +40 -39
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +29 -31
- package/dist/es2019/view/BlockCard/views/SocialProofMessage.js +27 -0
- package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +83 -15
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +5 -3
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +14 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +23 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-cold-cache--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-low-tier--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-social-proof-message-not-low-tier--default.png +3 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
- package/dist/esm/messages.js +12 -1
- package/dist/esm/state/hooks/use-block-card-rovo-action-experiment/index.js +62 -0
- package/dist/esm/state/hooks/use-current-site-cloud-id/index.js +0 -1
- package/dist/esm/state/hooks/use-incoming-outgoing-links/index.js +2 -2
- package/dist/esm/state/hooks/use-rovo-chat/constants.js +1 -0
- package/dist/esm/state/hooks/use-rovo-chat/index.js +2 -2
- package/dist/esm/state/hooks/use-social-proof/index.js +45 -29
- package/dist/esm/state/hooks/use-social-proof-experiment/index.js +41 -0
- package/dist/esm/state/services/current-site-cloud-id/index.js +59 -72
- package/dist/esm/state/services/personalization/index.js +56 -59
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +20 -21
- package/dist/esm/view/BlockCard/views/SocialProofMessage.js +29 -0
- package/dist/esm/view/BlockCard/views/UnauthorisedView.js +85 -20
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +3 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +14 -10
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -9
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +20 -1
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/common/base-badge-element/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/hooks/use-block-card-rovo-action-experiment/index.d.ts +27 -0
- package/dist/types/state/hooks/use-current-site-cloud-id/index.d.ts +0 -1
- package/dist/types/state/hooks/use-rovo-chat/constants.d.ts +2 -0
- package/dist/types/state/hooks/use-social-proof/index.d.ts +17 -4
- package/dist/types/state/hooks/use-social-proof-experiment/index.d.ts +39 -0
- package/dist/types/state/services/current-site-cloud-id/index.d.ts +9 -33
- package/dist/types/state/services/personalization/index.d.ts +14 -24
- package/dist/types/view/BlockCard/views/SocialProofMessage.d.ts +14 -0
- package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-block-card-rovo-action-experiment/index.d.ts +27 -0
- package/dist/types-ts4.5/state/hooks/use-current-site-cloud-id/index.d.ts +0 -1
- package/dist/types-ts4.5/state/hooks/use-rovo-chat/constants.d.ts +2 -0
- package/dist/types-ts4.5/state/hooks/use-social-proof/index.d.ts +17 -4
- package/dist/types-ts4.5/state/hooks/use-social-proof-experiment/index.d.ts +39 -0
- package/dist/types-ts4.5/state/services/current-site-cloud-id/index.d.ts +9 -33
- package/dist/types-ts4.5/state/services/personalization/index.d.ts +14 -24
- package/dist/types-ts4.5/view/BlockCard/views/SocialProofMessage.d.ts +14 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
- package/package.json +11 -2
- package/smart-card.docs.tsx +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true.png +0 -3
- 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
- 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
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true.png +0 -3
- 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
- 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
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-large--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-medium--default--navx-1895-new-logo-design-true.png +0 -3
- 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
- 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
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-override-css--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-small--default--navx-1895-new-logo-design-true.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-false.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/flexible-card/flexible-ui-block-preview-xlarge--default--navx-1895-new-logo-design-true.png +0 -3
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
3
|
-
import { getCurrentSiteCloudId,
|
|
3
|
+
import { getCurrentSiteCloudId, getCurrentSiteCloudIdSync } from '../current-site-cloud-id';
|
|
4
4
|
const BASE_URL = '/gateway/api/tap-delivery/api/v3/personalization';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Logical key shape: `@atlaskit/smart-card:<feature>:<schema-version>:<scope>` (see smart-card
|
|
8
|
-
* storage conventions). {@link StorageClient} narrows the localStorage key to
|
|
9
|
-
* `<clientKey>_<itemKey>` with `clientKey === '@atlaskit/smart-card'` and
|
|
10
|
-
* `itemKey === 'pct-map:v1:<cloudId>:<traitName>'` (scope segments URI-encoded).
|
|
11
|
-
*/
|
|
12
|
-
export const PERSONALIZATION_STORAGE_SCOPE = '@atlaskit/smart-card';
|
|
5
|
+
export const PERSONALIZATION_STORAGE_SCOPE = 'smart-card-social-proof';
|
|
13
6
|
export const PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX = 'pct-map:v1:';
|
|
7
|
+
export const PERSONALIZATION_PROVIDER_PCT_TTL_MS = 24 * 60 * 60 * 1000;
|
|
8
|
+
export const SOCIAL_PROOF_TRAIT_NAME = 'sl_3p_connected_providers_site_pct';
|
|
14
9
|
const smartCardStorage = new StorageClient(PERSONALIZATION_STORAGE_SCOPE);
|
|
15
10
|
|
|
16
11
|
/** Keys written by this service in localStorage when using {@link smartCardStorage}. */
|
|
17
12
|
const LOCAL_STORAGE_ROW_KEY_PREFIX = `${PERSONALIZATION_STORAGE_SCOPE}_${PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX}`;
|
|
13
|
+
function scopedCacheKey(cloudId, traitName) {
|
|
14
|
+
return `${cloudId}:${traitName}`;
|
|
15
|
+
}
|
|
18
16
|
function pctMapStorageItemKey(cloudId, traitName) {
|
|
19
17
|
return `${PERSONALIZATION_STORAGE_ITEM_KEY_PREFIX}${encodeURIComponent(cloudId)}:${encodeURIComponent(traitName)}`;
|
|
20
18
|
}
|
|
@@ -41,27 +39,24 @@ export class PersonalizationService {
|
|
|
41
39
|
constructor() {
|
|
42
40
|
_defineProperty(this, "cache", new Map());
|
|
43
41
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const fromStorage = cloudId && this.readStoredProviderPctMap(cloudId, traitName) || null;
|
|
51
|
-
void this.getProviderPctMap(traitName);
|
|
52
|
-
return fromStorage;
|
|
42
|
+
/** Pure synchronous read for an explicit cloud id / trait pair. */
|
|
43
|
+
getProviderPctMapSync(cloudId, traitName) {
|
|
44
|
+
if (!cloudId) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return this.readStoredProviderPctMap(cloudId, traitName);
|
|
53
48
|
}
|
|
54
|
-
async getProviderPctMap(traitName) {
|
|
55
|
-
|
|
49
|
+
async getProviderPctMap(cloudId, traitName) {
|
|
50
|
+
if (!cloudId) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const cacheKey = scopedCacheKey(cloudId, traitName);
|
|
54
|
+
const cachedPromise = this.cache.get(cacheKey);
|
|
56
55
|
if (cachedPromise) {
|
|
57
56
|
return cachedPromise;
|
|
58
57
|
}
|
|
59
58
|
const promise = (async () => {
|
|
60
59
|
try {
|
|
61
|
-
const cloudId = await getCurrentSiteCloudId();
|
|
62
|
-
if (!cloudId) {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
60
|
const traits = await fetchSiteTraits(cloudId);
|
|
66
61
|
const trait = traits.find(t => t.name === traitName);
|
|
67
62
|
const mapped = this.parseTraitValue(trait === null || trait === void 0 ? void 0 : trait.value);
|
|
@@ -73,8 +68,11 @@ export class PersonalizationService {
|
|
|
73
68
|
return undefined;
|
|
74
69
|
}
|
|
75
70
|
})();
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
const retryablePromise = promise.finally(() => {
|
|
72
|
+
this.cache.delete(cacheKey);
|
|
73
|
+
});
|
|
74
|
+
this.cache.set(cacheKey, retryablePromise);
|
|
75
|
+
return retryablePromise;
|
|
78
76
|
}
|
|
79
77
|
readStoredProviderPctMap(cloudId, traitName) {
|
|
80
78
|
try {
|
|
@@ -89,7 +87,7 @@ export class PersonalizationService {
|
|
|
89
87
|
}
|
|
90
88
|
writeStoredProviderPctMap(cloudId, traitName, map) {
|
|
91
89
|
try {
|
|
92
|
-
smartCardStorage.setItemWithExpiry(pctMapStorageItemKey(cloudId, traitName), map);
|
|
90
|
+
smartCardStorage.setItemWithExpiry(pctMapStorageItemKey(cloudId, traitName), map, PERSONALIZATION_PROVIDER_PCT_TTL_MS);
|
|
93
91
|
} catch {
|
|
94
92
|
// Quota, private-mode, etc.
|
|
95
93
|
}
|
|
@@ -145,20 +143,23 @@ export class PersonalizationService {
|
|
|
145
143
|
}
|
|
146
144
|
}
|
|
147
145
|
export const personalizationService = new PersonalizationService();
|
|
146
|
+
export const getProviderPctMap = (cloudId, traitName) => personalizationService.getProviderPctMap(cloudId, traitName);
|
|
147
|
+
export function getProviderPctMapSync(cloudId, traitName) {
|
|
148
|
+
return personalizationService.getProviderPctMapSync(cloudId, traitName);
|
|
149
|
+
}
|
|
148
150
|
|
|
149
151
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Reads the provider percentage map for a trait from browser storage via the module-level
|
|
158
|
-
* {@link personalizationService} singleton, without awaiting network work.
|
|
159
|
-
* Calling this also starts the trait-scoped shared refresh in the background, so a later call can
|
|
160
|
-
* use a refreshed value when it becomes available.
|
|
152
|
+
* Backwards-compatible cache-first helper for inline-card social proof callers.
|
|
153
|
+
*
|
|
154
|
+
* Reads the persisted provider percentage map synchronously using the current site cloud id, then
|
|
155
|
+
* starts a background refresh for subsequent mounts. The async result intentionally does not affect
|
|
156
|
+
* the current call site, matching the warm-cache-only rendering contract.
|
|
161
157
|
*/
|
|
162
158
|
export function getCachedProviderPctMapAndRefresh(traitName) {
|
|
163
|
-
|
|
159
|
+
const cloudId = getCurrentSiteCloudIdSync();
|
|
160
|
+
const providerPctMap = getProviderPctMapSync(cloudId, traitName);
|
|
161
|
+
void getCurrentSiteCloudId().then(resolvedCloudId => {
|
|
162
|
+
void getProviderPctMap(resolvedCloudId, traitName);
|
|
163
|
+
});
|
|
164
|
+
return providerPctMap;
|
|
164
165
|
}
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card" || '',
|
|
5
|
-
packageVersion: "44.
|
|
5
|
+
packageVersion: "44.7.0" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,10 +5,10 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { ActionName, CardDisplay, ElementName, SmartLinkPosition } from '../../../constants';
|
|
10
9
|
import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
|
|
11
10
|
import { getExtensionKey } from '../../../state/helpers';
|
|
11
|
+
import useBlockCardRovoActionExperiment from '../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
12
12
|
import useRovoConfig from '../../../state/hooks/use-rovo-config';
|
|
13
13
|
import FlexibleCard from '../../FlexibleCard';
|
|
14
14
|
import { RovoChatPromptKey } from '../../FlexibleCard/components/actions/rovo-chat-action';
|
|
@@ -38,10 +38,13 @@ const ResolvedView = ({
|
|
|
38
38
|
var _cardState$details2;
|
|
39
39
|
const [isPreviewBlockErrored, setIsPreviewBlockErrored] = useState(false);
|
|
40
40
|
const extensionKey = getExtensionKey(cardState.details);
|
|
41
|
-
const
|
|
41
|
+
const {
|
|
42
|
+
isEnabled: is3PRovoBlockExperimentEnabled
|
|
43
|
+
} = useBlockCardRovoActionExperiment(url, actionOptions);
|
|
44
|
+
const rovoConfig = is3PRovoBlockExperimentEnabled ?
|
|
42
45
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
43
46
|
useRovoConfig() : undefined;
|
|
44
|
-
const showRovoResolvedView =
|
|
47
|
+
const showRovoResolvedView = is3PRovoBlockExperimentEnabled ?
|
|
45
48
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
46
49
|
useMemo(() => (cardState === null || cardState === void 0 ? void 0 : cardState.status) === 'resolved' && cardState.details && extractRovoChatAction({
|
|
47
50
|
response: cardState.details,
|
|
@@ -62,7 +65,7 @@ const ResolvedView = ({
|
|
|
62
65
|
bottomMetadata
|
|
63
66
|
} = getSimulatedBetterMetadata(cardState.details);
|
|
64
67
|
const prompts = useMemo(() => {
|
|
65
|
-
if (
|
|
68
|
+
if (is3PRovoBlockExperimentEnabled) {
|
|
66
69
|
var _cardState$details, _cardState$details$da;
|
|
67
70
|
const defaultPrompts = [RovoChatPromptKey.KEY_HIGHLIGHTS];
|
|
68
71
|
const linkType = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : (_cardState$details$da = _cardState$details.data) === null || _cardState$details$da === void 0 ? void 0 : _cardState$details$da['@type'];
|
|
@@ -78,33 +81,28 @@ const ResolvedView = ({
|
|
|
78
81
|
return [RovoChatPromptKey.SUMMARIZE_LINK, ...defaultPrompts];
|
|
79
82
|
}
|
|
80
83
|
return [];
|
|
81
|
-
}, [cardState === null || cardState === void 0 ? void 0 : (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey]);
|
|
82
|
-
const footerActions = useMemo(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, {
|
|
104
|
-
name: ActionName.DownloadAction,
|
|
105
|
-
hideIcon: true
|
|
106
|
-
}];
|
|
107
|
-
}, [showRovoResolvedView, prompts]);
|
|
84
|
+
}, [cardState === null || cardState === void 0 ? void 0 : (_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.data, extensionKey, is3PRovoBlockExperimentEnabled]);
|
|
85
|
+
const footerActions = useMemo(() => showRovoResolvedView && is3PRovoBlockExperimentEnabled ? [{
|
|
86
|
+
name: ActionName.RovoChatAction,
|
|
87
|
+
prompts: prompts,
|
|
88
|
+
iconSize: 'small',
|
|
89
|
+
cardAppearance: CardDisplay.Block
|
|
90
|
+
}, {
|
|
91
|
+
name: ActionName.FollowAction,
|
|
92
|
+
iconSize: 'small'
|
|
93
|
+
}, {
|
|
94
|
+
name: ActionName.DownloadAction,
|
|
95
|
+
iconSize: 'small'
|
|
96
|
+
}] : [{
|
|
97
|
+
name: ActionName.FollowAction,
|
|
98
|
+
hideIcon: true
|
|
99
|
+
}, {
|
|
100
|
+
name: ActionName.PreviewAction,
|
|
101
|
+
hideIcon: true
|
|
102
|
+
}, {
|
|
103
|
+
name: ActionName.DownloadAction,
|
|
104
|
+
hideIcon: true
|
|
105
|
+
}], [showRovoResolvedView, prompts, is3PRovoBlockExperimentEnabled]);
|
|
108
106
|
const uiOptions = FlexibleCardUiOptions;
|
|
109
107
|
uiOptions.enableSnippetRenderer = true;
|
|
110
108
|
uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl';
|
|
4
|
+
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
5
|
+
import { messages } from '../../../messages';
|
|
6
|
+
// TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
|
|
7
|
+
const SocialProofMessage = ({
|
|
8
|
+
tier,
|
|
9
|
+
connectedPct,
|
|
10
|
+
providerName,
|
|
11
|
+
testId = 'smart-block-social-proof-message'
|
|
12
|
+
}) => {
|
|
13
|
+
const message = tier === 'not-low' ? messages.pre_auth_block_social_proof_not_low : messages.pre_auth_block_social_proof_low;
|
|
14
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
15
|
+
testId: testId
|
|
16
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
17
|
+
values: {
|
|
18
|
+
percentage: connectedPct !== null && connectedPct !== void 0 ? connectedPct : 0,
|
|
19
|
+
provider: providerName,
|
|
20
|
+
b: chunks => /*#__PURE__*/React.createElement(Text, {
|
|
21
|
+
as: "strong",
|
|
22
|
+
weight: "bold"
|
|
23
|
+
}, chunks)
|
|
24
|
+
}
|
|
25
|
+
})));
|
|
26
|
+
};
|
|
27
|
+
export default SocialProofMessage;
|
|
@@ -5,13 +5,18 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
8
|
+
import { di } from 'react-magnetic-di';
|
|
9
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
8
10
|
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
11
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
12
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
9
13
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
14
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
11
15
|
import { ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../constants';
|
|
12
16
|
import { messages } from '../../../messages';
|
|
13
17
|
import { useFlexibleCardContext } from '../../../state/flexible-ui-context';
|
|
14
18
|
import { hasAuthScopeOverrides } from '../../../state/helpers';
|
|
19
|
+
import useSocialProofExperiment from '../../../state/hooks/use-social-proof-experiment';
|
|
15
20
|
import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
16
21
|
import FlexibleCard from '../../FlexibleCard';
|
|
17
22
|
import ActionGroup from '../../FlexibleCard/components/blocks/action-group';
|
|
@@ -21,6 +26,7 @@ import { renderElementItems } from '../../FlexibleCard/components/blocks/utils';
|
|
|
21
26
|
import { LinkIcon, Title } from '../../FlexibleCard/components/elements';
|
|
22
27
|
import { AuthorizeAction } from '../actions/AuthorizeAction';
|
|
23
28
|
import unauthIllustrationGeneral from './assets/general@2x.png';
|
|
29
|
+
import SocialProofMessage from './SocialProofMessage';
|
|
24
30
|
import { FlexibleCardUiOptions, titleBlockOptions } from './utils';
|
|
25
31
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
26
32
|
const contentStyles = null;
|
|
@@ -163,17 +169,15 @@ const UnauthorisedBlock = ({
|
|
|
163
169
|
* @see SmartLinkStatus
|
|
164
170
|
* @see FlexibleCardProps
|
|
165
171
|
*/
|
|
166
|
-
const
|
|
167
|
-
|
|
172
|
+
const UnauthorisedViewFrame = ({
|
|
173
|
+
content,
|
|
174
|
+
providerName,
|
|
175
|
+
testId,
|
|
168
176
|
...props
|
|
169
177
|
}) => {
|
|
170
|
-
var _extractSmartLinkProv;
|
|
171
178
|
const {
|
|
172
|
-
cardState,
|
|
173
179
|
onAuthorize
|
|
174
180
|
} = props;
|
|
175
|
-
const providerName = (_extractSmartLinkProv = extractSmartLinkProvider(cardState.details)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text;
|
|
176
|
-
const isProductIntegrationSupported = hasAuthScopeOverrides(cardState.details);
|
|
177
181
|
const {
|
|
178
182
|
fireEvent
|
|
179
183
|
} = useAnalyticsEvents();
|
|
@@ -183,15 +187,6 @@ const UnauthorisedView = ({
|
|
|
183
187
|
onAuthorize();
|
|
184
188
|
}
|
|
185
189
|
}, [onAuthorize, fireEvent]);
|
|
186
|
-
const content = useMemo(() => onAuthorize ? /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
187
|
-
providerName: providerName,
|
|
188
|
-
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
189
|
-
testId: testId
|
|
190
|
-
}) : /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
|
|
191
|
-
values: {
|
|
192
|
-
context: providerName
|
|
193
|
-
}
|
|
194
|
-
})), [isProductIntegrationSupported, onAuthorize, providerName, testId]);
|
|
195
190
|
const actions = useMemo(() => onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [], [handleAuthorize, onAuthorize, providerName]);
|
|
196
191
|
return /*#__PURE__*/React.createElement(FlexibleCard, _extends({
|
|
197
192
|
appearance: "block",
|
|
@@ -210,5 +205,78 @@ const UnauthorisedView = ({
|
|
|
210
205
|
className: ax(["_11c8fhey _syazi7uo _19pku2gc", actions.length > 0 && "_1reo15vq _18m915vq _otyrpxbi _p12f1osq _o5721q9c _1bto1l2s"])
|
|
211
206
|
}, content)));
|
|
212
207
|
};
|
|
208
|
+
const UnauthorisedViewBase = ({
|
|
209
|
+
testId = 'smart-block-unauthorized-view',
|
|
210
|
+
...props
|
|
211
|
+
}) => {
|
|
212
|
+
var _extractSmartLinkProv;
|
|
213
|
+
const {
|
|
214
|
+
cardState,
|
|
215
|
+
onAuthorize
|
|
216
|
+
} = props;
|
|
217
|
+
const providerName = (_extractSmartLinkProv = extractSmartLinkProvider(cardState.details)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text;
|
|
218
|
+
const isProductIntegrationSupported = hasAuthScopeOverrides(cardState.details);
|
|
219
|
+
const content = useMemo(() => onAuthorize ? /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
220
|
+
providerName: providerName,
|
|
221
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
222
|
+
testId: testId
|
|
223
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
|
|
224
|
+
values: {
|
|
225
|
+
context: providerName
|
|
226
|
+
}
|
|
227
|
+
})), [isProductIntegrationSupported, onAuthorize, providerName, testId]);
|
|
228
|
+
return /*#__PURE__*/React.createElement(UnauthorisedViewFrame, _extends({}, props, {
|
|
229
|
+
content: content,
|
|
230
|
+
providerName: providerName,
|
|
231
|
+
testId: testId
|
|
232
|
+
}));
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Experiment wrapper: fires social proof exposure and renders social proof UI when FG is on.
|
|
237
|
+
* TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
|
|
238
|
+
*/
|
|
239
|
+
const UnauthorisedViewWithExperiment = ({
|
|
240
|
+
testId = 'smart-block-unauthorized-view',
|
|
241
|
+
...props
|
|
242
|
+
}) => {
|
|
243
|
+
var _props$cardState, _props$cardState$deta, _props$cardState$deta2, _extractSmartLinkProv2;
|
|
244
|
+
const extensionKey = (_props$cardState = props.cardState) === null || _props$cardState === void 0 ? void 0 : (_props$cardState$deta = _props$cardState.details) === null || _props$cardState$deta === void 0 ? void 0 : (_props$cardState$deta2 = _props$cardState$deta.meta) === null || _props$cardState$deta2 === void 0 ? void 0 : _props$cardState$deta2.key;
|
|
245
|
+
const providerName = (_extractSmartLinkProv2 = extractSmartLinkProvider(props.cardState.details)) === null || _extractSmartLinkProv2 === void 0 ? void 0 : _extractSmartLinkProv2.text;
|
|
246
|
+
const {
|
|
247
|
+
connections
|
|
248
|
+
} = useSmartLinkContext();
|
|
249
|
+
const {
|
|
250
|
+
isTreatment,
|
|
251
|
+
tier,
|
|
252
|
+
connectedPct
|
|
253
|
+
} = useSocialProofExperiment(providerName ? extensionKey : undefined, connections.client.baseUrlOverride);
|
|
254
|
+
if (!isTreatment || !providerName) {
|
|
255
|
+
return /*#__PURE__*/React.createElement(UnauthorisedViewBase, _extends({}, props, {
|
|
256
|
+
testId: testId
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
259
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
260
|
+
data: {
|
|
261
|
+
attributes: {
|
|
262
|
+
experiment: 'social_proof_3p_unauth_block_exp',
|
|
263
|
+
cohort: 'treatment',
|
|
264
|
+
tier
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}, /*#__PURE__*/React.createElement(UnauthorisedViewFrame, _extends({}, props, {
|
|
268
|
+
content: /*#__PURE__*/React.createElement(SocialProofMessage, {
|
|
269
|
+
tier: tier,
|
|
270
|
+
connectedPct: connectedPct,
|
|
271
|
+
providerName: providerName
|
|
272
|
+
}),
|
|
273
|
+
providerName: providerName,
|
|
274
|
+
testId: testId
|
|
275
|
+
})));
|
|
276
|
+
};
|
|
277
|
+
const UnauthorisedViewWithoutExperiment = props => {
|
|
278
|
+
return /*#__PURE__*/React.createElement(UnauthorisedViewBase, props);
|
|
279
|
+
};
|
|
280
|
+
const UnauthorisedView = componentWithFG('social-proof-3p-unauth-block-fg', UnauthorisedViewWithExperiment, UnauthorisedViewWithoutExperiment);
|
|
213
281
|
const _default_1 = withFlexibleUIBlockCardStyle(UnauthorisedView);
|
|
214
282
|
export default _default_1;
|
|
@@ -5,11 +5,11 @@ import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
|
5
5
|
import { cx } from '@compiled/react';
|
|
6
6
|
import { LoadingButton } from '@atlaskit/button';
|
|
7
7
|
import Button, { IconButton, LinkButton, LinkIconButton } from '@atlaskit/button/new';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
11
10
|
import { ActionName, SmartLinkSize } from '../../../../../../constants';
|
|
12
11
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
|
|
12
|
+
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
13
13
|
import { withOverrideCss } from '../../../common/with-override-css';
|
|
14
14
|
import { sizeToButtonSpacing } from '../../../utils';
|
|
15
15
|
const IconOnlyLarge = null;
|
|
@@ -57,7 +57,8 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
|
|
|
57
57
|
var _context$actions;
|
|
58
58
|
const iconOnly = !content;
|
|
59
59
|
const context = useFlexibleUiContext();
|
|
60
|
-
const
|
|
60
|
+
const isRovoBlockCardExperimentEnabled = useBlockCardRovoActionExperimentNoExposure();
|
|
61
|
+
const isRovoSupported = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.RovoChatAction]) && isRovoBlockCardExperimentEnabled;
|
|
61
62
|
const onButtonClick = useCallback(handler => e => {
|
|
62
63
|
e.preventDefault();
|
|
63
64
|
handler();
|
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -6,6 +6,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
6
6
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
7
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
8
|
import { messages } from '../../../../../messages';
|
|
9
|
+
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
9
10
|
import Action from '../action';
|
|
10
11
|
import { getErrorMessage } from './utils';
|
|
11
12
|
export function AISummariseAction({
|
|
@@ -19,6 +20,7 @@ export function AISummariseAction({
|
|
|
19
20
|
const {
|
|
20
21
|
fireEvent
|
|
21
22
|
} = useAnalyticsEvents();
|
|
23
|
+
const isRovoBlockCardExperimentEnabled = useBlockCardRovoActionExperimentNoExposure();
|
|
22
24
|
const onCompleted = useCallback(state => {
|
|
23
25
|
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
24
26
|
onErrorCallback === null || onErrorCallback === void 0 ? void 0 : onErrorCallback(getErrorMessage(state.error));
|
|
@@ -41,7 +43,7 @@ export function AISummariseAction({
|
|
|
41
43
|
spacing: "spacious",
|
|
42
44
|
color: "currentColor",
|
|
43
45
|
label: "Summarise with AI"
|
|
44
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
46
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled || expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true) ? {
|
|
45
47
|
size: props.iconSize
|
|
46
48
|
} : {})),
|
|
47
49
|
onClick: handleActionClick,
|
|
@@ -9,6 +9,7 @@ import { useAnalyticsEvents } from '../../../../../common/analytics/generated/us
|
|
|
9
9
|
import { ActionName } from '../../../../../constants';
|
|
10
10
|
import { messages } from '../../../../../messages';
|
|
11
11
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
12
|
+
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
12
13
|
import { useSmartLinkModal } from '../../../../../state/modal';
|
|
13
14
|
import Action from '../action';
|
|
14
15
|
import { getModalContent } from './utils';
|
|
@@ -27,6 +28,7 @@ const AutomationAction = props => {
|
|
|
27
28
|
fireEvent
|
|
28
29
|
} = useAnalyticsEvents();
|
|
29
30
|
const automationActionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
|
|
31
|
+
const isRovoBlockCardExperimentEnabled = useBlockCardRovoActionExperimentNoExposure();
|
|
30
32
|
const automationActionOnClick = useCallback(automationActionData => {
|
|
31
33
|
const {
|
|
32
34
|
product,
|
|
@@ -77,7 +79,7 @@ const AutomationAction = props => {
|
|
|
77
79
|
spacing: "spacious",
|
|
78
80
|
color: "currentColor",
|
|
79
81
|
label: automationActionIconLabel
|
|
80
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
82
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled || expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true) ? {
|
|
81
83
|
size: props.iconSize
|
|
82
84
|
} : {})),
|
|
83
85
|
testId: "smart-action-automation-action",
|
|
@@ -7,6 +7,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
7
7
|
import { ActionName } from '../../../../../constants';
|
|
8
8
|
import { messages } from '../../../../../messages';
|
|
9
9
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
10
|
+
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
10
11
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
11
12
|
import Action from '../action';
|
|
12
13
|
const CopyLinkAction = ({
|
|
@@ -18,6 +19,7 @@ const CopyLinkAction = ({
|
|
|
18
19
|
const invoke = useInvokeClientAction({});
|
|
19
20
|
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
|
|
20
21
|
const [tooltipMessage, setTooltipMessage] = useState(messages.copy_url_to_clipboard);
|
|
22
|
+
const isRovoBlockCardExperimentEnabled = useBlockCardRovoActionExperimentNoExposure();
|
|
21
23
|
const onClick = useCallback(() => {
|
|
22
24
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
23
25
|
invoke({
|
|
@@ -37,7 +39,7 @@ const CopyLinkAction = ({
|
|
|
37
39
|
color: "currentColor",
|
|
38
40
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
|
|
39
41
|
spacing: "spacious"
|
|
40
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
42
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled || expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true) ? {
|
|
41
43
|
size: props.iconSize
|
|
42
44
|
} : {})),
|
|
43
45
|
onClick: onClick,
|
|
@@ -9,6 +9,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
9
9
|
import { ActionName } from '../../../../../constants';
|
|
10
10
|
import { messages } from '../../../../../messages';
|
|
11
11
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
12
|
+
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
12
13
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
13
14
|
import Action from '../action';
|
|
14
15
|
const PreviewAction = ({
|
|
@@ -20,6 +21,7 @@ const PreviewAction = ({
|
|
|
20
21
|
const invoke = useInvokeClientAction({});
|
|
21
22
|
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.PreviewAction];
|
|
22
23
|
const hasPreviewPanel = data === null || data === void 0 ? void 0 : data.hasPreviewPanel;
|
|
24
|
+
const isRovoBlockCardExperimentEnabled = useBlockCardRovoActionExperimentNoExposure();
|
|
23
25
|
const onClick = useCallback(() => {
|
|
24
26
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
25
27
|
invoke(data.invokeAction);
|
|
@@ -35,7 +37,7 @@ const PreviewAction = ({
|
|
|
35
37
|
color: "currentColor",
|
|
36
38
|
spacing: "spacious",
|
|
37
39
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
|
|
38
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
40
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled || expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true) ? {
|
|
39
41
|
size: props.iconSize
|
|
40
42
|
} : {}));
|
|
41
43
|
}
|
|
@@ -43,10 +45,10 @@ const PreviewAction = ({
|
|
|
43
45
|
color: "currentColor",
|
|
44
46
|
spacing: "spacious",
|
|
45
47
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
|
|
46
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
48
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled || expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true) ? {
|
|
47
49
|
size: props.iconSize
|
|
48
50
|
} : {}));
|
|
49
|
-
}, [hasPreviewPanel, props.iconSize]);
|
|
51
|
+
}, [hasPreviewPanel, props.iconSize, isRovoBlockCardExperimentEnabled]);
|
|
50
52
|
const actionLabel = useCallback(() => {
|
|
51
53
|
// Only use panel message if experiment is enabled and hasPreviewPanel is true
|
|
52
54
|
if (expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && hasPreviewPanel) {
|
|
@@ -6,11 +6,11 @@ import AiChatIcon from '@atlaskit/icon/core/ai-chat';
|
|
|
6
6
|
import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
|
|
7
7
|
import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
|
|
8
8
|
import { RovoIcon } from '@atlaskit/logo';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
10
|
import { ActionName, CardDisplay } from '../../../../../constants';
|
|
12
11
|
import { messages } from '../../../../../messages';
|
|
13
12
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
13
|
+
import { isBlockCardRovoActionExperimentEnabled } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
14
14
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
15
15
|
import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
|
|
16
16
|
import AiChapterIcon from '../../../assets/ai-chapter-icon';
|
|
@@ -65,6 +65,7 @@ const getPromptAction = (promptKey, intl, url = '', product, iconSize, cardAppea
|
|
|
65
65
|
contextLong: intl.formatMessage(messages.rovo_prompt_context_generic),
|
|
66
66
|
contextShort: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
67
67
|
};
|
|
68
|
+
const isBlockCard3PExperimentEnabled = isBlockCardRovoActionExperimentEnabled(product);
|
|
68
69
|
switch (promptKey) {
|
|
69
70
|
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
70
71
|
const label_recommend = intl.formatMessage(messages.rovo_prompt_button_recommend_other_sources);
|
|
@@ -130,7 +131,7 @@ const getPromptAction = (promptKey, intl, url = '', product, iconSize, cardAppea
|
|
|
130
131
|
ignoreTag: true
|
|
131
132
|
});
|
|
132
133
|
return {
|
|
133
|
-
icon: cardAppearance === CardDisplay.Block &&
|
|
134
|
+
icon: cardAppearance === CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
134
135
|
label: label_summarize,
|
|
135
136
|
size: iconSize
|
|
136
137
|
}) : /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
@@ -194,7 +195,7 @@ const getPromptAction = (promptKey, intl, url = '', product, iconSize, cardAppea
|
|
|
194
195
|
url
|
|
195
196
|
});
|
|
196
197
|
return {
|
|
197
|
-
icon: cardAppearance === CardDisplay.Block &&
|
|
198
|
+
icon: cardAppearance === CardDisplay.Block && isBlockCard3PExperimentEnabled ? /*#__PURE__*/React.createElement(RovoIcon, {
|
|
198
199
|
label: label_ask_rovo_anything,
|
|
199
200
|
size: 'xxsmall',
|
|
200
201
|
shouldUseHexLogo: true
|