@atlaskit/smart-card 18.0.21 → 19.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/cjs/client/index.js +6 -379
  3. package/dist/cjs/constants.js +4 -4
  4. package/dist/cjs/extractors/embed/index.js +2 -2
  5. package/dist/cjs/extractors/hover/extractMetadata.js +31 -0
  6. package/dist/cjs/index.js +7 -13
  7. package/dist/cjs/state/actions/constants.js +1 -13
  8. package/dist/cjs/state/actions/index.js +20 -22
  9. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +2 -2
  10. package/dist/cjs/state/config/index.js +2 -2
  11. package/dist/cjs/state/helpers.js +1 -9
  12. package/dist/cjs/state/hooks/usePrefetch.js +2 -2
  13. package/dist/cjs/state/index.js +4 -4
  14. package/dist/cjs/state/renderers/index.js +2 -2
  15. package/dist/cjs/state/store/index.js +5 -5
  16. package/dist/cjs/utils/mocks.js +2 -2
  17. package/dist/cjs/utils/test-utils.js +2 -2
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +2 -2
  20. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  21. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +3 -2
  22. package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
  23. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
  24. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
  25. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
  26. package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
  27. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
  28. package/dist/cjs/view/FlexibleCard/components/container/index.js +19 -6
  29. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +5 -0
  30. package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
  31. package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -2
  32. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +2 -2
  33. package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +2 -2
  34. package/dist/cjs/view/FlexibleCard/components/elements/index.js +2 -2
  35. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +3 -3
  36. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
  37. package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +2 -2
  38. package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +2 -2
  39. package/dist/cjs/view/HoverCard/index.js +11 -2
  40. package/dist/cjs/view/HoverCard/utils.js +36 -0
  41. package/dist/es2019/client/index.js +1 -214
  42. package/dist/es2019/constants.js +4 -4
  43. package/dist/es2019/extractors/embed/index.js +1 -1
  44. package/dist/es2019/extractors/hover/extractMetadata.js +18 -0
  45. package/dist/es2019/index.js +4 -4
  46. package/dist/es2019/state/actions/constants.js +0 -6
  47. package/dist/es2019/state/actions/index.js +4 -4
  48. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +1 -1
  49. package/dist/es2019/state/config/index.js +1 -1
  50. package/dist/es2019/state/helpers.js +0 -5
  51. package/dist/es2019/state/hooks/usePrefetch.js +1 -1
  52. package/dist/es2019/state/index.js +1 -1
  53. package/dist/es2019/state/renderers/index.js +1 -1
  54. package/dist/es2019/state/store/index.js +2 -2
  55. package/dist/es2019/utils/mocks.js +1 -1
  56. package/dist/es2019/utils/test-utils.js +1 -1
  57. package/dist/es2019/version.json +1 -1
  58. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +2 -2
  59. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  60. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -2
  61. package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
  62. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
  63. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
  64. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
  65. package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
  66. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
  67. package/dist/es2019/view/FlexibleCard/components/container/index.js +19 -6
  68. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +5 -0
  69. package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
  70. package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -2
  71. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +2 -2
  72. package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +2 -2
  73. package/dist/es2019/view/FlexibleCard/components/elements/index.js +2 -2
  74. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +3 -3
  75. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
  76. package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +2 -2
  77. package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +2 -2
  78. package/dist/es2019/view/HoverCard/index.js +27 -18
  79. package/dist/es2019/view/HoverCard/utils.js +27 -0
  80. package/dist/esm/client/index.js +1 -360
  81. package/dist/esm/constants.js +4 -4
  82. package/dist/esm/extractors/embed/index.js +1 -1
  83. package/dist/esm/extractors/hover/extractMetadata.js +22 -0
  84. package/dist/esm/index.js +4 -4
  85. package/dist/esm/state/actions/constants.js +0 -6
  86. package/dist/esm/state/actions/index.js +4 -4
  87. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +1 -1
  88. package/dist/esm/state/config/index.js +1 -1
  89. package/dist/esm/state/helpers.js +0 -5
  90. package/dist/esm/state/hooks/usePrefetch.js +1 -1
  91. package/dist/esm/state/index.js +1 -1
  92. package/dist/esm/state/renderers/index.js +1 -1
  93. package/dist/esm/state/store/index.js +2 -2
  94. package/dist/esm/utils/mocks.js +1 -1
  95. package/dist/esm/utils/test-utils.js +1 -1
  96. package/dist/esm/version.json +1 -1
  97. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +2 -2
  98. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  99. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -2
  100. package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
  101. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
  102. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
  103. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
  104. package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
  105. package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
  106. package/dist/esm/view/FlexibleCard/components/container/index.js +19 -6
  107. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +5 -0
  108. package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
  109. package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -2
  110. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +2 -2
  111. package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +2 -2
  112. package/dist/esm/view/FlexibleCard/components/elements/index.js +2 -2
  113. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +3 -3
  114. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
  115. package/dist/esm/view/FlexibleCard/components/elements/media/index.js +2 -2
  116. package/dist/esm/view/FlexibleCard/components/elements/text/index.js +2 -2
  117. package/dist/esm/view/HoverCard/index.js +10 -3
  118. package/dist/esm/view/HoverCard/utils.js +27 -0
  119. package/dist/types/__tests_external__/page-objects/BaseCard.d.ts +1 -2
  120. package/dist/types/client/index.d.ts +1 -18
  121. package/dist/types/constants.d.ts +4 -4
  122. package/dist/types/extractors/block/index.d.ts +1 -1
  123. package/dist/types/extractors/common/title-prefix/extractTitlePrefix.d.ts +1 -1
  124. package/dist/types/extractors/flexible/icon/extract-icon-renderer.d.ts +1 -1
  125. package/dist/types/extractors/flexible/icon/index.d.ts +1 -1
  126. package/dist/types/extractors/flexible/index.d.ts +1 -1
  127. package/dist/types/extractors/hover/extractMetadata.d.ts +3 -0
  128. package/dist/types/extractors/inline/index.d.ts +1 -1
  129. package/dist/types/index.d.ts +6 -6
  130. package/dist/types/model/invoke-opts.d.ts +1 -14
  131. package/dist/types/state/actions/constants.d.ts +0 -6
  132. package/dist/types/state/actions/types.d.ts +2 -13
  133. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -2
  134. package/dist/types/state/config/index.d.ts +1 -1
  135. package/dist/types/state/helpers.d.ts +1 -3
  136. package/dist/types/state/hooks/useSmartLink.d.ts +6 -6
  137. package/dist/types/state/index.d.ts +3 -3
  138. package/dist/types/state/reducers/types.d.ts +1 -1
  139. package/dist/types/state/renderers/index.d.ts +1 -1
  140. package/dist/types/state/store/index.d.ts +2 -2
  141. package/dist/types/state/types.d.ts +1 -1
  142. package/dist/types/types.d.ts +2 -2
  143. package/dist/types/utils/analytics/analytics.d.ts +1 -1
  144. package/dist/types/utils/analytics/index.d.ts +1 -2
  145. package/dist/types/utils/performance.d.ts +1 -1
  146. package/dist/types/view/BlockCard/types.d.ts +1 -1
  147. package/dist/types/view/Card/types.d.ts +2 -3
  148. package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +2 -2
  149. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +43 -0
  150. package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -0
  151. package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +25 -0
  152. package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +3 -2
  153. package/dist/types/view/FlexibleCard/components/blocks/element-group/index.d.ts +1 -0
  154. package/dist/types/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -0
  155. package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +8 -2
  156. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -0
  157. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/types.d.ts +22 -2
  158. package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -0
  159. package/dist/types/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -0
  160. package/dist/types/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +6 -2
  161. package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +2 -1
  162. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +63 -13
  163. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +68 -2
  164. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +5 -0
  165. package/dist/types/view/FlexibleCard/components/container/index.d.ts +5 -1
  166. package/dist/types/view/FlexibleCard/components/container/layered-link/index.d.ts +5 -0
  167. package/dist/types/view/FlexibleCard/components/container/types.d.ts +20 -10
  168. package/dist/types/view/FlexibleCard/components/elements/avatar-group/index.d.ts +2 -2
  169. package/dist/types/view/FlexibleCard/components/elements/avatar-group/types.d.ts +12 -0
  170. package/dist/types/view/FlexibleCard/components/elements/badge/index.d.ts +2 -2
  171. package/dist/types/view/FlexibleCard/components/elements/badge/types.d.ts +10 -0
  172. package/dist/types/view/FlexibleCard/components/elements/date-time/index.d.ts +2 -2
  173. package/dist/types/view/FlexibleCard/components/elements/date-time/types.d.ts +6 -0
  174. package/dist/types/view/FlexibleCard/components/elements/icon/index.d.ts +2 -2
  175. package/dist/types/view/FlexibleCard/components/elements/icon/types.d.ts +16 -3
  176. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +2 -2
  177. package/dist/types/view/FlexibleCard/components/elements/link/index.d.ts +3 -3
  178. package/dist/types/view/FlexibleCard/components/elements/link/types.d.ts +21 -1
  179. package/dist/types/view/FlexibleCard/components/elements/lozenge/index.d.ts +2 -2
  180. package/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +6 -0
  181. package/dist/types/view/FlexibleCard/components/elements/media/index.d.ts +2 -2
  182. package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +6 -0
  183. package/dist/types/view/FlexibleCard/components/elements/text/index.d.ts +2 -2
  184. package/dist/types/view/FlexibleCard/components/elements/text/types.d.ts +10 -0
  185. package/dist/types/view/FlexibleCard/components/elements/types.d.ts +11 -0
  186. package/dist/types/view/FlexibleCard/components/types.d.ts +1 -0
  187. package/dist/types/view/FlexibleCard/types.d.ts +73 -3
  188. package/dist/types/view/FlexibleCard/utils.d.ts +1 -1
  189. package/dist/types/view/HoverCard/types.d.ts +5 -0
  190. package/dist/types/view/HoverCard/utils.d.ts +2 -0
  191. package/dist/types/view/InlineCard/types.d.ts +1 -1
  192. package/docs-helpers/flexible-ui-action-item.tsx +6 -0
  193. package/docs-helpers/flexible-ui-actions-prop.tsx +6 -0
  194. package/docs-helpers/flexible-ui-element-item.tsx +6 -0
  195. package/docs-helpers/flexible-ui-prop.tsx +6 -0
  196. package/docs-helpers/flexible-ui.tsx +28 -0
  197. package/package.json +3 -9
  198. package/dist/cjs/client/api.js +0 -119
  199. package/dist/cjs/client/errors.js +0 -55
  200. package/dist/cjs/client/types/index.js +0 -5
  201. package/dist/cjs/client/types/requests.js +0 -5
  202. package/dist/cjs/client/types/responses.js +0 -31
  203. package/dist/cjs/client/utils/environments.js +0 -47
  204. package/dist/cjs/providers/editor/index.js +0 -283
  205. package/dist/cjs/providers/editor/transformer.js +0 -90
  206. package/dist/cjs/providers/editor/types.js +0 -5
  207. package/dist/cjs/state/actions/helpers.js +0 -18
  208. package/dist/cjs/state/context/index.js +0 -34
  209. package/dist/cjs/state/context/provider.js +0 -74
  210. package/dist/cjs/state/context/types.js +0 -5
  211. package/dist/cjs/state/reducers/index.js +0 -89
  212. package/dist/cjs/state/store/types.js +0 -5
  213. package/dist/es2019/client/api.js +0 -38
  214. package/dist/es2019/client/errors.js +0 -19
  215. package/dist/es2019/client/types/index.js +0 -1
  216. package/dist/es2019/client/types/requests.js +0 -1
  217. package/dist/es2019/client/types/responses.js +0 -19
  218. package/dist/es2019/client/utils/environments.js +0 -33
  219. package/dist/es2019/providers/editor/index.js +0 -82
  220. package/dist/es2019/providers/editor/transformer.js +0 -57
  221. package/dist/es2019/providers/editor/types.js +0 -1
  222. package/dist/es2019/state/actions/helpers.js +0 -8
  223. package/dist/es2019/state/context/index.js +0 -14
  224. package/dist/es2019/state/context/provider.js +0 -51
  225. package/dist/es2019/state/context/types.js +0 -1
  226. package/dist/es2019/state/reducers/index.js +0 -74
  227. package/dist/es2019/state/store/types.js +0 -1
  228. package/dist/esm/client/api.js +0 -98
  229. package/dist/esm/client/errors.js +0 -40
  230. package/dist/esm/client/types/index.js +0 -1
  231. package/dist/esm/client/types/requests.js +0 -1
  232. package/dist/esm/client/types/responses.js +0 -19
  233. package/dist/esm/client/utils/environments.js +0 -33
  234. package/dist/esm/providers/editor/index.js +0 -257
  235. package/dist/esm/providers/editor/transformer.js +0 -79
  236. package/dist/esm/providers/editor/types.js +0 -1
  237. package/dist/esm/state/actions/helpers.js +0 -9
  238. package/dist/esm/state/context/index.js +0 -14
  239. package/dist/esm/state/context/provider.js +0 -50
  240. package/dist/esm/state/context/types.js +0 -1
  241. package/dist/esm/state/reducers/index.js +0 -69
  242. package/dist/esm/state/store/types.js +0 -1
  243. package/dist/types/client/api.d.ts +0 -5
  244. package/dist/types/client/errors.d.ts +0 -9
  245. package/dist/types/client/types/index.d.ts +0 -13
  246. package/dist/types/client/types/requests.d.ts +0 -9
  247. package/dist/types/client/types/responses.d.ts +0 -19
  248. package/dist/types/client/utils/environments.d.ts +0 -12
  249. package/dist/types/providers/editor/index.d.ts +0 -22
  250. package/dist/types/providers/editor/transformer.d.ts +0 -8
  251. package/dist/types/providers/editor/types.d.ts +0 -19
  252. package/dist/types/state/actions/helpers.d.ts +0 -2
  253. package/dist/types/state/context/index.d.ts +0 -8
  254. package/dist/types/state/context/provider.d.ts +0 -5
  255. package/dist/types/state/context/types.d.ts +0 -39
  256. package/dist/types/state/reducers/index.d.ts +0 -4
  257. package/dist/types/state/store/types.d.ts +0 -18
