@atlaskit/smart-card 26.55.2 → 26.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/constants.js +1 -0
  3. package/dist/cjs/extractors/flexible/actions/extract-copy-link-action.js +21 -0
  4. package/dist/cjs/extractors/flexible/actions/index.js +2 -1
  5. package/dist/cjs/messages.js +10 -0
  6. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  7. package/dist/cjs/utils/analytics/analytics.js +1 -1
  8. package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  9. package/dist/cjs/view/BlockCard/views/styled.js +5 -3
  10. package/dist/cjs/view/Card/types.js +1 -0
  11. package/dist/cjs/view/EmbedCard/views/unresolved-view/styled.js +29 -8
  12. package/dist/cjs/view/EmbedModal/components/embed-content/index.js +5 -4
  13. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +24 -7
  14. package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
  15. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +12 -4
  16. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +88 -0
  17. package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/types.js +5 -0
  18. package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
  19. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js +5 -1
  20. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +6 -2
  21. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +54 -0
  22. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +21 -0
  23. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +15 -1
  24. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +3 -1
  25. package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +34 -7
  26. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +3 -3
  27. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +13 -3
  28. package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/index.js +3 -3
  29. package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +3 -3
  30. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -4
  31. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -3
  32. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +2 -0
  33. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +27 -4
  34. package/dist/cjs/view/FlexibleCard/components/container/index.js +2 -0
  35. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +33 -3
  36. package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/index.js +5 -3
  37. package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +10 -3
  38. package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +16 -4
  39. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +6 -3
  40. package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +23 -7
  41. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +38 -8
  42. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +5 -3
  43. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +46 -6
  44. package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +31 -3
  45. package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +7 -3
  46. package/dist/cjs/view/FlexibleCard/components/utils.js +1 -0
  47. package/dist/cjs/view/HoverCard/components/views/forbidden/styled.js +16 -6
  48. package/dist/cjs/view/HoverCard/components/views/resolved/styled.js +10 -3
  49. package/dist/cjs/view/HoverCard/components/views/resolving/styled.js +23 -7
  50. package/dist/cjs/view/HoverCard/components/views/unauthorised/styled.js +14 -6
  51. package/dist/cjs/view/HoverCard/styled.js +4 -0
  52. package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +36 -10
  53. package/dist/cjs/view/InlineCard/ResolvingView/styled.js +4 -3
  54. package/dist/cjs/view/InlineCard/styled.js +37 -6
  55. package/dist/cjs/view/LinkUrl/LinkWarningModal/styled.js +4 -4
  56. package/dist/cjs/view/LinkUrl/index.js +1 -1
  57. package/dist/cjs/view/common/Icon.js +12 -4
  58. package/dist/cjs/view/common/ai-icon-loading/index.js +12 -3
  59. package/dist/es2019/constants.js +1 -0
  60. package/dist/es2019/extractors/flexible/actions/extract-copy-link-action.js +15 -0
  61. package/dist/es2019/extractors/flexible/actions/index.js +2 -0
  62. package/dist/es2019/messages.js +10 -0
  63. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  64. package/dist/es2019/utils/analytics/analytics.js +1 -1
  65. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -5
  66. package/dist/es2019/view/BlockCard/views/styled.js +4 -4
  67. package/dist/es2019/view/Card/types.js +1 -0
  68. package/dist/es2019/view/EmbedCard/views/unresolved-view/styled.js +29 -29
  69. package/dist/es2019/view/EmbedModal/components/embed-content/index.js +4 -4
  70. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +23 -26
  71. package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
  72. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +12 -4
  73. package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +53 -0
  74. package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/types.js +1 -0
  75. package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
  76. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js +1 -0
  77. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +6 -2
  78. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +44 -0
  79. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +15 -0
  80. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +15 -1
  81. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -1
  82. package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +29 -34
  83. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +3 -4
  84. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +11 -13
  85. package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/index.js +3 -3
  86. package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +3 -3
  87. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +14 -16
  88. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -3
  89. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +2 -0
  90. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +25 -26
  91. package/dist/es2019/view/FlexibleCard/components/container/index.js +2 -0
  92. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +16 -18
  93. package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -4
  94. package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +8 -7
  95. package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +14 -12
  96. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +5 -6
  97. package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +20 -23
  98. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +33 -40
  99. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +4 -4
  100. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +42 -53
  101. package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +28 -32
  102. package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +6 -7
  103. package/dist/es2019/view/FlexibleCard/components/utils.js +1 -0
  104. package/dist/es2019/view/HoverCard/components/views/forbidden/styled.js +16 -16
  105. package/dist/es2019/view/HoverCard/components/views/resolved/styled.js +9 -7
  106. package/dist/es2019/view/HoverCard/components/views/resolving/styled.js +22 -22
  107. package/dist/es2019/view/HoverCard/components/views/unauthorised/styled.js +13 -13
  108. package/dist/es2019/view/HoverCard/styled.js +4 -0
  109. package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +36 -40
  110. package/dist/es2019/view/InlineCard/ResolvingView/styled.js +4 -4
  111. package/dist/es2019/view/InlineCard/styled.js +34 -35
  112. package/dist/es2019/view/LinkUrl/LinkWarningModal/styled.js +4 -4
  113. package/dist/es2019/view/LinkUrl/index.js +1 -1
  114. package/dist/es2019/view/common/Icon.js +11 -11
  115. package/dist/es2019/view/common/ai-icon-loading/index.js +10 -14
  116. package/dist/esm/constants.js +1 -0
  117. package/dist/esm/extractors/flexible/actions/extract-copy-link-action.js +15 -0
  118. package/dist/esm/extractors/flexible/actions/index.js +2 -1
  119. package/dist/esm/messages.js +10 -0
  120. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  121. package/dist/esm/utils/analytics/analytics.js +1 -1
  122. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  123. package/dist/esm/view/BlockCard/views/styled.js +5 -3
  124. package/dist/esm/view/Card/types.js +1 -0
  125. package/dist/esm/view/EmbedCard/views/unresolved-view/styled.js +29 -7
  126. package/dist/esm/view/EmbedModal/components/embed-content/index.js +4 -3
  127. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +22 -6
  128. package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -1
  129. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +12 -4
  130. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +78 -0
  131. package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/types.js +1 -0
  132. package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
  133. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.js +1 -0
  134. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +6 -2
  135. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +47 -0
  136. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.js +15 -0
  137. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +15 -1
  138. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -1
  139. package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +34 -7
  140. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +3 -3
  141. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +13 -3
  142. package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/index.js +3 -3
  143. package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +3 -3
  144. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -4
  145. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -3
  146. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +2 -0
  147. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +26 -4
  148. package/dist/esm/view/FlexibleCard/components/container/index.js +2 -0
  149. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +32 -3
  150. package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -3
  151. package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +11 -3
  152. package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +16 -4
  153. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +5 -3
  154. package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +21 -6
  155. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +36 -7
  156. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +4 -3
  157. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +46 -5
  158. package/dist/esm/view/FlexibleCard/components/elements/media/index.js +30 -3
  159. package/dist/esm/view/FlexibleCard/components/elements/text/index.js +6 -3
  160. package/dist/esm/view/FlexibleCard/components/utils.js +1 -0
  161. package/dist/esm/view/HoverCard/components/views/forbidden/styled.js +16 -5
  162. package/dist/esm/view/HoverCard/components/views/resolved/styled.js +10 -3
  163. package/dist/esm/view/HoverCard/components/views/resolving/styled.js +23 -6
  164. package/dist/esm/view/HoverCard/components/views/unauthorised/styled.js +14 -5
  165. package/dist/esm/view/HoverCard/styled.js +4 -0
  166. package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +36 -10
  167. package/dist/esm/view/InlineCard/ResolvingView/styled.js +4 -3
  168. package/dist/esm/view/InlineCard/styled.js +37 -6
  169. package/dist/esm/view/LinkUrl/LinkWarningModal/styled.js +4 -3
  170. package/dist/esm/view/LinkUrl/index.js +1 -1
  171. package/dist/esm/view/common/Icon.js +11 -4
  172. package/dist/esm/view/common/ai-icon-loading/index.js +11 -3
  173. package/dist/types/constants.d.ts +1 -0
  174. package/dist/types/extractors/flexible/actions/extract-copy-link-action.d.ts +4 -0
  175. package/dist/types/messages.d.ts +1 -1
  176. package/dist/types/state/flexible-ui-context/types.d.ts +4 -0
  177. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
  178. package/dist/types/view/Card/types.d.ts +2 -1
  179. package/dist/types/view/FlexibleCard/components/actions/action/action-button/types.d.ts +2 -0
  180. package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +2 -0
  181. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +19 -0
  182. package/dist/types/view/FlexibleCard/components/actions/copy-link-action/index.d.ts +4 -0
  183. package/dist/types/view/FlexibleCard/components/actions/copy-link-action/types.d.ts +2 -0
  184. package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
  185. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +2 -2
  186. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.d.ts +3 -2
  187. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.d.ts +12 -0
  188. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.d.ts +1 -0
  189. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
  190. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +3 -1
  191. package/dist/types/view/FlexibleCard/components/elements/avatar-group/index.d.ts +0 -1
  192. package/dist/types-ts4.5/constants.d.ts +1 -0
  193. package/dist/types-ts4.5/extractors/flexible/actions/extract-copy-link-action.d.ts +4 -0
  194. package/dist/types-ts4.5/messages.d.ts +1 -1
  195. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +4 -0
  196. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -1
  197. package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
  198. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-button/types.d.ts +2 -0
  199. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +2 -0
  200. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +19 -0
  201. package/dist/types-ts4.5/view/FlexibleCard/components/actions/copy-link-action/index.d.ts +4 -0
  202. package/dist/types-ts4.5/view/FlexibleCard/components/actions/copy-link-action/types.d.ts +2 -0
  203. package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
  204. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +2 -2
  205. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/types.d.ts +3 -2
  206. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.d.ts +12 -0
  207. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/styled.d.ts +1 -0
  208. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
  209. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +3 -1
  210. package/dist/types-ts4.5/view/FlexibleCard/components/elements/avatar-group/index.d.ts +0 -1
  211. package/package.json +2 -1
