@atlaskit/smart-card 26.7.0 → 26.8.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0b148ef0a04`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0b148ef0a04) - [ux] Updated fade in delay for hover card to be 500ms
8
+
9
+ ## 26.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`a1b70608039`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a1b70608039) - [ux] Adds editor toolbar to link datasource component
14
+
3
15
  ## 26.7.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.7.0",
3
+ "version": "26.8.1",
4
4
  "sideEffects": false
5
5
  }
@@ -25,6 +25,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
25
25
  /** @jsx jsx */
26
26
 
27
27
  var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
28
+ var FADE_IN_DELAY = 500;
29
+ var FADE_OUT_DELAY = 300;
30
+ var RESOLVE_DELAY = 100;
28
31
  var HoverCardComponent = function HoverCardComponent(_ref) {
29
32
  var children = _ref.children,
30
33
  url = _ref.url,
@@ -39,8 +42,6 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
39
42
  hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto,
40
43
  _ref$showServerAction = _ref.showServerActions,
41
44
  showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction;
42
- var delay = 300;
43
- var resolveDelay = 100;
44
45
  var _React$useState = _react2.default.useState(false),
45
46
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
46
47
  isOpen = _React$useState2[0],
@@ -83,7 +84,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
83
84
  }
84
85
  fadeOutTimeoutId.current = setTimeout(function () {
85
86
  return hideCard();
86
- }, delay);
87
+ }, FADE_OUT_DELAY);
87
88
  }, [hideCard]);
88
89
 
89
90
  // clearing out the timeouts in order to avoid memory leaks
@@ -116,7 +117,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
116
117
  if (!resolveTimeOutId.current && isLinkUnresolved) {
117
118
  resolveTimeOutId.current = setTimeout(function () {
118
119
  loadMetadata();
119
- }, resolveDelay);
120
+ }, RESOLVE_DELAY);
120
121
  }
121
122
  }, [linkState, loadMetadata]);
122
123
  var initShowCard = (0, _react2.useCallback)(function (event) {
@@ -141,7 +142,7 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
141
142
  popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + _styled.CARD_GAP_PX];
142
143
  }
143
144
  setIsOpen(true);
144
- }, delay);
145
+ }, FADE_IN_DELAY);
145
146
  }
146
147
  }, [initResolve, isOpen, setMousePosition]);
147
148
  var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.7.0",
3
+ "version": "26.8.1",
4
4
  "sideEffects": false
5
5
  }
@@ -13,6 +13,9 @@ import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAna
13
13
  import { useSmartCardActions } from '../../../state/actions';
14
14
  import { useSmartLinkAnalytics } from '../../../state/analytics';
15
15
  const HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
16
+ const FADE_IN_DELAY = 500;
17
+ const FADE_OUT_DELAY = 300;
18
+ const RESOLVE_DELAY = 100;
16
19
  export const HoverCardComponent = ({
17
20
  children,
18
21
  url,
@@ -23,8 +26,6 @@ export const HoverCardComponent = ({
23
26
  hidePreviewButton = false,
24
27
  showServerActions = false
25
28
  }) => {
26
- const delay = 300;
27
- const resolveDelay = 100;
28
29
  const [isOpen, setIsOpen] = React.useState(false);
29
30
  const fadeOutTimeoutId = useRef();
30
31
  const fadeInTimeoutId = useRef();
@@ -63,7 +64,7 @@ export const HoverCardComponent = ({
63
64
  // we want to clear out the reference to signify that there's no in-progress resolve event
64
65
  resolveTimeOutId.current = undefined;
65
66
  }
66
- fadeOutTimeoutId.current = setTimeout(() => hideCard(), delay);
67
+ fadeOutTimeoutId.current = setTimeout(() => hideCard(), FADE_OUT_DELAY);
67
68
  }, [hideCard]);
68
69
 
69
70
  // clearing out the timeouts in order to avoid memory leaks
@@ -96,7 +97,7 @@ export const HoverCardComponent = ({
96
97
  if (!resolveTimeOutId.current && isLinkUnresolved) {
97
98
  resolveTimeOutId.current = setTimeout(() => {
98
99
  loadMetadata();
99
- }, resolveDelay);
100
+ }, RESOLVE_DELAY);
100
101
  }
101
102
  }, [linkState, loadMetadata]);
102
103
  const initShowCard = useCallback(event => {
@@ -122,7 +123,7 @@ export const HoverCardComponent = ({
122
123
  popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
123
124
  }
124
125
  setIsOpen(true);
125
- }, delay);
126
+ }, FADE_IN_DELAY);
126
127
  }
127
128
  }, [initResolve, isOpen, setMousePosition]);
128
129
  const linkActions = useSmartLinkActions({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.7.0",
3
+ "version": "26.8.1",
4
4
  "sideEffects": false
5
5
  }
@@ -14,6 +14,9 @@ import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAna
14
14
  import { useSmartCardActions } from '../../../state/actions';
15
15
  import { useSmartLinkAnalytics } from '../../../state/analytics';
16
16
  var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
17
+ var FADE_IN_DELAY = 500;
18
+ var FADE_OUT_DELAY = 300;
19
+ var RESOLVE_DELAY = 100;
17
20
  export var HoverCardComponent = function HoverCardComponent(_ref) {
18
21
  var children = _ref.children,
19
22
  url = _ref.url,
@@ -28,8 +31,6 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
28
31
  hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto,
29
32
  _ref$showServerAction = _ref.showServerActions,
30
33
  showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction;
31
- var delay = 300;
32
- var resolveDelay = 100;
33
34
  var _React$useState = React.useState(false),
34
35
  _React$useState2 = _slicedToArray(_React$useState, 2),
35
36
  isOpen = _React$useState2[0],
@@ -72,7 +73,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
72
73
  }
73
74
  fadeOutTimeoutId.current = setTimeout(function () {
74
75
  return hideCard();
75
- }, delay);
76
+ }, FADE_OUT_DELAY);
76
77
  }, [hideCard]);
77
78
 
78
79
  // clearing out the timeouts in order to avoid memory leaks
@@ -105,7 +106,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
105
106
  if (!resolveTimeOutId.current && isLinkUnresolved) {
106
107
  resolveTimeOutId.current = setTimeout(function () {
107
108
  loadMetadata();
108
- }, resolveDelay);
109
+ }, RESOLVE_DELAY);
109
110
  }
110
111
  }, [linkState, loadMetadata]);
111
112
  var initShowCard = useCallback(function (event) {
@@ -130,7 +131,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
130
131
  popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
131
132
  }
132
133
  setIsOpen(true);
133
- }, delay);
134
+ }, FADE_IN_DELAY);
134
135
  }
135
136
  }, [initResolve, isOpen, setMousePosition]);
136
137
  var linkActions = useSmartLinkActions({
@@ -2,7 +2,7 @@ import { JsonLd } from 'json-ld-types';
2
2
  export type ResolveResponse = JsonLd.Response;
3
3
  export { SmartCardProvider as Provider, SmartCardContext, useSmartLinkAnalytics, } from './state';
4
4
  export type { ProviderProps, CardType } from './state';
5
- export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, DatasourceAdf, } from '@atlaskit/linking-common';
5
+ export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, DatasourceAdf, DatasourceAdfView, } from '@atlaskit/linking-common';
6
6
  export { APIError } from '@atlaskit/linking-common';
7
7
  export { CardClient as Client } from '@atlaskit/link-provider';
8
8
  export { Card } from './view/Card';
@@ -2,7 +2,7 @@ import { JsonLd } from 'json-ld-types';
2
2
  export type ResolveResponse = JsonLd.Response;
3
3
  export { SmartCardProvider as Provider, SmartCardContext, useSmartLinkAnalytics, } from './state';
4
4
  export type { ProviderProps, CardType } from './state';
5
- export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, DatasourceAdf, } from '@atlaskit/linking-common';
5
+ export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, DatasourceAdf, DatasourceAdfView, } from '@atlaskit/linking-common';
6
6
  export { APIError } from '@atlaskit/linking-common';
7
7
  export { CardClient as Client } from '@atlaskit/link-provider';
8
8
  export { Card } from './view/Card';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.7.0",
3
+ "version": "26.8.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/link-analytics": "^8.1.0",
46
46
  "@atlaskit/link-client-extension": "^1.5.0",
47
47
  "@atlaskit/linking-common": "^3.1.0",
48
- "@atlaskit/linking-types": "^8.0.0",
48
+ "@atlaskit/linking-types": "^8.1.0",
49
49
  "@atlaskit/logo": "^13.14.0",
50
50
  "@atlaskit/lozenge": "^11.4.0",
51
51
  "@atlaskit/media-common": "^7.1.0",
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/popup": "^1.8.0",
56
56
  "@atlaskit/spinner": "^15.5.0",
57
57
  "@atlaskit/theme": "^12.5.0",
58
- "@atlaskit/tokens": "^1.10.0",
58
+ "@atlaskit/tokens": "^1.11.0",
59
59
  "@atlaskit/tooltip": "^17.8.0",
60
60
  "@atlaskit/ufo": "^0.2.0",
61
61
  "@babel/runtime": "^7.0.0",
package/report.api.md CHANGED
@@ -28,6 +28,7 @@ import { CardType } from '@atlaskit/linking-common';
28
28
  import { CardClient as Client } from '@atlaskit/link-provider';
29
29
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
30
30
  import { DatasourceAdf } from '@atlaskit/linking-common';
31
+ import { DatasourceAdfView } from '@atlaskit/linking-common';
31
32
  import { EditorCardProvider } from '@atlaskit/link-provider';
32
33
  import { editorCardProvider } from '@atlaskit/link-provider';
33
34
  import { EmbedCardAdf } from '@atlaskit/linking-common';
@@ -419,6 +420,8 @@ type CustomActionItem = BaseActionItem & {
419
420
 
420
421
  export { DatasourceAdf };
421
422
 
423
+ export { DatasourceAdfView };
424
+
422
425
  // @public (undocumented)
423
426
  type DestinationProduct = 'bitbucket' | 'confluence' | 'jira' | 'trello';
424
427
 
@@ -17,6 +17,7 @@ import { CardType } from '@atlaskit/linking-common';
17
17
  import { CardClient as Client } from '@atlaskit/link-provider';
18
18
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
19
19
  import { DatasourceAdf } from '@atlaskit/linking-common';
20
+ import { DatasourceAdfView } from '@atlaskit/linking-common';
20
21
  import { EditorCardProvider } from '@atlaskit/link-provider';
21
22
  import { editorCardProvider } from '@atlaskit/link-provider';
22
23
  import { EmbedCardAdf } from '@atlaskit/linking-common';
@@ -318,6 +319,8 @@ type CustomActionItem = BaseActionItem & {
318
319
 
319
320
  export { DatasourceAdf }
320
321
 
322
+ export { DatasourceAdfView }
323
+
321
324
  // @public (undocumented)
322
325
  type DestinationProduct = 'bitbucket' | 'confluence' | 'jira' | 'trello';
323
326