@@ -1,13 +1,13 @@
1
1
  import { AnalyticsHandler } from '../../utils/types';
2
2
  export declare function useSmartLink(id: string, url: string, dispatchAnalytics: AnalyticsHandler): {
3
- state: import("../types").CardState;
3
+ state: import("@atlaskit/linking-common").CardState;
4
4
  actions: {
5
5
  register: () => Promise<void>;
6
6
  reload: () => void;
7
- authorize: (appearance: import("../..").CardAppearance) => void;
8
- invoke: (opts: import("../../model/invoke-opts").InvokeClientOpts | import("../../model/invoke-opts").InvokeServerOpts, appearance: import("../..").CardAppearance) => Promise<void | import("json-ld-types").JsonLd.Response<import("json-ld-types").JsonLd.Data.BaseData>>;
7
+ authorize: (appearance: import("@atlaskit/linking-common").CardAppearance) => void;
8
+ invoke: (opts: import("../../model/invoke-opts").InvokeClientOpts | import("../../model/invoke-opts").InvokeServerOpts, appearance: import("@atlaskit/linking-common").CardAppearance) => Promise<void | import("json-ld-types").JsonLd.Response<import("json-ld-types").JsonLd.Data.BaseData>>;
9
9
  };
10
- config: (import("../context/types").CardProviderCacheOpts & import("../context/types").CardAuthFlowOpts) | undefined;
10
+ config: (import("@atlaskit/link-provider").CardProviderCacheOpts & import("@atlaskit/link-provider").CardAuthFlowOpts) | undefined;
11
11
  analytics: {
12
12
  ui: {
13
13
  authEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
@@ -27,7 +27,7 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
27
27
  invokeFailedEvent: (id: string, providerKey: string, actionType: string, display: import("../../view/Card/types").CardInnerAppearance, reason: string) => void;
28
28
  connectSucceededEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
29
29
  connectFailedEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined, status?: string | undefined) => void;
30
- instrument: (id: string, status: import("../store").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: import("../..").APIError | undefined) => void;
30
+ instrument: (id: string, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: import("@atlaskit/linking-common").APIError | undefined) => void;
31
31
  };
32
32
  track: {
33
33
  appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
@@ -36,6 +36,6 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
36
36
  authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
37
37
  };
38
38
  };
