@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
|
@@ -12,11 +12,12 @@ import ButtonGroup from '@atlaskit/button/button-group';
|
|
|
12
12
|
import Button from '@atlaskit/button/standard-button';
|
|
13
13
|
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
14
14
|
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import Tooltip from '@atlaskit/tooltip';
|
|
17
16
|
import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
|
|
18
17
|
import { messages } from '../../../../../messages';
|
|
19
18
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
19
|
+
import { isBlockCardRovoActionExperimentEnabled } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
20
|
+
import useRovoConfig from '../../../../../state/hooks/use-rovo-config';
|
|
20
21
|
import { RovoChatPromptKey } from '../../actions/rovo-chat-action';
|
|
21
22
|
import { sizeToButtonSpacing } from '../../utils';
|
|
22
23
|
import { filterActionItems } from '../utils';
|
|
@@ -51,10 +52,14 @@ const ActionGroup = ({
|
|
|
51
52
|
var _context$actions;
|
|
52
53
|
const context = useFlexibleUiContext();
|
|
53
54
|
const ui = useFlexibleUiOptionContext();
|
|
55
|
+
const {
|
|
56
|
+
product
|
|
57
|
+
} = useRovoConfig();
|
|
54
58
|
const [isOpen, setIsOpen] = useState(false);
|
|
55
|
-
const renderableActionItems = useMemo(() => filterActionItems(items, context), [context, items]);
|
|
59
|
+
const renderableActionItems = useMemo(() => filterActionItems(items, context, product), [context, items, product]);
|
|
56
60
|
const isMoreThenTwoItems = renderableActionItems.length > visibleButtonsNum;
|
|
57
|
-
const
|
|
61
|
+
const rovoChatAction = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.RovoChatAction];
|
|
62
|
+
const is3PBlockExperimentEnabled = isBlockCardRovoActionExperimentEnabled(rovoChatAction === null || rovoChatAction === void 0 ? void 0 : rovoChatAction.product);
|
|
58
63
|
const onOpenChange = useCallback(attrs => {
|
|
59
64
|
setIsOpen(attrs.isOpen);
|
|
60
65
|
if (onDropdownOpenChange) {
|
|
@@ -69,7 +74,7 @@ const ActionGroup = ({
|
|
|
69
74
|
}
|
|
70
75
|
}, [isOpen, onOpenChange]);
|
|
71
76
|
const actionButtons = useMemo(() => {
|
|
72
|
-
if (
|
|
77
|
+
if (!!rovoChatAction && is3PBlockExperimentEnabled) {
|
|
73
78
|
const rovoActions = [...(containerWidth >= REDUCED_ACTIONS_SIZE ? renderableActionItems.slice(0, visibleButtonsNum - 1) : []), {
|
|
74
79
|
name: ActionName.RovoChatAction,
|
|
75
80
|
prompts: [RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
@@ -89,10 +94,10 @@ const ActionGroup = ({
|
|
|
89
94
|
}
|
|
90
95
|
const actionItems = isMoreThenTwoItems ? renderableActionItems.slice(0, visibleButtonsNum - 1) : renderableActionItems;
|
|
91
96
|
return renderActionItems(actionItems, size, appearance, false, onActionItemClick);
|
|
92
|
-
}, [appearance, isMoreThenTwoItems,
|
|
97
|
+
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum, rovoChatAction, is3PBlockExperimentEnabled, containerWidth]);
|
|
93
98
|
const moreActionDropdown = useMemo(() => {
|
|
94
99
|
let actionItems;
|
|
95
|
-
if (
|
|
100
|
+
if (!!rovoChatAction && is3PBlockExperimentEnabled && containerWidth < REDUCED_ACTIONS_SIZE) {
|
|
96
101
|
actionItems = renderableActionItems;
|
|
97
102
|
} else {
|
|
98
103
|
actionItems = isMoreThenTwoItems ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
|
|
@@ -116,11 +121,11 @@ const ActionGroup = ({
|
|
|
116
121
|
testId: "action-group-more-button-tooltip",
|
|
117
122
|
tag: "span"
|
|
118
123
|
}, /*#__PURE__*/React.createElement(Button, _extends({}, props, {
|
|
119
|
-
spacing:
|
|
124
|
+
spacing: !!rovoChatAction && is3PBlockExperimentEnabled ? size === SmartLinkSize.XLarge ? 'default' : 'compact' : spacing,
|
|
120
125
|
testId: "action-group-more-button",
|
|
121
126
|
iconBefore: moreIcon,
|
|
122
127
|
ref: triggerRef
|
|
123
|
-
},
|
|
128
|
+
}, is3PBlockExperimentEnabled ? {
|
|
124
129
|
appearance
|
|
125
130
|
} : {}))),
|
|
126
131
|
testId: "action-group-dropdown",
|
|
@@ -128,7 +133,7 @@ const ActionGroup = ({
|
|
|
128
133
|
}, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
|
|
129
134
|
}
|
|
130
135
|
return null;
|
|
131
|
-
}, [appearance, isMoreThenTwoItems, isOpen,
|
|
136
|
+
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, rovoChatAction, is3PBlockExperimentEnabled, containerWidth]);
|
|
132
137
|
return renderableActionItems.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
133
138
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
134
139
|
className: ax(["_1e0c116y _dzc21h6o _1ilq1i6y", "actions-button-group"]),
|
|
@@ -5,10 +5,10 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, 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 { WidthObserver } from '@atlaskit/width-detector';
|
|
10
9
|
import { ActionName, SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
11
10
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
11
|
+
import { isBlockCardRovoActionExperimentEnabled } from '../../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
12
12
|
import { Provider } from '../../../elements';
|
|
13
13
|
import ActionGroup from '../../action-group';
|
|
14
14
|
import Block from '../../block';
|
|
@@ -29,8 +29,9 @@ const FooterBlockResolvedView = props => {
|
|
|
29
29
|
isPreviewBlockErrored
|
|
30
30
|
} = props;
|
|
31
31
|
const context = useFlexibleUiContext();
|
|
32
|
-
const
|
|
33
|
-
const
|
|
32
|
+
const rovoChatAction = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.RovoChatAction];
|
|
33
|
+
const is3PBlockExperimentEnabled = isBlockCardRovoActionExperimentEnabled(rovoChatAction === null || rovoChatAction === void 0 ? void 0 : rovoChatAction.product);
|
|
34
|
+
const hasPreview = !!rovoChatAction && is3PBlockExperimentEnabled && !!(context !== null && context !== void 0 && context.preview) && !isPreviewBlockErrored;
|
|
34
35
|
const hasActions = useMemo(() => {
|
|
35
36
|
var _filterActionItems;
|
|
36
37
|
return ((_filterActionItems = filterActionItems(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
@@ -56,22 +57,22 @@ const FooterBlockResolvedView = props => {
|
|
|
56
57
|
appearance: "subtle",
|
|
57
58
|
testId: `${testId}-provider`,
|
|
58
59
|
hideLabel: hasPreview,
|
|
59
|
-
className: ax([
|
|
60
|
+
className: ax([!!rovoChatAction && is3PBlockExperimentEnabled && "_1wpz1h6o"])
|
|
60
61
|
}), actions && hasActions ? /*#__PURE__*/React.createElement(ElementGroup, {
|
|
61
62
|
testId: "smart-element-group-actions",
|
|
62
63
|
align: SmartLinkAlignment.Right,
|
|
63
64
|
direction: SmartLinkDirection.Horizontal,
|
|
64
65
|
width: SmartLinkWidth.Flexible,
|
|
65
|
-
className: ax([size === SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq",
|
|
66
|
-
},
|
|
66
|
+
className: ax([size === SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq", !!rovoChatAction && is3PBlockExperimentEnabled && "_kqswh2mm"])
|
|
67
|
+
}, !!rovoChatAction && is3PBlockExperimentEnabled && /*#__PURE__*/React.createElement(WidthObserver, {
|
|
67
68
|
setWidth: setContainerWidth,
|
|
68
69
|
offscreen: true
|
|
69
70
|
}), /*#__PURE__*/React.createElement(ActionGroup, {
|
|
70
71
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
71
72
|
items: actions,
|
|
72
|
-
appearance:
|
|
73
|
-
size:
|
|
74
|
-
containerWidth:
|
|
73
|
+
appearance: !!rovoChatAction && is3PBlockExperimentEnabled ? 'subtle' : 'default',
|
|
74
|
+
size: !!rovoChatAction && is3PBlockExperimentEnabled ? SmartLinkSize.Small : size,
|
|
75
|
+
containerWidth: !!rovoChatAction && is3PBlockExperimentEnabled ? containerWidth : undefined
|
|
75
76
|
})) : null);
|
|
76
77
|
};
|
|
77
78
|
export default FooterBlockResolvedView;
|
|
@@ -4,6 +4,7 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useLayoutEffect, useState } from 'react';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { MediaPlacement } from '../../../../../../constants';
|
|
8
9
|
import { Preview } from '../../../elements';
|
|
9
10
|
import Block from '../../block';
|
|
@@ -26,7 +27,28 @@ const PreviewBlockResolvedView = ({
|
|
|
26
27
|
className,
|
|
27
28
|
...blockProps
|
|
28
29
|
}) => {
|
|
29
|
-
const [dynamicStyles, setDynamicStyles] = useState(
|
|
30
|
+
const [dynamicStyles, setDynamicStyles] = useState(() => {
|
|
31
|
+
if (fg('dfo-fix-preview-dynamic-style')) {
|
|
32
|
+
if (placement === MediaPlacement.Left || placement === MediaPlacement.Right) {
|
|
33
|
+
const containerPadding = ignoreContainerPadding ? '0px' : 'var(--container-padding)';
|
|
34
|
+
const newStyle = {
|
|
35
|
+
...style,
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
top: containerPadding,
|
|
38
|
+
bottom: containerPadding,
|
|
39
|
+
width: `calc(var(--preview-block-width) - ${containerPadding})`,
|
|
40
|
+
...(placement === MediaPlacement.Left ? {
|
|
41
|
+
left: containerPadding
|
|
42
|
+
} : {}),
|
|
43
|
+
...(placement === MediaPlacement.Right ? {
|
|
44
|
+
right: containerPadding
|
|
45
|
+
} : {})
|
|
46
|
+
};
|
|
47
|
+
return newStyle;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return style !== null && style !== void 0 ? style : {};
|
|
51
|
+
});
|
|
30
52
|
const updateStyles = useCallback(() => {
|
|
31
53
|
if (placement === MediaPlacement.Left || placement === MediaPlacement.Right) {
|
|
32
54
|
const containerPadding = ignoreContainerPadding ? '0px' : 'var(--container-padding)';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { ActionName, ElementName, SmartLinkSize } from '../../../../constants';
|
|
4
|
+
import { isBlockCardRovoActionExperimentEnabled } from '../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
5
5
|
import { isFlexibleUiElement } from '../../../../utils/flexible';
|
|
6
6
|
import * as Elements from '../elements';
|
|
7
7
|
import ActionGroup from './action-group';
|
|
@@ -77,7 +77,8 @@ export const isJSXElementNull = children => {
|
|
|
77
77
|
return Boolean(children.type() === null);
|
|
78
78
|
};
|
|
79
79
|
const isElementOrElementGroup = node => /*#__PURE__*/React.isValidElement(node) && (isFlexibleUiElement(node) || node.type === ElementGroup);
|
|
80
|
-
export const filterActionItems = (items = [], context) => {
|
|
80
|
+
export const filterActionItems = (items = [], context, product) => {
|
|
81
|
+
const isBlockCard3PExperimentEnabled = isBlockCardRovoActionExperimentEnabled(product);
|
|
81
82
|
return items.filter(item => {
|
|
82
83
|
switch (item.name) {
|
|
83
84
|
case ActionName.DeleteAction:
|
|
@@ -86,7 +87,7 @@ export const filterActionItems = (items = [], context) => {
|
|
|
86
87
|
// Named and custom actions that user defines.
|
|
87
88
|
return Boolean(ActionName[item.name]);
|
|
88
89
|
case ActionName.RovoChatAction:
|
|
89
|
-
if (
|
|
90
|
+
if (isBlockCard3PExperimentEnabled) {
|
|
90
91
|
return Boolean(ActionName[item.name]);
|
|
91
92
|
}
|
|
92
93
|
// same as default case below
|
package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import "./index.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
7
|
import { IconType } from '../../../../../../constants';
|
|
9
8
|
import { messages } from '../../../../../../messages';
|
|
10
9
|
import { useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
|
|
10
|
+
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
11
11
|
import AtlaskitIcon from '../../../common/atlaskit-icon';
|
|
12
12
|
import ImageIcon from '../../../common/image-icon';
|
|
13
13
|
import { withOverrideCss } from '../../../common/with-override-css';
|
|
@@ -87,12 +87,13 @@ const BaseBadgeRefreshNew = /*#__PURE__*/forwardRef(({
|
|
|
87
87
|
hideLabel = false
|
|
88
88
|
}, ref) => {
|
|
89
89
|
const ui = useFlexibleUiOptionContext();
|
|
90
|
+
const isRovoBlockCardExperimentEnabled = useBlockCardRovoActionExperimentNoExposure();
|
|
90
91
|
const formattedMessageOrLabel = getFormattedMessageFromIcon(icon) || label;
|
|
91
92
|
const badgeIcon = renderAtlaskitIcon(icon, testId) || renderImageIcon(url, testId, ui === null || ui === void 0 ? void 0 : ui.hideLoadingSkeleton);
|
|
92
93
|
if (!formattedMessageOrLabel || !badgeIcon) {
|
|
93
94
|
return null;
|
|
94
95
|
}
|
|
95
|
-
const shouldHideLabel = hideLabel &&
|
|
96
|
+
const shouldHideLabel = hideLabel && isRovoBlockCardExperimentEnabled;
|
|
96
97
|
return /*#__PURE__*/React.createElement("span", {
|
|
97
98
|
"data-smart-element": name,
|
|
98
99
|
"data-smart-element-badge": true,
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "44.
|
|
15
|
+
packageVersion: "44.7.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -3,6 +3,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
4
4
|
import { ActionName } from '../../../constants';
|
|
5
5
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
|
|
6
|
+
import { isBlockCardRovoActionExperimentEnabled } from '../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
6
7
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
7
8
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
8
9
|
import { CardAction } from '../../../view/Card/types';
|
|
@@ -25,9 +26,10 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
25
26
|
}
|
|
26
27
|
var extensionKey = getExtensionKey(response);
|
|
27
28
|
var isGoogleProvider = extensionKey === 'google-object-provider';
|
|
29
|
+
var is3PBlockExperimentEnabled = isBlockCardRovoActionExperimentEnabled(product);
|
|
28
30
|
var is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
29
31
|
var is3PInlinePostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
30
|
-
var is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) &&
|
|
32
|
+
var is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && is3PBlockExperimentEnabled;
|
|
31
33
|
var isSupportedFeature = is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
32
34
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
33
35
|
var url = extractSmartLinkUrl(response);
|
package/dist/esm/messages.js
CHANGED
|
@@ -988,7 +988,7 @@ export var messages = defineMessages({
|
|
|
988
988
|
},
|
|
989
989
|
rovo_prompt_message_highlight_relevant_content: {
|
|
990
990
|
id: 'fabric.linking.rovo_prompt_message_highlight_relevant_content.non-final',
|
|
991
|
-
defaultMessage:
|
|
991
|
+
defaultMessage: "<p>Based on this linked item (<a>{url}</a>) and the {context} I'm currently viewing, highlight the parts of the linked content that are most relevant to this work. Explain briefly why each part is relevant.</p>",
|
|
992
992
|
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
993
993
|
},
|
|
994
994
|
rovo_prompt_button_identify_key_trends: {
|
|
@@ -1050,5 +1050,16 @@ export var messages = defineMessages({
|
|
|
1050
1050
|
id: 'fabric.linking.rovo_prompt_button_show_me_whats_relevant.non-final',
|
|
1051
1051
|
defaultMessage: "Show me what's relevant",
|
|
1052
1052
|
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
1053
|
+
},
|
|
1054
|
+
// TODO: remove when social-proof-3p-unauth-block-fg is cleaned up
|
|
1055
|
+
pre_auth_block_social_proof_not_low: {
|
|
1056
|
+
id: 'fabric.linking.pre_auth_block_social_proof_not_low',
|
|
1057
|
+
defaultMessage: '<b>{percentage}%</b> of your team is previewing <b>{provider}</b>.',
|
|
1058
|
+
description: 'Social proof message shown on unauthorized 3P block cards when 30% or more of the tenant has connected the provider. {percentage} is a number, {provider} is the 3P app name (e.g. OneDrive).'
|
|
1059
|
+
},
|
|
1060
|
+
pre_auth_block_social_proof_low: {
|
|
1061
|
+
id: 'fabric.linking.pre_auth_block_social_proof_low',
|
|
1062
|
+
defaultMessage: 'Your team is previewing <b>{provider}</b>.',
|
|
1063
|
+
description: 'Social proof message shown on unauthorized 3P block cards when less than 30% of the tenant has connected the provider. {provider} is the 3P app name (e.g. OneDrive).'
|
|
1053
1064
|
}
|
|
1054
1065
|
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
|
+
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
6
|
+
import { getExtensionKey } from '../../helpers';
|
|
7
|
+
import { useSmartCardState } from '../../store';
|
|
8
|
+
import { JIRA_PRODUCTS } from '../use-rovo-chat/constants';
|
|
9
|
+
import useRovoConfig from '../use-rovo-config';
|
|
10
|
+
var ELIGIBLE_EXTENSION_KEYS = new Set(['slack-object-provider', 'google-object-provider', 'onedrive-object-provider', 'github-object-provider', 'ms-teams-object-provider', 'gitlab-object-provider', 'salesforce-object-provider']);
|
|
11
|
+
var NOT_ENABLED_RESULT = {
|
|
12
|
+
isEnabled: false
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns whether the platform_sl_3p_auth_rovo_block_card_jira or platform_sl_3p_auth_rovo_block_card_confluence experiment
|
|
17
|
+
* is enabled for the current user and link context.
|
|
18
|
+
*
|
|
19
|
+
* All eligibility criteria are consolidated here:
|
|
20
|
+
* 1. Rovo chat must be enabled for the tenant.
|
|
21
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
22
|
+
* 3. The link must support the RovoActions feature.
|
|
23
|
+
* 4. The extension key must be one of the supported options.
|
|
24
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
25
|
+
*
|
|
26
|
+
* The extension key is derived from the card store via the resolved URL,
|
|
27
|
+
* so callers don't need to thread it as a prop.
|
|
28
|
+
*/
|
|
29
|
+
var useBlockCardRovoActionExperiment = function useBlockCardRovoActionExperiment(url, actionOptions) {
|
|
30
|
+
var _actionOptions$rovoCh, _actionOptions$rovoCh2;
|
|
31
|
+
var _useRovoConfig = useRovoConfig(),
|
|
32
|
+
rovoConfig = _useRovoConfig.rovoOptions,
|
|
33
|
+
product = _useRovoConfig.product;
|
|
34
|
+
var isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
|
|
35
|
+
var cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
|
|
36
|
+
var extensionKey = getExtensionKey(cardState.details);
|
|
37
|
+
var isRovoChatActionOptedIn = (_actionOptions$rovoCh = actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh2 = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh2 === void 0 ? void 0 : _actionOptions$rovoCh2.optIn) !== null && _actionOptions$rovoCh !== void 0 ? _actionOptions$rovoCh : false;
|
|
38
|
+
return useMemo(function () {
|
|
39
|
+
if (!isRovoChatEnabled || !url || !isRovoChatActionOptedIn) {
|
|
40
|
+
return NOT_ENABLED_RESULT;
|
|
41
|
+
}
|
|
42
|
+
if (extensionKey && !ELIGIBLE_EXTENSION_KEYS.has(extensionKey)) {
|
|
43
|
+
return NOT_ENABLED_RESULT;
|
|
44
|
+
}
|
|
45
|
+
var isJiraEnabled = !!product && JIRA_PRODUCTS.includes(product) && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') && expValEquals('platform_sl_3p_auth_rovo_block_card_jira', 'isEnabled', true);
|
|
46
|
+
var isConfluenceEnabled = !!product && product === 'CONFLUENCE' && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') && expValEquals('platform_sl_3p_auth_rovo_block_card_confluence', 'isEnabled', true);
|
|
47
|
+
return {
|
|
48
|
+
isEnabled: isJiraEnabled || isConfluenceEnabled
|
|
49
|
+
};
|
|
50
|
+
}, [isRovoChatEnabled, extensionKey, url, isRovoChatActionOptedIn, product]);
|
|
51
|
+
};
|
|
52
|
+
export var isBlockCardRovoActionExperimentEnabled = function isBlockCardRovoActionExperimentEnabled(product) {
|
|
53
|
+
var isJiraEnabled = !!product && JIRA_PRODUCTS.includes(product) && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_block_card_jira', 'isEnabled', true);
|
|
54
|
+
var isConfluenceEnabled = !!product && product === 'CONFLUENCE' && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_block_card_confluence', 'isEnabled', true);
|
|
55
|
+
return isJiraEnabled || isConfluenceEnabled;
|
|
56
|
+
};
|
|
57
|
+
export var useBlockCardRovoActionExperimentNoExposure = function useBlockCardRovoActionExperimentNoExposure() {
|
|
58
|
+
var _useRovoConfig2 = useRovoConfig(),
|
|
59
|
+
product = _useRovoConfig2.product;
|
|
60
|
+
return isBlockCardRovoActionExperimentEnabled(product);
|
|
61
|
+
};
|
|
62
|
+
export default useBlockCardRovoActionExperiment;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { getCurrentSiteCloudId } from '../../services/current-site-cloud-id';
|
|
4
|
-
export { CURRENT_SITE_CLOUD_ID_LOCAL_STORAGE_KEY, CURRENT_SITE_CLOUD_ID_STORAGE_ITEM_KEY, currentSiteCloudIdService, getCurrentSiteCloudId, getCachedCurrentSiteCloudIdAndRefresh } from '../../services/current-site-cloud-id';
|
|
5
4
|
var useCurrentSiteCloudId = function useCurrentSiteCloudId() {
|
|
6
5
|
var _useState = useState(undefined),
|
|
7
6
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3,7 +3,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
4
|
import { request } from '@atlaskit/linking-common';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { getCurrentSiteCloudId } from '
|
|
6
|
+
import { getCurrentSiteCloudId } from '../../services/current-site-cloud-id';
|
|
7
7
|
import { queryIncomingOutgoingLinks as queryIncomingOutgoingAris } from './query';
|
|
8
8
|
/**
|
|
9
9
|
* @param baseUriWithNoTrailingSlash base url which will then be appended with /gateway/api/graphql to make requests to AGG
|
|
@@ -72,7 +72,7 @@ var useIncomingOutgoingAri = function useIncomingOutgoingAri() {
|
|
|
72
72
|
}
|
|
73
73
|
return _context3.abrupt("return", match[2]);
|
|
74
74
|
case 4:
|
|
75
|
-
if (!fg('
|
|
75
|
+
if (!fg('platform_sl_incoming_outgoing_tenant_info_killswitch')) {
|
|
76
76
|
_context3.next = 10;
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var JIRA_PRODUCTS = ['JSM', 'JWM', 'JSW', 'JPD'];
|
|
@@ -6,6 +6,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
6
6
|
import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
7
7
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
8
8
|
import useRovoConfig from '../use-rovo-config';
|
|
9
|
+
import { JIRA_PRODUCTS } from './constants';
|
|
9
10
|
var SMART_LINK_TO_ROVO_SOURCE = 'smart-link';
|
|
10
11
|
var useRovoChat = function useRovoChat() {
|
|
11
12
|
var _useRovoConfig = useRovoConfig(),
|
|
@@ -16,7 +17,6 @@ var useRovoChat = function useRovoChat() {
|
|
|
16
17
|
var isRovoChatEnabled = getIsRovoChatEnabled(config);
|
|
17
18
|
var sendPromptMessage = useCallback(function (data) {
|
|
18
19
|
var _window$parent;
|
|
19
|
-
var jiraProducts = ['JSM', 'JWM', 'JSW', 'JPD'];
|
|
20
20
|
publishWithPostMessage({
|
|
21
21
|
targetWindow: (_window$parent = window.parent) !== null && _window$parent !== void 0 ? _window$parent : window,
|
|
22
22
|
payload: {
|
|
@@ -28,7 +28,7 @@ var useRovoChat = function useRovoChat() {
|
|
|
28
28
|
agentId: undefined
|
|
29
29
|
}),
|
|
30
30
|
openChat: true,
|
|
31
|
-
openChatMode: product &&
|
|
31
|
+
openChatMode: product && JIRA_PRODUCTS.includes(product) && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') || fg('rovogrowth-640-inline-action-nudge-fg') ? 'mini-modal' : 'sidebar'
|
|
32
32
|
},
|
|
33
33
|
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
34
34
|
// NAVX-3599: Add analytics event
|