@@ -145,6 +145,7 @@ export let ElementName = /*#__PURE__*/function (ElementName) {
145
145
  * Flexible UI action (button)
146
146
  */
147
147
  export let ActionName = /*#__PURE__*/function (ActionName) {
148
+ ActionName["CopyLinkAction"] = "CopyLinkAction";
148
149
  ActionName["DeleteAction"] = "DeleteAction";
149
150
  ActionName["EditAction"] = "EditAction";
150
151
  ActionName["FollowAction"] = "FollowAction";
@@ -0,0 +1,15 @@
1
+ import { extractLink } from '@atlaskit/link-extractors';
2
+ import { CardAction } from '../../../view/Card/types';
3
+ import { canShowAction } from '../../../utils/actions/can-show-action';
4
+ export const extractCopyLinkAction = (data, actionOptions) => {
5
+ if (!canShowAction(CardAction.CopyLinkAction, actionOptions)) {
6
+ return;
7
+ }
8
+ const url = extractLink(data);
9
+ if (!url) {
10
+ return;
11
+ }
12
+ return {
13
+ url
14
+ };
15
+ };
@@ -2,8 +2,10 @@ import { ActionName } from '../../../constants';
2
2
  import { extractDownloadAction } from './extract-download-action';
3
3
  import { extractPreviewAction } from './extract-preview-action';
4
4
  import extractFollowAction from './extract-follow-action';
5
+ import { extractCopyLinkAction } from './extract-copy-link-action';
5
6
  const extractActions = (response, data, actionOptions, id) => {
6
7
  const action = {
8
+ [ActionName.CopyLinkAction]: extractCopyLinkAction(data, actionOptions),
7
9
  [ActionName.DownloadAction]: extractDownloadAction(data, actionOptions),
8
10
  [ActionName.FollowAction]: extractFollowAction(response, actionOptions, id),
9
11
  [ActionName.PreviewAction]: extractPreviewAction(response, actionOptions)
@@ -45,6 +45,11 @@ export const messages = defineMessages({
45
45
  defaultMessage: "We cannot show the results of this summary as it goes against <a>Atlassian's Acceptable Use Policy</a>.",
46
46
  description: 'Shown when AI summary is summarising the link resource content and the content violates atlassians acceptable use policy.'
47
47
  },
48
+ ai_summary_error_hipaa_content_detected: {
49
+ id: 'fabric.linking.ai_summary_error_hipaa_content_detected',
50
+ defaultMessage: 'Atlassian Intelligence was unable to process your request as your content contains links to HIPAA restricted content.',
51
+ description: 'Shown when the AI summary is summarising the link resource content and the content contains HIPAA restricted content.'
52
+ },
48
53
  assigned_to: {
49
54
  id: 'fabric.linking.assigned_to',
50
55
  defaultMessage: 'Assigned to {context}',
@@ -145,6 +150,11 @@ export const messages = defineMessages({
145
150
  defaultMessage: 'Copy link',
146
151
  description: ''
147
152
  },
153
+ copied_url_to_clipboard: {
154
+ id: 'fabric.linking.copied_url_to_clipboard.nonfinal',
155
+ defaultMessage: 'Copied!',
156
+ description: 'Url has been copied to the clipboard'
157
+ },
148
158
  could_not_load_link: {
149
159
  id: 'fabric.linking.couldnt_load_link',
150
160
  defaultMessage: "We couldn't load this link for an unknown reason.",
@@ -1 +1 @@
1
- export const errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED'];
1
+ export const errorMessages = ['NETWORK_ERROR', 'NO_ANSWER', 'RATE_LIMIT', 'NO_AGENT', 'PLUGIN_ERRORED', 'OPENAI_RATE_LIMIT_USER_ABUSE', 'ACCEPTABLE_USE_VIOLATIONS', 'AI_DISABLED', 'UNEXPECTED', 'HIPAA_CONTENT_DETECTED'];
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "26.55.2"
7
+ packageVersion: "26.56.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,11 +10,11 @@ import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
10
10
  import { messages } from '../../../../messages';
11
11
  import UnresolvedView from './unresolved-view';
12
12
  import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
13
- const contentStyles = css`
14
- color: ${"var(--ds-text-subtlest, #626F86)"};
15
- margin-top: 0.5rem;
16
- font-size: 0.75rem;
17
- `;
13
+ const contentStyles = css({
14
+ color: "var(--ds-text-subtlest, #626F86)",
15
+ marginTop: "var(--ds-space-100, 0.5rem)",
16
+ fontSize: '0.75rem'
17
+ });
18
18
 
19
19
  /**
20
20
  * This view represents a Block card that has an 'Unauthorized' status .
@@ -1,7 +1,7 @@
1
1
  import styled from '@emotion/styled';
2
2
  // TODO: Replace overrides with proper AtlasKit solution.
3
- export const LozengeBlockWrapper = styled.span`
4
- & > span {
5
- margin-left: ${"var(--ds-space-050, 4px)"};
3
+ export const LozengeBlockWrapper = styled.span({
4
+ '& > span': {
5
+ marginLeft: "var(--ds-space-050, 4px)"
6
6
  }
7
- `;
7
+ });
@@ -4,5 +4,6 @@ export let CardAction = /*#__PURE__*/function (CardAction) {
4
4
  CardAction["ViewAction"] = "ViewAction";
5
5
  CardAction["ChangeStatusAction"] = "ChangeStatusAction";
6
6
  CardAction["FollowAction"] = "FollowAction";
7
+ CardAction["CopyLinkAction"] = "CopyLinkAction";
7
8
  return CardAction;
8
9
  }({});
@@ -1,31 +1,31 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { gs } from '../../../common/utils';
3
- export const containerStyles = css`
4
- display: grid;
5
- height: inherit;
6
- `;
7
- export const contentStyles = css`
8
- display: flex;
9
- flex-direction: column;
10
- justify-content: center;
11
- align-items: center;
12
- margin: auto;
13
- padding: ${"var(--ds-space-200, 16px)"};
14
- gap: ${"var(--ds-space-250, 20px)"};
15
- max-width: ${gs(50)};
16
- `;
17
- export const imageStyles = css`
18
- height: 120px;
19
- width: 180px;
20
- object-fit: contain;
21
- object-position: center center;
22
- `;
23
- export const titleStyles = css`
24
- text-align: center;
25
- margin: 0;
26
- padding: 0;
27
- `;
28
- export const descriptionStyles = css`
29
- font-size: 1em;
30
- text-align: center;
31
- `;
3
+ export const containerStyles = css({
4
+ display: 'grid',
5
+ height: 'inherit'
6
+ });
7
+ export const contentStyles = css({
8
+ display: 'flex',
9
+ flexDirection: 'column',
10
+ justifyContent: 'center',
11
+ alignItems: 'center',
12
+ margin: 'auto',
13
+ padding: "var(--ds-space-200, 16px)",
14
+ gap: "var(--ds-space-250, 20px)",
15
+ maxWidth: gs(50)
16
+ });
17
+ export const imageStyles = css({
18
+ height: '120px',
19
+ width: '180px',
20
+ objectFit: 'contain',
21
+ objectPosition: 'center center'
22
+ });
23
+ export const titleStyles = css({
24
+ textAlign: 'center',
25
+ margin: 0,
26
+ padding: 0
27
+ });
28
+ export const descriptionStyles = css({
29
+ fontSize: '1em',
30
+ textAlign: 'center'
31
+ });
@@ -4,10 +4,10 @@ import { di } from 'react-magnetic-di';
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { getIframeSandboxAttribute } from '../../../../utils';
6
6
  import { IFrame } from '../../../EmbedCard/components/IFrame';
7
- const iframeCss = css`
8
- width: 100%;
9
- height: calc(100vh - 208px);
10
- `;
7
+ const iframeCss = css({
8
+ width: '100%',
9
+ height: 'calc(100vh - 208px)'
10
+ });
11
11
  const EmbedContent = ({
12
12
  isTrusted,
13
13
  name,
@@ -8,35 +8,28 @@ import { sizeToButtonSpacing } from '../../../utils';
8
8
  const getButtonStyle = (size, iconOnly) => {
9
9
  switch (size) {
10
10
  case SmartLinkSize.Large:
11
- return iconOnly ? css`
12
- button,
13
- button:hover,
14
- button:focus,
15
- button:active {
16
- padding: 0;
17
- > span {
18
- margin: 0;
19
- }
20
- }
21
- ` : '';
11
+ return iconOnly ? css({
12
+ 'button, button:hover, button:focus, button:active': {
13
+ padding: 0,
14
+ '> span': {
15
+ margin: 0
16
+ }
17
+ }
18
+ }) : '';
22
19
  case SmartLinkSize.Small:
23
- return css`
24
- font-size: 0.75rem;
25
- font-weight: 500;
26
- line-height: 1rem;
27
- button,
28
- button:hover,
29
- button:focus,
30
- button:active {
31
- line-height: 1rem;
32
- ${iconOnly ? `
20
+ return css({
21
+ fontSize: '0.75rem',
22
+ fontWeight: 500,
23
+ lineHeight: '1rem',
24
+ 'button, button:hover, button:focus, button:active': [{
25
+ lineHeight: '1rem'
26
+ }, iconOnly ? `
33
27
  padding: 0.125rem;
34
28
  ` : `
35
29
  padding-left: 0.25rem;
36
30
  padding-right: 0.25rem;
37
- `}
38
- }
39
- `;
31
+ `]
32
+ });
40
33
  case SmartLinkSize.XLarge:
41
34
  case SmartLinkSize.Medium:
42
35
  default:
@@ -54,7 +47,9 @@ const ActionButton = ({
54
47
  size,
55
48
  testId,
56
49
  tooltipMessage,
57
- isDisabled
50
+ isDisabled,
51
+ href,
52
+ ariaLabel
58
53
  }) => {
59
54
  const iconOnly = !content;
60
55
  const onButtonClick = useCallback(handler => e => {
@@ -76,7 +71,9 @@ const ActionButton = ({
76
71
  isLoading: isLoading,
77
72
  onClick: onButtonClick(onClick),
78
73
  spacing: sizeToButtonSpacing[size],
79
- testId: testId
74
+ testId: testId,
75
+ href: href,
76
+ "aria-label": ariaLabel
80
77
  }, content)));
81
78
  };
82
79
  export default ActionButton;
@@ -46,7 +46,8 @@ const ActionStackItem = ({
46
46
  space: spaceOption,
47
47
  testId,
48
48
  tooltipMessage,
49
- xcss
49
+ xcss,
50
+ tooltipOnHide
50
51
  }) => {
51
52
  const space = spaceOption !== null && spaceOption !== void 0 ? spaceOption : getPrimitivesInlineSpaceBySize(size);
52
53
  const onClick = useCallback(() => {
@@ -65,6 +66,7 @@ const ActionStackItem = ({
65
66
  // Replace Box with Pressable once it becomes stable (currently beta)
66
67
  return /*#__PURE__*/React.createElement(Tooltip, {
67
68
  content: tooltipMessage || content,
69
+ onHide: tooltipOnHide,
68
70
  hideTooltipOnMouseDown: true
69
71
  }, tooltipProps => /*#__PURE__*/React.createElement(Box, _extends({
70
72
  as: "button",
@@ -24,10 +24,14 @@ const Action = ({
24
24
  iconPosition = 'before',
25
25
  spaceInline,
26
26
  tooltipMessage,
27
+ tooltipOnHide,
27
28
  xcss,
28
29
  asDropDownItem,
29
30
  overrideCss,
30
- isDisabled
31
+ isDisabled,
32
+ href,
33
+ ariaLabel,
34
+ wrapper: Wrapper
31
35
  }) => {
32
36
  if (!onClick) {
33
37
  return null;
@@ -54,7 +58,8 @@ const Action = ({
54
58
  size: size,
55
59
  testId: testId,
56
60
  tooltipMessage: tooltipMessage || content,
57
- xcss: xcss
61
+ xcss: xcss,
62
+ tooltipOnHide: tooltipOnHide
58
63
  });
59
64
  }
60
65
  if (isDropdownItem) {
@@ -67,7 +72,7 @@ const Action = ({
67
72
  testId: testId
68
73
  });
69
74
  }
70
- return jsx(ActionButton, {
75
+ const button = jsx(ActionButton, {
71
76
  appearance: appearance,
72
77
  content: content,
73
78
  iconAfter: iconAfter,
@@ -78,7 +83,10 @@ const Action = ({
78
83
  size: size,
79
84
  testId: testId,
80
85
  tooltipMessage: tooltipMessage || content,
81
- isDisabled: isDisabled
86
+ isDisabled: isDisabled,
87
+ href: href,
88
+ ariaLabel: ariaLabel
82
89
  });
90
+ return Wrapper !== undefined ? jsx(Wrapper, null, button) : button;
83
91
  };
84
92
  export default Action;
@@ -0,0 +1,53 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useCallback, useState } from 'react';
3
+ import Action from '../action';
4
+ import { messages } from '../../../../../messages';
5
+ import { FormattedMessage } from 'react-intl-next';
6
+ import LinkIcon from '@atlaskit/icon/glyph/link';
7
+ import { useFlexibleUiAnalyticsContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
8
+ import { ActionName } from '../../../../../constants';
9
+ import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
10
+ const CopyLinkAction = ({
11
+ onClick: onClickCallback,
12
+ ...props
13
+ }) => {
14
+ var _context$actions;
15
+ const context = useFlexibleUiContext();
16
+ const analytics = useFlexibleUiAnalyticsContext();
17
+ const invoke = useInvokeClientAction({
18
+ analytics
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];
21
+ const [tooltipMessage, setTooltipMessage] = useState(messages.copy_url_to_clipboard);
22
+ const onClick = useCallback(() => {
23
+ if (data && data.url) {
24
+ invoke({
25
+ actionType: ActionName.CopyLinkAction,
26
+ actionFn: async () => {
27
+ var _data$url;
28
+ await navigator.clipboard.writeText((_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : '');
29
+ setTooltipMessage(messages.copied_url_to_clipboard);
30
+ },
31
+ // These values have already been set in analytics context.
32
+ // We only pass these here for ufo experience.
33
+ display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
34
+ extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
35
+ });
36
+ }
37
+ if (onClickCallback) {
38
+ onClickCallback();
39
+ }
40
+ }, [analytics, data, invoke, onClickCallback]);
41
+ return data ? /*#__PURE__*/React.createElement(Action, _extends({
42
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_url_to_clipboard),
43
+ icon: /*#__PURE__*/React.createElement(LinkIcon, {
44
+ label: "copy url",
45
+ size: "medium"
46
+ }),
47
+ onClick: onClick,
48
+ testId: "smart-action-copy-link-action",
49
+ tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
50
+ tooltipOnHide: () => setTooltipMessage(messages.copy_url_to_clipboard)
51
+ }, data, props)) : null;
52
+ };
53
+ export default CopyLinkAction;
@@ -3,4 +3,5 @@ export { default as DeleteAction } from './delete-action';
3
3
  export { default as EditAction } from './edit-action';
4
4
  export { default as DownloadAction } from './download-action';
5
5
  export { default as FollowAction } from './follow-action';
6
- export { default as PreviewAction } from './preview-action';
6
+ export { default as PreviewAction } from './preview-action';
7
+ export { default as CopyLinkAction } from './copy-link-action';
@@ -14,7 +14,7 @@ const contentStyles = xcss({
14
14
  fontWeight: '400',
15
15
  lineHeight: '14px'
16
16
  });
17
- const MessageWithAnchor = ({
17
+ const FormattedErrorMessage = ({
18
18
  message,
19
19
  url
20
20
  }) => /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
@@ -31,6 +31,10 @@ const getErrorMesssageProps = error => {
31
31
  message: messages.ai_summary_error_acceptable_use_violation,
32
32
  url: CONTENT_URL_ACCEPTABLE_USE_POLICY
33
33
  };
34
+ case 'HIPAA_CONTENT_DETECTED':
35
+ return {
36
+ message: messages.ai_summary_error_hipaa_content_detected
37
+ };
34
38
  default:
35
39
  return {
36
40
  message: messages.ai_summary_error_generic,
@@ -61,7 +65,7 @@ const AIStateError = ({
61
65
  content: /*#__PURE__*/React.createElement(Box, {
62
66
  testId: `${testId}-error-message`,
63
67
  xcss: contentStyles
64
- }, /*#__PURE__*/React.createElement(MessageWithAnchor, {
68
+ }, /*#__PURE__*/React.createElement(FormattedErrorMessage, {
65
69
  message: message,
66
70
  url: url
67
71
  })),
@@ -0,0 +1,44 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { useEffect, useMemo, useRef } from 'react';
4
+ import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
5
+ import { getPulseStyles } from './styled';
6
+ const LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
7
+ const LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-ai-summarise';
8
+ const LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
9
+ const LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
10
+ const LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000;
11
+ /**
12
+ * This is a hacky solution to help with the feature discovery.
13
+ * This implementation must be removed once the experiment is completed.
14
+ * Cleanup on https://product-fabric.atlassian.net/browse/EDM-9649
15
+ */
16
+ const FeatureDiscovery = ({
17
+ children,
18
+ testId
19
+ }) => {
20
+ const renderedTime = useRef();
21
+ const storageClient = useMemo(() => new StorageClient(LOCAL_STORAGE_CLIENT_KEY), []);
22
+ const discovered = useMemo(() => storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE, [storageClient]);
23
+ useEffect(() => {
24
+ renderedTime.current = Date.now();
25
+ return () => {
26
+ if (!discovered && renderedTime.current) {
27
+ const duration = Date.now() - renderedTime.current;
28
+ if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
29
+ storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
30
+ }
31
+ }
32
+ };
33
+ }, [storageClient, discovered]);
34
+ const component = useMemo(() => {
35
+ if (!discovered) {
36
+ return jsx("span", {
37
+ css: getPulseStyles(),
38
+ "data-testid": `${testId}-discovery`
39
+ }, children);
40
+ }
41
+ }, [children, discovered, testId]);
42
+ return component !== null && component !== void 0 ? component : children;
43
+ };
44
+ export default FeatureDiscovery;
@@ -0,0 +1,15 @@
1
+ import { css, keyframes } from '@emotion/react';
2
+ export const getPulseStyles = () => {
3
+ const color = "var(--ds-border-discovery, #8270DB)";
4
+ const pulseKeyframes = keyframes({
5
+ to: {
6
+ boxShadow: '0 0 0 7px rgba(0, 0, 0, 0)'
7
+ }
8
+ });
9
+ return css({
10
+ display: 'inline-flex',
11
+ borderRadius: '3px',
12
+ boxShadow: `0 0 0 0 ${color}`,
13
+ animation: `${pulseKeyframes} 2s cubic-bezier(0.5, 0, 0, 1) 0.25s both 2`
14
+ });
15
+ };
@@ -19,6 +19,8 @@ import { useAnalyticsEvents } from '../../../../../../common/analytics/generated
19
19
  import AIEventSummaryViewed from '../ai-event-summary-viewed';
20
20
  import AIEventErrorViewed from '../ai-event-error-viewed';
21
21
  import { di } from 'react-magnetic-di';
22
+ import { css } from '@emotion/react';
23
+ import FeatureDiscovery from '../feature-discovery';
22
24
  export const AISummaryBlockErrorIndicator = ({
23
25
  showErrorIndicator,
24
26
  error,
@@ -109,7 +111,12 @@ const AISummaryBlockResolvedView = props => {
109
111
  testId: `${testId}-ai-summary-action`,
110
112
  icon: /*#__PURE__*/React.createElement(AIIcon, {
111
113
  label: "AIIcon"
112
- })
114
+ }),
115
+ /**
116
+ * Enabling feature discovery pulse
117
+ * Cleanup: https://product-fabric.atlassian.net/browse/EDM-9693
118
+ */
119
+ wrapper: FeatureDiscovery
113
120
  };
114
121
  return [aiAction, ...actions];
115
122
  }
@@ -125,6 +132,13 @@ const AISummaryBlockResolvedView = props => {
125
132
  return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
126
133
  direction: SmartLinkDirection.Vertical,
127
134
  testId: `${testId}-resolved-view`
135
+ /**
136
+ * Enabled for feature discovery to allow box shadow to overflow
137
+ * Cleanup: https://product-fabric.atlassian.net/browse/EDM-8681
138
+ */,
139
+ overrideCss: css({
140
+ overflow: 'visible'
141
+ }, props.overrideCss)
128
142
  }), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
129
143
  fromCache: isSummarisedOnMountRef.current
130
144
  }), /*#__PURE__*/React.createElement(AIMotionWrapper, {
@@ -3,7 +3,9 @@ import { useEffect } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { ElementName, SmartLinkDirection, SmartLinkSize } from '../../../../../constants';
5
5
  import { getBaseStyles, getGapSize, highlightRemoveStyles, renderChildren } from '../utils';
6
- const getBlockStyles = (direction, size) => css`
6
+ const getBlockStyles = (direction, size
7
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
8
+ ) => css`
7
9
  ${getBaseStyles(direction, size)}
8
10
  ${highlightRemoveStyles}
9
11
  justify-content: flex-start;
@@ -6,46 +6,46 @@ import { getMaxLineHeight, getTruncateStyles } from '../../utils';
6
6
  const getAlignmentStyles = align => {
7
7
  switch (align) {
8
8
  case SmartLinkAlignment.Right:
9
- return css`
10
- -webkit-box-align: end;
11
- -ms-flex-align: end;
12
- justify-content: flex-end;
13
- text-align: right;
14
- `;
9
+ return css({
10
+ WebkitBoxAlign: 'end',
11
+ MsFlexAlign: 'end',
12
+ justifyContent: 'flex-end',
13
+ textAlign: 'right'
14
+ });
15
15
  case SmartLinkAlignment.Left:
16
16
  default:
17
- return css`
18
- -webkit-box-align: start;
19
- -ms-flex-align: start;
20
- justify-content: flex-start;
21
- text-align: left;
22
- `;
17
+ return css({
18
+ WebkitBoxAlign: 'start',
19
+ MsFlexAlign: 'start',
20
+ justifyContent: 'flex-start',
21
+ textAlign: 'left'
22
+ });
23
23
  }
24
24
  };
25
25
  const getGapStyles = (size, align) => {
26
26
  const gap = getGapSize(size);
27
27
  if (align === SmartLinkAlignment.Right) {
28
- return css`
29
- > span {
30
- margin-left: ${gap}rem;
28
+ return css({
29
+ '> span': {
30
+ marginLeft: `${gap}rem`
31
+ },
32
+ '> span:first-child': {
33
+ marginLeft: 'initial'
31
34
  }
32
-
33
- > span:first-child {
34
- margin-left: initial;
35
- }
36
- `;
35
+ });
37
36
  }
38
- return css`
39
- > span {
40
- margin-right: ${gap}rem;
41
- &:last-child {
42
- margin-right: initial;
37
+ return css({
38
+ '> span': {
39
+ marginRight: `${gap}rem`,
40
+ '&:last-child': {
41
+ marginRight: 'initial'
43
42
  }
44
43
  }
45
- `;
44
+ });
46
45
  };
47
46
  const getHorizontalDirectionStyles = (size, align) => {
48
47
  const lineHeight = getMaxLineHeight(size);
48
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
49
49
  return css`
50
50
  display: block;
51
51
  vertical-align: middle;
@@ -64,14 +64,9 @@ const getHorizontalDirectionStyles = (size, align) => {
64
64
  ${getGapStyles(size, align)}
65
65
  `;
66
66
  };
67
- export const getElementGroupStyles = (direction, size, align, width, position) => css`
68
- ${getBaseStyles(direction, size)}
69
- ${getAlignmentStyles(align)}
70
- min-width: 10%;
71
- ${width === SmartLinkWidth.Flexible ? `flex: 1 3;` : ''}
72
- ${direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : ''}
73
- ${position === SmartLinkPosition.Top ? 'align-self: flex-start;' : ''}
74
- `;
67
+ export const getElementGroupStyles = (direction, size, align, width, position) => css(getBaseStyles(direction, size), getAlignmentStyles(align), {
68
+ minWidth: '10%'
69
+ }, width === SmartLinkWidth.Flexible ? `flex: 1 3;` : '', direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : '', position === SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
75
70
 
76
71
  /**
77
72
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
@@ -15,10 +15,9 @@ const getElementGroupStyles = (size, maxLines) => {
15
15
  // We need the height of the line to be equal on both left and right
16
16
  // sides so they line up nicely.
17
17
  const lineHeight = getMaxLineHeight(size);
18
- return css`
19
- line-height: ${lineHeight}rem;
20
- ${getTruncateStyles(maxLines, lineHeight + 'rem')}
21
- `;
18
+ return css({
19
+ lineHeight: `${lineHeight}rem`
20
+ }, getTruncateStyles(maxLines, lineHeight + 'rem'));
22
21
  };
23
22
  const getMaxLines = maxLines => {
24
23
  if (maxLines > MAXIMUM_MAX_LINES) {