39
- renderers: import("../context/types").CardProviderRenderers | undefined;
39
+ renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
40
40
  error: Error | null;
41
41
  };
@@ -1,4 +1,4 @@
1
- export { SmartCardContext, SmartCardProvider, useSmartLinkContext, } from './context';
2
- export type { CardContext, ProviderProps } from './context';
1
+ export { SmartCardContext, SmartCardProvider, useSmartLinkContext, } from '@atlaskit/link-provider';
2
+ export type { CardContext, ProviderProps } from '@atlaskit/link-provider';
3
+ export type { CardType } from '@atlaskit/linking-common';
3
4
  export { useSmartLink, usePrefetch } from './hooks';
4
- export type { CardType } from './store/types';
@@ -1,4 +1,4 @@
1
- import { CardAction, CardActionType } from '../actions/types';
2
1
  import { Reducer } from 'react';
2
+ import { CardAction, CardActionType } from '@atlaskit/linking-common';
3
3
  export declare type CardReducerMap<StateType, ActionType> = Record<CardActionType, CardReducer<StateType, ActionType>>;
4
4
  export declare type CardReducer<StateType, ActionType> = Reducer<StateType, CardAction<ActionType>>;
@@ -1,2 +1,2 @@
1
- import { CardContext } from '../context';
1
+ import { CardContext } from '@atlaskit/link-provider';
2
2
  export declare const useSmartLinkRenderers: () => CardContext['renderers'] | undefined;
