@atlaskit/smart-card 26.15.11 → 26.16.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 +12 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/extractors/flexible/index.js +1 -0
- package/dist/cjs/extractors/flexible/utils.js +5 -1
- package/dist/cjs/messages.js +10 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +8 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +4 -0
- package/dist/cjs/view/HoverCard/components/{SnippetOrPreview.js → ImagePreview.js} +19 -17
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +5 -5
- package/dist/cjs/view/HoverCard/components/views/resolving/styled.js +2 -1
- package/dist/cjs/view/HoverCard/styled.js +10 -6
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/extractors/flexible/index.js +2 -1
- package/dist/es2019/extractors/flexible/utils.js +3 -0
- package/dist/es2019/messages.js +10 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +5 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +5 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +5 -0
- package/dist/es2019/view/HoverCard/components/ImagePreview.js +43 -0
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +5 -5
- package/dist/es2019/view/HoverCard/components/views/resolving/styled.js +2 -0
- package/dist/es2019/view/HoverCard/styled.js +10 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/constants.js +1 -0
- package/dist/esm/extractors/flexible/index.js +2 -1
- package/dist/esm/extractors/flexible/utils.js +3 -0
- package/dist/esm/messages.js +10 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +5 -0
- package/dist/esm/view/FlexibleCard/components/elements/index.js +5 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +4 -0
- package/dist/esm/view/HoverCard/components/ImagePreview.js +49 -0
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +5 -5
- package/dist/esm/view/HoverCard/components/views/resolving/styled.js +2 -1
- package/dist/esm/view/HoverCard/styled.js +8 -5
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/extractors/flexible/utils.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -1
- package/dist/types/view/FlexibleCard/components/elements/date-time/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/elements/date-time/types.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +5 -0
- package/dist/types/view/HoverCard/components/ImagePreview.d.ts +4 -0
- package/dist/types/view/HoverCard/styled.d.ts +1 -0
- package/dist/types/view/HoverCard/types.d.ts +2 -2
- package/dist/types-ts4.5/constants.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/utils.d.ts +1 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +8 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/date-time/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/date-time/types.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +5 -0
- package/dist/types-ts4.5/view/HoverCard/components/ImagePreview.d.ts +4 -0
- package/dist/types-ts4.5/view/HoverCard/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +2 -2
- package/package.json +2 -2
- package/report.api.md +8 -0
- package/tmp/api-report-tmp.d.ts +8 -1
- package/dist/es2019/view/HoverCard/components/SnippetOrPreview.js +0 -41
- package/dist/esm/view/HoverCard/components/SnippetOrPreview.js +0 -47
- package/dist/types/view/HoverCard/components/SnippetOrPreview.d.ts +0 -4
- package/dist/types-ts4.5/view/HoverCard/components/SnippetOrPreview.d.ts +0 -4
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -354,7 +354,7 @@ export type ElementItem = {
|
|
|
354
354
|
} & ElementItemProps;
|
|
355
355
|
|
|
356
356
|
// @public
|
|
357
|
-
type ElementItemProps = AssignedTo | AssignedToGroup | AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location_2 | ModifiedBy | ModifiedOn | OwnedBy | OwnedByGroup | Preview | Priority | ProgrammingLanguage | Provider_2 | ReactCount | ReadTime | Snippet | SourceBranch | State_2 | StoryPoints | SubTasksProgress | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
357
|
+
type ElementItemProps = AssignedTo | AssignedToGroup | AttachmentCount | AuthorGroup | ChecklistProgress | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | Location_2 | ModifiedBy | ModifiedOn | OwnedBy | OwnedByGroup | Preview | Priority | ProgrammingLanguage | Provider_2 | ReactCount | ReadTime | SentOn | Snippet | SourceBranch | State_2 | StoryPoints | SubTasksProgress | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
358
358
|
|
|
359
359
|
// @public
|
|
360
360
|
export enum ElementName {
|
|
@@ -405,6 +405,8 @@ export enum ElementName {
|
|
|
405
405
|
// (undocumented)
|
|
406
406
|
ReadTime = "ReadTime",
|
|
407
407
|
// (undocumented)
|
|
408
|
+
SentOn = "SentOn",
|
|
409
|
+
// (undocumented)
|
|
408
410
|
Snippet = "Snippet",
|
|
409
411
|
// (undocumented)
|
|
410
412
|
SourceBranch = "SourceBranch",
|
|
@@ -661,6 +663,11 @@ type RetryOptions = {
|
|
|
661
663
|
// @public (undocumented)
|
|
662
664
|
type ScreenAuthPopupEventProps = CommonEventProps;
|
|
663
665
|
|
|
666
|
+
// @public
|
|
667
|
+
type SentOn = {
|
|
668
|
+
name: ElementName.SentOn;
|
|
669
|
+
};
|
|
670
|
+
|
|
664
671
|
export { SmartCardContext as Context }
|
|
665
672
|
export { SmartCardContext }
|
|
666
673
|
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState, useRef } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
-
import extractPreview from '../../../extractors/flexible/extract-preview';
|
|
4
|
-
import { PreviewBlock, SnippetBlock } from '../../FlexibleCard/components/blocks';
|
|
5
|
-
import { getTransitionStyles } from '../styled';
|
|
6
|
-
const SnippetOrPreview = ({
|
|
7
|
-
data,
|
|
8
|
-
snippetHeight
|
|
9
|
-
}) => {
|
|
10
|
-
const transitionStarted = useRef(false);
|
|
11
|
-
const previewBlockRef = useRef(null);
|
|
12
|
-
const [showSnippet, setShowSnippet] = useState(false);
|
|
13
|
-
const [previewCss, setPreviewCss] = useState();
|
|
14
|
-
|
|
15
|
-
// Set Preview to a fixed height to enable transitions
|
|
16
|
-
const onPreviewRender = useCallback(() => {
|
|
17
|
-
var _previewBlockRef$curr;
|
|
18
|
-
previewBlockRef.current && setPreviewCss(css`
|
|
19
|
-
height: ${(_previewBlockRef$curr = previewBlockRef.current) === null || _previewBlockRef$curr === void 0 ? void 0 : _previewBlockRef$curr.getBoundingClientRect().height}px;
|
|
20
|
-
`);
|
|
21
|
-
}, []);
|
|
22
|
-
|
|
23
|
-
// On error set Preview to Snippet height with transition
|
|
24
|
-
const onPreviewError = useCallback(() => {
|
|
25
|
-
if (transitionStarted.current === false) {
|
|
26
|
-
setPreviewCss(getTransitionStyles(snippetHeight));
|
|
27
|
-
transitionStarted.current = true;
|
|
28
|
-
}
|
|
29
|
-
}, [snippetHeight]);
|
|
30
|
-
const onPreviewTransitionEnd = useCallback(() => {
|
|
31
|
-
setShowSnippet(true);
|
|
32
|
-
}, []);
|
|
33
|
-
return !showSnippet && data && extractPreview(data) ? /*#__PURE__*/React.createElement(PreviewBlock, {
|
|
34
|
-
onError: onPreviewError,
|
|
35
|
-
overrideCss: previewCss,
|
|
36
|
-
onTransitionEnd: onPreviewTransitionEnd,
|
|
37
|
-
blockRef: previewBlockRef,
|
|
38
|
-
onRender: onPreviewRender
|
|
39
|
-
}) : /*#__PURE__*/React.createElement(SnippetBlock, null);
|
|
40
|
-
};
|
|
41
|
-
export default SnippetOrPreview;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
var _templateObject;
|
|
4
|
-
import React, { useCallback, useState, useRef } from 'react';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
-
import extractPreview from '../../../extractors/flexible/extract-preview';
|
|
7
|
-
import { PreviewBlock, SnippetBlock } from '../../FlexibleCard/components/blocks';
|
|
8
|
-
import { getTransitionStyles } from '../styled';
|
|
9
|
-
var SnippetOrPreview = function SnippetOrPreview(_ref) {
|
|
10
|
-
var data = _ref.data,
|
|
11
|
-
snippetHeight = _ref.snippetHeight;
|
|
12
|
-
var transitionStarted = useRef(false);
|
|
13
|
-
var previewBlockRef = useRef(null);
|
|
14
|
-
var _useState = useState(false),
|
|
15
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
-
showSnippet = _useState2[0],
|
|
17
|
-
setShowSnippet = _useState2[1];
|
|
18
|
-
var _useState3 = useState(),
|
|
19
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
20
|
-
previewCss = _useState4[0],
|
|
21
|
-
setPreviewCss = _useState4[1];
|
|
22
|
-
|
|
23
|
-
// Set Preview to a fixed height to enable transitions
|
|
24
|
-
var onPreviewRender = useCallback(function () {
|
|
25
|
-
var _previewBlockRef$curr;
|
|
26
|
-
previewBlockRef.current && setPreviewCss(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", "px;\n "])), (_previewBlockRef$curr = previewBlockRef.current) === null || _previewBlockRef$curr === void 0 ? void 0 : _previewBlockRef$curr.getBoundingClientRect().height));
|
|
27
|
-
}, []);
|
|
28
|
-
|
|
29
|
-
// On error set Preview to Snippet height with transition
|
|
30
|
-
var onPreviewError = useCallback(function () {
|
|
31
|
-
if (transitionStarted.current === false) {
|
|
32
|
-
setPreviewCss(getTransitionStyles(snippetHeight));
|
|
33
|
-
transitionStarted.current = true;
|
|
34
|
-
}
|
|
35
|
-
}, [snippetHeight]);
|
|
36
|
-
var onPreviewTransitionEnd = useCallback(function () {
|
|
37
|
-
setShowSnippet(true);
|
|
38
|
-
}, []);
|
|
39
|
-
return !showSnippet && data && extractPreview(data) ? /*#__PURE__*/React.createElement(PreviewBlock, {
|
|
40
|
-
onError: onPreviewError,
|
|
41
|
-
overrideCss: previewCss,
|
|
42
|
-
onTransitionEnd: onPreviewTransitionEnd,
|
|
43
|
-
blockRef: previewBlockRef,
|
|
44
|
-
onRender: onPreviewRender
|
|
45
|
-
}) : /*#__PURE__*/React.createElement(SnippetBlock, null);
|
|
46
|
-
};
|
|
47
|
-
export default SnippetOrPreview;
|