@atlaskit/smart-card 18.0.11 → 18.0.14

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 (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/extractors/common/preview/extractImage.js +3 -3
  3. package/dist/cjs/extractors/common/preview/index.js +3 -3
  4. package/dist/cjs/extractors/common/primitives/extractLink.js +2 -2
  5. package/dist/cjs/extractors/common/utils.js +4 -16
  6. package/dist/cjs/extractors/embed/index.js +3 -3
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/es2019/extractors/common/preview/extractImage.js +1 -1
  9. package/dist/es2019/extractors/common/preview/index.js +2 -2
  10. package/dist/es2019/extractors/common/primitives/extractLink.js +1 -1
  11. package/dist/es2019/extractors/common/utils.js +1 -11
  12. package/dist/es2019/extractors/embed/index.js +1 -1
  13. package/dist/es2019/version.json +1 -1
  14. package/dist/esm/extractors/common/preview/extractImage.js +1 -1
  15. package/dist/esm/extractors/common/preview/index.js +2 -2
  16. package/dist/esm/extractors/common/primitives/extractLink.js +1 -1
  17. package/dist/esm/extractors/common/utils.js +1 -11
  18. package/dist/esm/extractors/embed/index.js +1 -1
  19. package/dist/esm/version.json +1 -1
  20. package/dist/types/client/errors.d.ts +3 -2
  21. package/dist/types/extractors/block/index.d.ts +2 -2
  22. package/dist/types/extractors/common/__mocks__/jsonld.d.ts +46 -66
  23. package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +1 -1
  24. package/dist/types/extractors/common/preview/index.d.ts +2 -2
  25. package/dist/types/extractors/common/title-prefix/extractTitlePrefix.d.ts +2 -1
  26. package/dist/types/extractors/common/utils.d.ts +0 -1
  27. package/dist/types/extractors/embed/index.d.ts +1 -1
  28. package/dist/types/extractors/flexible/icon/extract-url-icon.d.ts +1 -1
  29. package/dist/types/providers/editor/index.d.ts +4 -2
  30. package/dist/types/providers/editor/transformer.d.ts +1 -1
  31. package/dist/types/providers/editor/types.d.ts +0 -20
  32. package/dist/types/state/context/types.d.ts +1 -1
  33. package/dist/types/utils/analytics/analytics.d.ts +1 -1
  34. package/dist/types/view/BlockCard/utils/handlers.d.ts +1 -1
  35. package/dist/types/view/Card/index.d.ts +1 -1
  36. package/dist/types/view/EmbedCard/components/styled.d.ts +9 -9
  37. package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
  38. package/dist/types/view/InlineCard/Icon.d.ts +3 -3
  39. package/dist/types/view/InlineCard/IconAndTitleLayout/styled.d.ts +9 -9
  40. package/dist/types/view/InlineCard/ResolvingView/styled.d.ts +3 -3
  41. package/dist/types/view/InlineCard/styled.d.ts +4 -4
  42. package/package.json +9 -8
  43. package/dist/cjs/extractors/common/preview/extractPlatformIsSupported.js +0 -30
  44. package/dist/cjs/extractors/common/preview/extractPreview.js +0 -42
  45. package/dist/es2019/extractors/common/preview/extractPlatformIsSupported.js +0 -21
  46. package/dist/es2019/extractors/common/preview/extractPreview.js +0 -31
  47. package/dist/esm/extractors/common/preview/extractPlatformIsSupported.js +0 -21
  48. package/dist/esm/extractors/common/preview/extractPreview.js +0 -31
  49. package/dist/types/extractors/common/preview/extractPlatformIsSupported.d.ts +0 -2
  50. package/dist/types/extractors/common/preview/extractPreview.d.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 18.0.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
8
+ - Updated dependencies
9
+
10
+ ## 18.0.13
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 18.0.12
17
+
18
+ ### Patch Changes
19
+
20
+ - [`b90896c18cd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b90896c18cd) - move helpers and types to @atlaskit/linking-common and import them
21
+
3
22
  ## 18.0.11
4
23
 
5
24
  ### Patch Changes
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.extractImage = void 0;
7
7
 
8
- var _utils = require("../utils");
8
+ var _linkingCommon = require("@atlaskit/linking-common");
9
9
 
10
10
  var extractImage = function extractImage(jsonLd) {
11
11
  var image = jsonLd.image;
@@ -14,10 +14,10 @@ var extractImage = function extractImage(jsonLd) {
14
14
  if (typeof image === 'string') {
15
15
  return image;
16
16
  } else if (image['@type'] === 'Link') {
17
- return (0, _utils.extractUrlFromLinkJsonLd)(image);
17
+ return (0, _linkingCommon.extractUrlFromLinkJsonLd)(image);
18
18
  } else if (image['@type'] === 'Image') {
19
19
  if (image.url) {
20
- return (0, _utils.extractUrlFromLinkJsonLd)(image.url);
20
+ return (0, _linkingCommon.extractUrlFromLinkJsonLd)(image.url);
21
21
  }
22
22
  }
23
23
  }
@@ -12,10 +12,10 @@ Object.defineProperty(exports, "extractImage", {
12
12
  Object.defineProperty(exports, "extractPreview", {
13
13
  enumerable: true,
14
14
  get: function get() {
15
- return _extractPreview.extractPreview;
15
+ return _linkingCommon.extractPreview;
16
16
  }
17
17
  });
18
18
 
19
- var _extractImage = require("./extractImage");
19
+ var _linkingCommon = require("@atlaskit/linking-common");
20
20
 
21
- var _extractPreview = require("./extractPreview");
21
+ var _extractImage = require("./extractImage");
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.extractLink = void 0;
7
7
 
8
- var _utils = require("../utils");
8
+ var _linkingCommon = require("@atlaskit/linking-common");
9
9
 
10
10
  var extractLink = function extractLink(jsonLd) {
11
11
  var url = jsonLd.url;
@@ -14,7 +14,7 @@ var extractLink = function extractLink(jsonLd) {
14
14
  if (typeof url === 'string') {
15
15
  return url;
16
16
  } else {
17
- return (0, _utils.extractUrlFromLinkJsonLd)(url);
17
+ return (0, _linkingCommon.extractUrlFromLinkJsonLd)(url);
18
18
  }
19
19
  }
20
20
  };
@@ -3,30 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.extractUrlFromLinkJsonLd = exports.extractUrlFromIconJsonLd = exports.extractPersonFromJsonLd = void 0;
6
+ exports.extractUrlFromIconJsonLd = exports.extractPersonFromJsonLd = void 0;
7
7
 
8
- var extractUrlFromLinkJsonLd = function extractUrlFromLinkJsonLd(link) {
9
- if (typeof link === 'string') {
10
- return link;
11
- } else if (Array.isArray(link)) {
12
- if (link.length > 0) {
13
- return extractUrlFromLinkJsonLd(link[0]);
14
- }
15
- } else {
16
- return link.href;
17
- }
18
- };
19
-
20
- exports.extractUrlFromLinkJsonLd = extractUrlFromLinkJsonLd;
8
+ var _linkingCommon = require("@atlaskit/linking-common");
21
9
 
22
10
  var extractUrlFromIconJsonLd = function extractUrlFromIconJsonLd(icon) {
23
11
  if (typeof icon === 'string') {
24
12
  return icon;
25
13
  } else if (icon['@type'] === 'Link') {
26
- return extractUrlFromLinkJsonLd(icon);
14
+ return (0, _linkingCommon.extractUrlFromLinkJsonLd)(icon);
27
15
  } else {
28
16
  if (icon.url) {
29
- return extractUrlFromLinkJsonLd(icon.url);
17
+ return (0, _linkingCommon.extractUrlFromLinkJsonLd)(icon.url);
30
18
  }
31
19
  }
32
20
  };
@@ -9,12 +9,12 @@ exports.extractEmbedProps = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
+ var _linkingCommon = require("@atlaskit/linking-common");
13
+
12
14
  var _primitives = require("../common/primitives");
13
15
 
14
16
  var _context = require("../common/context");
15
17
 
16
- var _extractPreview = require("../common/preview/extractPreview");
17
-
18
18
  var _extractIsTrusted = require("../common/meta/extractIsTrusted");
19
19
 
20
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -22,7 +22,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
22
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
23
 
24
24
  var extractEmbedPreview = function extractEmbedPreview(jsonLd, platform) {
25
- var preview = (0, _extractPreview.extractPreview)(jsonLd, platform);
25
+ var preview = (0, _linkingCommon.extractPreview)(jsonLd, platform);
26
26
 
27
27
  if (preview && preview.src) {
28
28
  return _objectSpread(_objectSpread({}, preview), {}, {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "18.0.11",
3
+ "version": "18.0.14",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import { extractUrlFromLinkJsonLd } from '../utils';
1
+ import { extractUrlFromLinkJsonLd } from '@atlaskit/linking-common';
2
2
  export const extractImage = jsonLd => {
3
3
  const image = jsonLd.image;
4
4
 
@@ -1,2 +1,2 @@
1
- export { extractImage } from './extractImage';
2
- export { extractPreview } from './extractPreview';
1
+ export { extractPreview } from '@atlaskit/linking-common';
2
+ export { extractImage } from './extractImage';
@@ -1,4 +1,4 @@
1
- import { extractUrlFromLinkJsonLd } from '../utils';
1
+ import { extractUrlFromLinkJsonLd } from '@atlaskit/linking-common';
2
2
  export const extractLink = jsonLd => {
3
3
  const url = jsonLd.url;
4
4
 
@@ -1,14 +1,4 @@
1
- export const extractUrlFromLinkJsonLd = link => {
2
- if (typeof link === 'string') {
3
- return link;
4
- } else if (Array.isArray(link)) {
5
- if (link.length > 0) {
6
- return extractUrlFromLinkJsonLd(link[0]);
7
- }
8
- } else {
9
- return link.href;
10
- }
11
- };
1
+ import { extractUrlFromLinkJsonLd } from '@atlaskit/linking-common';
12
2
  export const extractUrlFromIconJsonLd = icon => {
13
3
  if (typeof icon === 'string') {
14
4
  return icon;
@@ -1,6 +1,6 @@
1
+ import { extractPreview } from '@atlaskit/linking-common';
1
2
  import { extractLink, extractTitle } from '../common/primitives';
2
3
  import { extractProvider } from '../common/context';
3
- import { extractPreview } from '../common/preview/extractPreview';
4
4
  import { extractIsTrusted } from '../common/meta/extractIsTrusted';
5
5
 
6
6
  const extractEmbedPreview = (jsonLd, platform) => {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "18.0.11",
3
+ "version": "18.0.14",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import { extractUrlFromLinkJsonLd } from '../utils';
1
+ import { extractUrlFromLinkJsonLd } from '@atlaskit/linking-common';
2
2
  export var extractImage = function extractImage(jsonLd) {
3
3
  var image = jsonLd.image;
4
4
 
@@ -1,2 +1,2 @@
1
- export { extractImage } from './extractImage';
2
- export { extractPreview } from './extractPreview';
1
+ export { extractPreview } from '@atlaskit/linking-common';
2
+ export { extractImage } from './extractImage';
@@ -1,4 +1,4 @@
1
- import { extractUrlFromLinkJsonLd } from '../utils';
1
+ import { extractUrlFromLinkJsonLd } from '@atlaskit/linking-common';
2
2
  export var extractLink = function extractLink(jsonLd) {
3
3
  var url = jsonLd.url;
4
4
 
@@ -1,14 +1,4 @@
1
- export var extractUrlFromLinkJsonLd = function extractUrlFromLinkJsonLd(link) {
2
- if (typeof link === 'string') {
3
- return link;
4
- } else if (Array.isArray(link)) {
5
- if (link.length > 0) {
6
- return extractUrlFromLinkJsonLd(link[0]);
7
- }
8
- } else {
9
- return link.href;
10
- }
11
- };
1
+ import { extractUrlFromLinkJsonLd } from '@atlaskit/linking-common';
12
2
  export var extractUrlFromIconJsonLd = function extractUrlFromIconJsonLd(icon) {
13
3
  if (typeof icon === 'string') {
14
4
  return icon;
@@ -4,9 +4,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
+ import { extractPreview } from '@atlaskit/linking-common';
7
8
  import { extractLink, extractTitle } from '../common/primitives';
8
9
  import { extractProvider } from '../common/context';
9
- import { extractPreview } from '../common/preview/extractPreview';
10
10
  import { extractIsTrusted } from '../common/meta/extractIsTrusted';
11
11
 
12
12
  var extractEmbedPreview = function extractEmbedPreview(jsonLd, platform) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "18.0.11",
3
+ "version": "18.0.14",
4
4
  "sideEffects": false
5
5
  }
@@ -1,8 +1,9 @@
1
+ import { ErrorType } from './types/responses';
1
2
  export declare type APIErrorKind = 'fatal' | 'auth' | 'error' | 'fallback';
2
3
  export declare class APIError extends Error {
3
4
  readonly kind: APIErrorKind;
4
5
  readonly hostname: string;
5
6
  readonly message: string;
6
- readonly type?: "ResolveBadRequestError" | "ResolveAuthError" | "ResolveUnsupportedError" | "ResolveFailedError" | "ResolveTimeoutError" | "InternalServerError" | "UnexpectedError" | undefined;
7
- constructor(kind: APIErrorKind, hostname: string, message: string, type?: "ResolveBadRequestError" | "ResolveAuthError" | "ResolveUnsupportedError" | "ResolveFailedError" | "ResolveTimeoutError" | "InternalServerError" | "UnexpectedError" | undefined);
7
+ readonly type?: ErrorType | undefined;
8
+ constructor(kind: APIErrorKind, hostname: string, message: string, type?: ErrorType | undefined);
8
9
  }
@@ -4,6 +4,6 @@ import { ExtractBlockOpts } from './types';
4
4
  import { CardProviderRenderers } from '../../state/context/types';
5
5
  import { BlockCardResolvedViewProps } from '../../view/BlockCard';
6
6
  import { ActionProps } from '../../view/BlockCard/components/Action';
7
- export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts | undefined, platform?: "web" | "mobile" | undefined) => ActionProps[];
7
+ export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts | undefined, platform?: JsonLd.Primitives.Platforms | undefined) => ActionProps[];
8
8
  export declare const extractBlockUsers: (jsonLd: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
9
- export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta | undefined, opts?: ExtractBlockOpts | undefined, renderers?: CardProviderRenderers | undefined, platform?: "web" | "mobile" | undefined) => BlockCardResolvedViewProps;
9
+ export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta | undefined, opts?: ExtractBlockOpts | undefined, renderers?: CardProviderRenderers | undefined, platform?: JsonLd.Primitives.Platforms | undefined) => BlockCardResolvedViewProps;
@@ -27,11 +27,11 @@ export declare const TEST_ASSIGN_ACTION: JsonLd.Data.BaseData['schema:potentialA
27
27
  export declare const TEST_NO_ID_ACTION: JsonLd.Data.BaseData['schema:potentialAction'];
28
28
  export declare const TEST_DOCUMENT_WITH_ACTIONS: {
29
29
  'schema:potentialAction': any[];
30
- '@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | ("Object" | "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink")[] | ("Document" | "schema:DigitalDocument")[];
30
+ '@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | (JsonLd.Data.DocumentChildType | JsonLd.Data.DocumentParentType)[] | ("Document" | "schema:DigitalDocument")[];
31
31
  'schema:fileFormat'?: string | undefined;
32
32
  'atlassian:fileSize'?: number | undefined;
33
33
  'schema:dateCreated'?: string | undefined;
34
- 'atlassian:updatedBy'?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Person<any> | undefined;
34
+ 'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | undefined;
35
35
  'schema:commentCount'?: number | undefined;
36
36
  'atlassian:isDeleted'?: boolean | undefined;
37
37
  'atlassian:dateViewed'?: string | undefined;
@@ -44,38 +44,28 @@ export declare const TEST_DOCUMENT_WITH_ACTIONS: {
44
44
  'atlassian:visitUrl'?: string | undefined;
45
45
  'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
46
46
  '@id'?: string | undefined;
47
- attachment?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
48
- attributedTo?: (string & {
49
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
50
- }) | (JsonLd.Primitives.Object<any> & {
51
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
52
- }) | (JsonLd.Primitives.LinkModel & {
53
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
54
- }) | ((string & {
55
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
56
- }) | (JsonLd.Primitives.Object<any> & {
57
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
58
- }) | (JsonLd.Primitives.LinkModel & {
59
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
60
- }))[] | undefined;
61
- audience?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
62
- bcc?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
63
- bto?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
64
- cc?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
65
- context?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
66
- generator?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
67
- icon?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined;
68
- image?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined;
69
- inReplyTo?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
70
- location?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
71
- oneOf?: (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
72
- anyOf?: (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
73
- closed?: string | boolean | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
74
- preview?: string | (JsonLd.Primitives.Object<any> & JsonLd.Primitives.PreviewExtension) | (JsonLd.Primitives.LinkModel & JsonLd.Primitives.PreviewExtension) | undefined;
47
+ attachment?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
48
+ attributedTo?: JsonLd.Primitives.Property<(JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link) & {
49
+ actor?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
50
+ }> | undefined;
51
+ audience?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
52
+ bcc?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
53
+ bto?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
54
+ cc?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
55
+ context?: JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link | undefined;
56
+ generator?: JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link | undefined;
57
+ icon?: JsonLd.Primitives.Link | JsonLd.Primitives.Image | undefined;
58
+ image?: JsonLd.Primitives.Link | JsonLd.Primitives.Image | undefined;
59
+ inReplyTo?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
60
+ location?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
61
+ oneOf?: (JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link)[] | undefined;
62
+ anyOf?: (JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link)[] | undefined;
63
+ closed?: boolean | JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link | undefined;
64
+ preview?: string | ((JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel) & JsonLd.Primitives.PreviewExtension) | undefined;
75
65
  replies?: JsonLd.Primitives.Collection<any> | undefined;
76
- tag?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
77
- to?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
78
- url?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Link[] | undefined;
66
+ tag?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
67
+ to?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
68
+ url?: JsonLd.Primitives.Property<JsonLd.Primitives.Link> | undefined;
79
69
  content?: string | undefined;
80
70
  contentMap?: Record<string, string> | undefined;
81
71
  name?: string | undefined;
@@ -92,14 +82,14 @@ export declare const TEST_DOCUMENT_WITH_ACTIONS: {
92
82
  export declare const PREVIEW: JsonLd.Data.BaseData['preview'];
93
83
  export declare const TEST_DOCUMENT_WITH_PREVIEW: {
94
84
  preview: JsonLd.Primitives.LinkModel & JsonLd.Primitives.PreviewExtension;
95
- '@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | ("Object" | "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink")[] | ("Document" | "schema:DigitalDocument")[];
85
+ '@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | (JsonLd.Data.DocumentChildType | JsonLd.Data.DocumentParentType)[] | ("Document" | "schema:DigitalDocument")[];
96
86
  'schema:fileFormat'?: string | undefined;
97
87
  'atlassian:fileSize'?: number | undefined;
98
88
  'schema:dateCreated'?: string | undefined;
99
- 'atlassian:updatedBy'?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Person<any> | undefined;
89
+ 'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | undefined;
100
90
  'schema:commentCount'?: number | undefined;
101
91
  'atlassian:isDeleted'?: boolean | undefined;
102
- 'schema:potentialAction'?: import("schema-dts").DeleteAction | import("schema-dts").ViewAction | import("schema-dts").DownloadAction | import("schema-dts").WatchAction | import("schema-dts").CommentAction | import("schema-dts").ShareAction | JsonLd.Data.DocumentAction[] | undefined;
92
+ 'schema:potentialAction'?: JsonLd.Primitives.Property<JsonLd.Data.DocumentAction> | undefined;
103
93
  'atlassian:dateViewed'?: string | undefined;
104
94
  'atlassian:reactCount'?: number | undefined;
105
95
  'atlassian:state'?: string | undefined;
@@ -110,37 +100,27 @@ export declare const TEST_DOCUMENT_WITH_PREVIEW: {
110
100
  'atlassian:visitUrl'?: string | undefined;
111
101
  'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
112
102
  '@id'?: string | undefined;
113
- attachment?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
114
- attributedTo?: (string & {
115
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
116
- }) | (JsonLd.Primitives.Object<any> & {
117
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
118
- }) | (JsonLd.Primitives.LinkModel & {
119
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
120
- }) | ((string & {
121
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
122
- }) | (JsonLd.Primitives.Object<any> & {
123
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
124
- }) | (JsonLd.Primitives.LinkModel & {
125
- actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
126
- }))[] | undefined;
127
- audience?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
128
- bcc?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
129
- bto?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
130
- cc?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
131
- context?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
132
- generator?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
133
- icon?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined;
134
- image?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined;
135
- inReplyTo?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
136
- location?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
137
- oneOf?: (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
138
- anyOf?: (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
139
- closed?: string | boolean | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
103
+ attachment?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
104
+ attributedTo?: JsonLd.Primitives.Property<(JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link) & {
105
+ actor?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
106
+ }> | undefined;
107
+ audience?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
108
+ bcc?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
109
+ bto?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
110
+ cc?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
111
+ context?: JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link | undefined;
112
+ generator?: JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link | undefined;
113
+ icon?: JsonLd.Primitives.Link | JsonLd.Primitives.Image | undefined;
114
+ image?: JsonLd.Primitives.Link | JsonLd.Primitives.Image | undefined;
115
+ inReplyTo?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
116
+ location?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
117
+ oneOf?: (JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link)[] | undefined;
118
+ anyOf?: (JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link)[] | undefined;
119
+ closed?: boolean | JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link | undefined;
140
120
  replies?: JsonLd.Primitives.Collection<any> | undefined;
141
- tag?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
142
- to?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
143
- url?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Link[] | undefined;
121
+ tag?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
122
+ to?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
123
+ url?: JsonLd.Primitives.Property<JsonLd.Primitives.Link> | undefined;
144
124
  content?: string | undefined;
145
125
  contentMap?: Record<string, string> | undefined;
146
126
  name?: string | undefined;
@@ -2,4 +2,4 @@ import { JsonLd } from 'json-ld-types';
2
2
  import { InvokeHandler } from '../../../model/invoke-handler';
3
3
  import { AnalyticsHandler } from '../../../utils/types';
4
4
  import { BlockCardResolvedViewProps } from '../../../view/BlockCard';
5
- export declare const extractPreviewAction: (extensionKey: string | undefined, viewProps: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, handleInvoke: InvokeHandler, handleAnalytics: AnalyticsHandler, testId?: string | undefined, platform?: "web" | "mobile" | undefined) => import("../../../view/BlockCard/components/Action").ActionProps | undefined;
5
+ export declare const extractPreviewAction: (extensionKey: string | undefined, viewProps: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, handleInvoke: InvokeHandler, handleAnalytics: AnalyticsHandler, testId?: string | undefined, platform?: JsonLd.Primitives.Platforms | undefined) => import("../../../view/BlockCard/components/Action").ActionProps | undefined;
@@ -1,3 +1,3 @@
1
+ export { extractPreview } from '@atlaskit/linking-common';
2
+ export type { LinkPreview } from '@atlaskit/linking-common';
1
3
  export { extractImage } from './extractImage';
2
- export { extractPreview } from './extractPreview';
3
- export type { LinkPreview } from './extractPreview';
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { JsonLd } from 'json-ld-types';
3
3
  import { CardProviderRenderers } from '../../../state/context/types';
4
- export declare const extractTitlePrefix: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers | undefined, type?: "embed" | "block" | "inline" | undefined) => string | React.ReactNode | undefined;
4
+ import { CardAppearance } from '../../../view/Card';
5
+ export declare const extractTitlePrefix: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers | undefined, type?: CardAppearance | undefined) => string | React.ReactNode | undefined;
@@ -1,5 +1,4 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
2
  import { LinkPerson } from './person/types';
3
- export declare const extractUrlFromLinkJsonLd: (link: JsonLd.Primitives.Link | JsonLd.Primitives.Link[]) => string | undefined;
4
3
  export declare const extractUrlFromIconJsonLd: (icon: JsonLd.Primitives.Link | JsonLd.Primitives.Image) => string | undefined;
5
4
  export declare const extractPersonFromJsonLd: (person: JsonLd.Primitives.Object | JsonLd.Primitives.Link) => LinkPerson | undefined;
@@ -1,3 +1,3 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
2
  import { EmbedCardResolvedViewProps } from '../../view/EmbedCard/views/ResolvedView';
3
- export declare const extractEmbedProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta | undefined, platform?: "web" | "mobile" | undefined) => EmbedCardResolvedViewProps;
3
+ export declare const extractEmbedProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta | undefined, platform?: JsonLd.Primitives.Platforms | undefined) => EmbedCardResolvedViewProps;
@@ -1,4 +1,4 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
2
  import { IconDescriptor } from './types';
3
- declare const extractUrlIcon: (icon?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined, label?: string | undefined) => IconDescriptor | undefined;
3
+ declare const extractUrlIcon: (icon?: JsonLd.Primitives.Link | JsonLd.Primitives.Image | undefined, label?: string | undefined) => IconDescriptor | undefined;
4
4
  export default extractUrlIcon;
@@ -1,5 +1,6 @@
1
1
  import 'setimmediate';
2
- import { CardProvider, CardAdf } from './types';
2
+ import { CardAdf } from '@atlaskit/linking-common';
3
+ import { CardProvider } from './types';
3
4
  import { CardAppearance } from '../../view/Card';
4
5
  import { EnvironmentsKeys } from '../../client/types';
5
6
  export declare class EditorCardProvider implements CardProvider {
@@ -17,4 +18,5 @@ export declare class EditorCardProvider implements CardProvider {
17
18
  resolve(url: string, appearance: CardAppearance): Promise<CardAdf>;
18
19
  }
19
20
  export declare const editorCardProvider: EditorCardProvider;
20
- export type { CardProvider, ORSCheckResponse, CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, } from './types';
21
+ export type { CardProvider, ORSCheckResponse } from './types';
22
+ export type { CardAdf, InlineCardAdf, BlockCardAdf, EmbedCardAdf, } from '@atlaskit/linking-common';
@@ -1,5 +1,5 @@
1
+ import { CardAdf } from '@atlaskit/linking-common';
1
2
  import { CardAppearance } from '../../view/Card';
2
- import { CardAdf } from './types';
3
3
  export declare class Transformer {
4
4
  private buildInlineAdf;
5
5
  private buildBlockAdf;
@@ -16,24 +16,4 @@ declare type Provider = {
16
16
  export declare type ORSProvidersResponse = {
17
17
  providers: Provider[];
18
18
  };
19
- export interface InlineCardAdf {
20
- type: 'inlineCard';
21
- attrs: {
22
- url: string;
23
- };
24
- }
25
- export interface BlockCardAdf {
26
- type: 'blockCard';
27
- attrs: {
28
- url: string;
29
- };
30
- }
31
- export interface EmbedCardAdf {
32
- type: 'embedCard';
33
- attrs: {
34
- url: string;
35
- layout: 'wide';
36
- };
37
- }
38
- export declare type CardAdf = InlineCardAdf | BlockCardAdf | EmbedCardAdf;
39
19
  export {};
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { Store } from 'redux';
3
+ import { LinkPreview } from '@atlaskit/linking-common';
3
4
  import { CardStore, CardConnections } from '../store/types';
4
5
  import { CardPlatform, CardAppearance } from '../../view/Card';
5
6
  import CardClient from '../../client';
6
- import { LinkPreview } from '../../extractors/common/preview/extractPreview';
7
7
  export interface CardAuthFlowOpts {
8
8
  authFlow?: 'oauth2' | 'disabled';
9
9
  }
@@ -23,7 +23,7 @@ export declare const trackAppAccountConnected: (definitionId?: string | undefine
23
23
  export declare const uiAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
24
24
  export declare const uiAuthAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
25
25
  export declare const uiCardClickedEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined) => AnalyticsPayload;
26
- export declare const uiActionClickedEvent: (extensionKey: string, actionType: string, display?: "embed" | "block" | "inline" | "preview" | "flexible" | undefined) => AnalyticsPayload;
26
+ export declare const uiActionClickedEvent: (extensionKey: string, actionType: string, display?: CardInnerAppearance | undefined) => AnalyticsPayload;
27
27
  export declare const uiClosedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
28
28
  export declare const screenAuthPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
29
29
  export declare const uiRenderSuccessEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const handleClickCommon: (event: React.MouseEvent, onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined) => void;
2
+ export declare const handleClickCommon: (event: React.MouseEvent, onClick?: React.MouseEventHandler<Element> | undefined) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { CardAppearance, CardPlatform, CardProps } from './types';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
- export declare const Card: React.ForwardRefExoticComponent<Pick<Pick<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "onClick" | "url" | "ui" | "showActions" | "onResolve" | "platform" | "forwardedRef" | "isFrameVisible" | "importer" | "container" | "embedIframeRef" | "inlinePreloaderStyle"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "onClick" | "analyticsContext" | "key" | "url" | "ui" | "showActions" | "onResolve" | "platform" | "forwardedRef" | "isFrameVisible" | "importer" | "container" | "embedIframeRef" | "inlinePreloaderStyle"> & React.RefAttributes<any>>;
4
+ export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "onClick" | "analyticsContext" | "key" | "url" | "ui" | "showActions" | "onResolve" | "platform" | "forwardedRef" | "isFrameVisible" | "importer" | "container" | "embedIframeRef" | "inlinePreloaderStyle"> & React.RefAttributes<any>>;
5
5
  export type { CardAppearance, CardProps, CardPlatform };