@@ -1,3 +1,3 @@
1
- import { CardState } from './types';
1
+ import { CardState } from '@atlaskit/linking-common';
2
+ export type { CardType } from '@atlaskit/linking-common';
2
3
  export declare function useSmartCardState(url: string): CardState;
3
- export type { CardType } from './types';
@@ -1 +1 @@
1
- export type { CardStore, CardState } from './store/types';
1
+ export type { CardStore, CardState } from '@atlaskit/linking-common';
@@ -1,11 +1,11 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
+ import { RequestAccessMessageKey } from '@atlaskit/media-ui/messages';
3
+ export type { CardContext } from '@atlaskit/link-provider';
2
4
  import { AccessContext } from './view/types';
3
5
  import { ActionProps } from './view/BlockCard/components/Action';
4
- import { RequestAccessMessageKey } from '@atlaskit/media-ui/messages';
5
6
  export declare type ResolveResponse = JsonLd.Response;
6
7
  export type { ProviderProps, CardType } from './state';
7
8
  export type { CardProps, CardAppearance, CardPlatform, } from './view/Card/types';
8
- export type { CardContext } from './state/context/types';
9
9
  export interface RequestAccessContextProps extends AccessContext {
10
10
  action?: ActionProps;
11
11
  callToActionMessageKey?: RequestAccessMessageKey;
@@ -1,9 +1,9 @@
1
1
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import { APIError } from '@atlaskit/linking-common';
2
3
  import { AnalyticsPayload } from '../types';
3
4
  import { ErrorInfo } from 'react';
4
5
  import { CardInnerAppearance } from '../../view/Card/types';
5
6
  import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
6
- import { APIError } from '../../client/errors';
7
7
  export declare const ANALYTICS_CHANNEL = "media";
8
8
  export declare const context: {
9
9
  componentName: string;
@@ -1,5 +1,4 @@
1
- import { CardType } from '../../state/store/types';
2
- import { APIError } from '../../client/errors';
1
+ import { APIError, CardType } from '@atlaskit/linking-common';
3
2
  import { AnalyticsPayload } from '../types';
4
3
  export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, } from './analytics';
5
4
  export declare const instrumentEvent: (id: string, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => AnalyticsPayload | undefined;
@@ -1,4 +1,4 @@
1
- import { CardType } from '../state/store/types';
1
+ import { CardType } from '@atlaskit/linking-common';
2
2
  export declare const getMarkName: (id: string, status: CardType) => string;
3
3
  export declare const getMeasureName: (id: string, status: CardType) => string;
4
4
  export declare const clearMarks: (id: string) => void;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import { CardProviderRenderers, CardAuthFlowOpts } from '@atlaskit/link-provider';
2
3
  import { CardState } from '../../state/types';
3
4
  import { InvokeHandler } from '../../model/invoke-handler';
4
- import { CardAuthFlowOpts, CardProviderRenderers } from '../../state/context/types';
5
5
  import { AnalyticsHandler } from '../../utils/types';
6
6
  import { OnResolveCallback, CardPlatform } from '../Card/types';
7
7
  export declare type BlockCardProps = {
@@ -1,11 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { JsonLd } from 'json-ld-types';
3
+ import { CardAppearance, CardPlatform } from '@atlaskit/linking-common';
4
4
  import { FlexibleUiOptions } from '../FlexibleCard/types';
5
5
  import { InlinePreloaderStyle } from '../types';
6
- export declare type CardAppearance = 'inline' | 'block' | 'embed';
6
+ export type { CardAppearance, CardPlatform };
7
7
  export declare type CardInnerAppearance = CardAppearance | 'preview' | 'flexible';
8
- export declare type CardPlatform = JsonLd.Primitives.Platforms;
9
8
  export declare type OnResolveCallback = (data: {
10
9
  url?: string;
11
10
  title?: string;
@@ -5,8 +5,8 @@ import { SmartLinkSize } from '../../../../../constants';
5
5
  import { ActionProps } from './types';
6
6
  export declare const sizeToSpacing: Record<SmartLinkSize, Spacing>;
7
7
  /**
8
- * An action that can be triggered with an on click.
9
- * @public
8
+ * A base action that can be triggered with an on click.
9
+ * @internal
10
10
  * @param {ActionProps} ActionProps - The props necessary for the Action.
11
11
  * @see DeleteAction
12
12
  * @see EditAction
@@ -3,19 +3,62 @@ import { SmartLinkSize } from '../../../../../constants';
3
3
  import { Appearance } from '@atlaskit/button/types';
4
4
  import { ReactChild } from 'react';
5
5
  export declare type ActionProps = {
6
+ /**
7
+ * Determines the size of the Action. Corresponds to an Action appearance.
8
+ */
6
9
  size?: SmartLinkSize;
10
+ /**
11
+ * Determines the text content of the Action.
12
+ */
7
13
  content?: React.ReactNode;
14
+ /**
15
+ * Determines the appearance of the action. Corresponds to the Atlaskit action appearance.
16
+ */
8
17
  appearance?: Appearance;
18
+ /**
19
+ * Determines the onClick behaviour of the Action.
20
+ */
9
21
  onClick: () => any;
22
+ /**
23
+ * Determines the icon rendered within the Action.
24
+ */
10
25
  icon?: ReactChild;
26
+ /**
27
+ * Determines where the icon should be rendered if text is provided.
28
+ */
11
29
  iconPosition?: 'before' | 'after';
30
+ /**
31
+ * Determines the tooltip message when hovering over the Action.
32
+ */
12
33
  tooltipMessage?: React.ReactNode;
34
+ /**
35
+ * Used to determine whether the Action is in a Dropdown.
36
+ */
13
37
  asDropDownItem?: boolean;
38
+ /**
39
+ * Additional CSS properties on the Action.
40
+ */
14
41
  overrideCss?: SerializedStyles;
42
+ /**
43
+ * A `testId` prop is provided for specified elements, which is a unique
44
+ * string that appears as a data attribute `data-testid` in the rendered code,
45
+ * serving as a hook for automated tests
46
+ */
15
47
  testId?: string;
16
48
  };
17
49
  export declare type ActionIconProps = {
50
+ /**
51
+ * Determines the size of the Icon within the Action.
52
+ */
18
53
  size?: SmartLinkSize;
54
+ /**
55
+ * Determines the icon within the Action.
56
+ */
19
57
  icon?: ReactChild;
58
+ /**
59
+ * A `testId` prop is provided for specified elements, which is a unique
60
+ * string that appears as a data attribute `data-testid` in the rendered code,
61
+ * serving as a hook for automated tests
62
+ */
20
63
  testId?: string;
21
64
  };
@@ -3,6 +3,7 @@ import { ActionGroupProps } from './types';
3
3
  /**
4
4
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
5
5
  * preferences.
6
+ * @internal
6
7
  * @param {ActionGroupProps} ActionGroupProps
7
8
  * @see Action
8
9
  */
@@ -2,11 +2,36 @@ import { SmartLinkSize, SmartLinkDirection } from '../../../../../constants';
2
2
  import { ActionItem } from '../types';
3
3
  import { Appearance } from '@atlaskit/button';
4
4
  export declare type ActionGroupProps = {
5
+ /**
6
+ * Determines the actions within the Action Group.
7
+ */
5
8
  items: ActionItem[];
9
+ /**
10
+ * Determines the default size of the actions within the Action Group.
11
+ */
6
12
  size?: SmartLinkSize;
13
+ /**
14
+ * Determines the direction that the actions are rendered. Can be vertical
15
+ * or horizontal.
16
+ */
7
17
  direction?: SmartLinkDirection;
18
+ /**
19
+ * Determines the default appearance of the Action Group.
20
+ */
8
21
  appearance?: Appearance;
22
+ /**
23
+ * Determines the maximum number of singular actions that should be rendered
24
+ * before collapsing all actions into a Dropdown.
25
+ */
9
26
  visibleButtonsNum?: number;
27
+ /**
28
+ * Callback used by the dropdown. Is called when the dropdown is opened.
29
+ */
10
30
  onDropdownOpenChange?: (isOpen: boolean) => void;
31
+ /**
32
+ * A `testId` prop is provided for specified elements, which is a unique
33
+ * string that appears as a data attribute `data-testid` in the rendered code,
34
+ * serving as a hook for automated tests
35
+ */
11
36
  testId?: string;
12
37
  };
@@ -2,8 +2,9 @@
2
2
  import React from 'react';
3
3
  import { BlockProps } from '../types';
4
4
  /**
5
- * A block represents a collection of elements and actions that are arranged in a row.
6
- * All elements and actions should be contained within a Block.
5
+ * A block represents a collection of elements and actions that are arranged
6
+ * in a row. All elements and actions should be contained within a Block.
7
+ * @internal
7
8
  * @param {ActionGroupProps} ActionGroupProps
8
9
  * @see Action
9
10
  */
@@ -7,6 +7,7 @@ export declare const getElementGroupStyles: (direction: SmartLinkDirection, size
7
7
  /**
8
8
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
9
9
  * preferences.
10
+ * @internal
10
11
  * @param {ActionGroupProps} ActionGroupProps
11
12
  * @see Action
12
13
  */
@@ -3,6 +3,7 @@ import { FooterBlockProps } from './types';
3
3
  /**
4
4
  * Represents a FooterBlock, designed to contain elements and actions that should appear
5
5
  * at the bottom of a link card.
6
+ * @public
6
7
  * @param {FooterBlockProps} FooterBlockProps
7
8
  * @see Block
8
9
  */
@@ -1,4 +1,10 @@
1
1
  import { ActionItem, BlockProps } from '../types';
2
- export declare type FooterBlockProps = BlockProps & {
2
+ export declare type FooterBlockProps = {
3
+ /**
4
+ * An array of actions to be displayed on the right.
5
+ * Adding more than three actions will result in the second and following
6
+ * actions being hidden inside of a dropdown
7
+ * @see ActionItem
8
+ */
3
9
  actions?: ActionItem[];
4
- };
10
+ } & BlockProps;
@@ -3,6 +3,7 @@ import { MetadataBlockProps } from './types';
3
3
  /**
4
4
  * Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
5
5
  * Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
6
+ * @public
6
7
  * @param {MetadataBlockProps} MetadataBlockProps
7
8
  * @see Block
8
9
  */
@@ -1,6 +1,26 @@
1
1
  import { BlockProps, ElementItem } from '../types';
2
- export declare type MetadataBlockProps = BlockProps & {
2
+ export declare type MetadataBlockProps = {
3
+ /**
4
+ * Determines the number of lines the metadata should span across.
5
+ * Default is 2. Maximum is 2.
6
+ */
3
7
  maxLines?: number;
8
+ /**
9
+ * An array of metadata elements to display on the left.
10
+ * By default elements will be shown to the right of the TitleBlock.
11
+ * The visibility of the element is determine by the link data.
12
+ * If link contain no data to display a particular element, the element
13
+ * will simply not show up.
14
+ * @see ElementItem
15
+ */
4
16
  primary?: ElementItem[];
17
+ /**
18
+ * An array of metadata elements to display on the right.
19
+ * By default elements will be shown to the right of the TitleBlock.
20
+ * The visibility of the element is determine by the link data.
21
+ * If link contain no data to display a particular element, the element
22
+ * will simply not show up.
23
+ * @see ElementItem
24
+ */
5
25
  secondary?: ElementItem[];
6
- };
26
+ } & BlockProps;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { PreviewBlockProps } from './types';
3
3
  /**
4
4
  * Represents a PreviewBlock, which typically contains media or other large format content.
5
+ * @public
5
6
  * @param {PreviewBlock} PreviewBlock
6
7
  * @see Block
7
8
  */
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { SnippetBlockProps } from './types';
3
3
  /**
4
4
  * Represents a SnippetBlock, which is used to display longer form text content, like descriptions.
5
+ * @public
5
6
  * @param {SnippetBlock} SnippetBlock
6
7
  * @see Block
7
8
  */
@@ -1,4 +1,8 @@
1
1
  import { BlockProps } from '../types';
2
- export declare type SnippetBlockProps = BlockProps & {
2
+ export declare type SnippetBlockProps = {
3
+ /**
4
+ * Determines the maximum lines the text within the snippet block should
5
+ * spread over. Default is 3. Maximum is 3.
6
+ */
3
7
  maxLines?: number;
4
- };
8
+ } & BlockProps;
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { TitleBlockProps } from './types';
3
3
  /**
4
- * Represents a TitleBlock, which is the foundation of all Flexible Smart Links.
4
+ * Represents a TitleBlock, which is the foundation of Flexible UI.
5
5
  * This contains an icon, the link, and any associated metadata and actions in one block.
6
6
  * The TitleBlock will also render differently given the state of the smart link.
7
7
  * This can be found in the corresponding Resolving, Resolved and Errored views.
8
+ * @public
8
9
  * @param {TitleBlockProps} TitleBlockProps
9
10
  * @see Block
10
11
  * @see TitleBlockResolvingView
@@ -1,26 +1,76 @@
1
1
  import React from 'react';
2
- import { BlockProps, ElementItem, ActionItem } from '../types';
2
+ import { ActionItem, BlockProps, ElementItem } from '../types';
3
3
  import { SmartLinkPosition, SmartLinkTheme } from '../../../../../constants';
4
4
  import { RetryOptions } from '../../../types';
5
- import { LinkProps } from '../../elements/link/types';
6
- export declare type TitleBlockProps = BlockProps & {
5
+ import { AnchorTarget } from '../../types';
6
+ export declare type TitleBlockProps = {
7
+ /**
8
+ * An array of action items to be displayed after the title
9
+ * on the right of the block.
10
+ * An action item provides preset icon and label, with exception of
11
+ * a custom action which either Icon or label must be provided.
12
+ * @see ActionItem
13
+ */
14
+ actions?: ActionItem[];
15
+ /**
16
+ * Determines the href target behaviour of the Link.
17
+ */
18
+ anchorTarget?: AnchorTarget;
19
+ /**
20
+ * Determines the maximum number of lines for the underlying link text to
21
+ * spread over. Default is 2. Maximum is 2.
22
+ */
7
23
  maxLines?: number;
24
+ /**
25
+ * An array of metadata elements to display in the TitleBlock.
26
+ * By default elements will be shown to the right of the TitleBlock.
27
+ * The visibility of the element is determine by the link data.
28
+ * If link contain no data to display a particular element, the element
29
+ * will simply not show up.
30
+ * @see ElementItem
31
+ */
8
32
  metadata?: ElementItem[];
9
- /** Determines the position of the icon in the TitleBlock.
10
- * Top: Icon will be rendered in the "top" left of the TitleBlock
11
- * Center: Icon will be rendered "center" relative to the vertical height of the TitleBlock.
12
- * If direction is Horizontal, icon will be rendered in the center relative to the horizontal width of the TitleBlock.
33
+ /**
34
+ * Determines the position of the link icon in relative to the vertical
35
+ * height of the TitleBlock. It can either be centred or placed on “top”.
36
+ * Default is top.
13
37
  */
14
38
  position?: SmartLinkPosition;
39
+ /**
40
+ * Determines the onClick behaviour of the Link. By default used for analytics.
41
+ * @internal
42
+ */
43
+ onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
44
+ /**
45
+ * The options that determine the retry behaviour when a Smart Link errors.
46
+ * @internal
47
+ */
15
48
  retry?: RetryOptions;
49
+ /**
50
+ * Determines whether TitleBlock will hide actions until the user is hovering
51
+ * over the link.
52
+ */
53
+ showActionOnHover?: boolean;
54
+ /**
55
+ * An array of metadata elements to display in the TitleBlock.
56
+ * By default elements will be shown below the link text.
57
+ * The visibility of the element is determine by the link data.
58
+ * If link contain no data to display a particular element, the element
59
+ * will simply not show up.
60
+ * @see ElementItem
61
+ */
16
62
  subtitle?: ElementItem[];
17
- actions?: ActionItem[];
18
- theme?: SmartLinkTheme;
63
+ /**
64
+ * The text to display in the link. Overrides any text that is retrieved from
65
+ * the Smart Link.
66
+ */
19
67
  text?: string;
20
- showActionOnHover?: boolean;
21
- onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
22
- anchorTarget?: LinkProps['target'];
23
- };
68
+ /**
69
+ * The theme of the link text. Can be Black or Link (default URL blue)
70
+ * @internal
71
+ */
72
+ theme?: SmartLinkTheme;
73
+ } & BlockProps;
24
74
  export declare type TitleBlockViewProps = TitleBlockProps & {
25
75
  actionGroup?: React.ReactNode;
26
76
  title: React.ReactNode;
@@ -2,28 +2,94 @@ import { ActionName, ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkSt
2
2
  import { SerializedStyles } from '@emotion/core';
3
3
  import { ActionProps } from '../actions/action/types';
4
4
  export declare type BlockProps = {
5
+ /**
6
+ * The direction that the block should arrange it's elements. Can be vertical
7
+ * or horizontal. Default is horizontal.
8
+ * @internal
9
+ */
5
10
  direction?: SmartLinkDirection;
11
+ /**
12
+ * Any additional CSS properties to apply to the block.
13
+ */
6
14
  overrideCss?: SerializedStyles;
15
+ /**
16
+ * The size of the block and the size that the underlying elements should
17
+ * default to.
18
+ */
7
19
  size?: SmartLinkSize;
20
+ /**
21
+ * The status of the Smart Link. Used to conditionally render different blocks
22
+ * when Smart Link is in different states.
23
+ * @internal
24
+ */
8
25
  status?: SmartLinkStatus;
26
+ /**
27
+ * A `testId` prop is provided for specified elements, which is a unique
28
+ * string that appears as a data attribute `data-testid` in the rendered code,
29
+ * serving as a hook for automated tests
30
+ */
9
31
  testId?: string;
10
32
  };
33
+ /**
34
+ * Used to represent a metadata element to be rendered.
35
+ */
11
36
  export declare type ElementItem = {
12
- name: ElementName;
37
+ /**
38
+ * The name of the metadata element, used by Flexible UI to determine which
39
+ * element to render.
40
+ */
41
+ name: ElementName.AuthorGroup | ElementName.CollaboratorGroup | ElementName.CommentCount | ElementName.CreatedBy | ElementName.CreatedOn | ElementName.ModifiedBy | ElementName.ModifiedOn | ElementName.Priority | ElementName.ProgrammingLanguage | ElementName.Provider | ElementName.ReactCount | ElementName.State | ElementName.SubscriberCount | ElementName.ViewCount | ElementName.VoteCount;
42
+ /**
43
+ * The size of the element to render.
44
+ */
13
45
  size?: SmartLinkSize;
46
+ /**
47
+ * A `testId` prop is provided for specified elements, which is a unique
48
+ * string that appears as a data attribute `data-testid` in the rendered code,
49
+ * serving as a hook for automated tests
50
+ */
14
51
  testId?: string;
15
52
  };
53
+ /**
54
+ * Used to represent an Action when passing props into Flexible UI.
55
+ */
16
56
  export declare type BaseActionItem = {
57
+ /**
58
+ * Determines whether the action should hide the text content of the button.
59
+ */
17
60
  hideContent?: boolean;
61
+ /**
62
+ * Determines whether the action should hide the icon inside the button.
63
+ */
18
64
  hideIcon?: boolean;
65
+ /**
66
+ * Determines the text and icon representation of the action, with exception
67
+ * to CustomAction.
68
+ */
69
+ name: ActionName;
70
+ /**
71
+ * Determines the onClick behaviour of the action.
72
+ */
19
73
  onClick: () => any;
74
+ /**
75
+ * Additional CSS properties on the Action.
76
+ */
20
77
  overrideCss?: SerializedStyles;
78
+ /**
79
+ * Determines the size of the Action. Corresponds to an Action appearance.
80
+ */
21
81
  size?: SmartLinkSize;
82
+ /**
83
+ * A `testId` prop is provided for specified elements, which is a unique
84
+ * string that appears as a data attribute `data-testid` in the rendered code,
85
+ * serving as a hook for automated tests
86
+ */
22
87
  testId?: string;
23
88
  };
24
89
  /**
25
90
  * This represents an action where Icon and Content are provided implicitly.
26
- * @example DeleteAction - by default will contain a cross icon with the 'delete' content if content and icon are not provided.
91
+ * @example DeleteAction - by default will contain a cross icon with the
92
+ * 'delete' content if content and icon are not provided.
27
93
  */
28
94
  export declare type NamedActionItem = BaseActionItem & {
29
95
  name: Exclude<ActionName, ActionName.CustomAction>;
@@ -1,3 +1,8 @@
1
1
  export declare type LoadingSkeletonProps = {
2
+ /**
3
+ * A `testId` prop is provided for specified elements, which is a unique
4
+ * string that appears as a data attribute `data-testid` in the rendered
5
+ * code, serving as a hook for automated tests
6
+ */
2
7
  testId?: string;
3
8
  };
@@ -5,7 +5,11 @@ import { SmartLinkSize } from '../../../../constants';
5
5
  import { ContainerProps } from './types';
6
6
  export declare const getContainerStyles: (size: SmartLinkSize, hideBackground: boolean, hideElevation: boolean, hidePadding: boolean, clickableContainer: boolean) => SerializedStyles;
7
7
  /**
8
- * This represents the container in which all Flexible UI Smart Links are rendered.
8
+ * A container is a hidden component that build the Flexible Smart Link.
9
+ * All of the Flexible UI components are wrapped inside the container.
10
+ * It inherits the ui props from Card component and applies the custom styling
11
+ * accordingly.
12
+ * @internal
9
13
  * @see Block
10
14
  */
11
15
  declare const Container: React.FC<ContainerProps>;
@@ -1,5 +1,10 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { LayeredLinkProps } from './types';
4
+ /**
5
+ * An anchor component to cover the entire container creating a clickable area.
6
+ * @internal
7
+ * @see `clickableContainer`
8
+ */
4
9
  declare const LayeredLink: React.FC<LayeredLinkProps>;
5
10
  export default LayeredLink;