@atlaskit/editor-card-provider 7.3.19 → 7.3.21
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/provider.js +8 -7
- package/dist/es2019/provider.js +3 -2
- package/dist/esm/provider.js +3 -2
- package/dist/types/provider.d.ts +2 -2
- package/dist/types/transformer.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/cjs/provider.js
CHANGED
|
@@ -22,11 +22,12 @@ var _setPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/se
|
|
|
22
22
|
var _extractSmartLinkEmbed = require("@atlaskit/link-extractors/extract-smart-link-embed");
|
|
23
23
|
var _extractSmartLinkUrl = require("@atlaskit/link-extractors/extract-smart-link-url");
|
|
24
24
|
var _nodeDataProvider = require("@atlaskit/node-data-provider");
|
|
25
|
+
var _getStatus = require("@atlaskit/linking-common/utils/get-status");
|
|
25
26
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
26
27
|
var _dataloader = _interopRequireDefault(require("dataloader"));
|
|
27
28
|
var _transformer = require("./transformer");
|
|
28
29
|
var _urlCheckers = require("./url-checkers");
|
|
29
|
-
var
|
|
30
|
+
var _client = _interopRequireDefault(require("@atlaskit/link-provider/client"));
|
|
30
31
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
31
32
|
var _api = require("./api");
|
|
32
33
|
var _smartCardLocalCacheClient = require("./smart-card-local-cache-client");
|
|
@@ -243,7 +244,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
243
244
|
return setTimeout(callback, BATCH_WAIT_TIME);
|
|
244
245
|
}
|
|
245
246
|
});
|
|
246
|
-
_this.cardClient = customCardClient !== null && customCardClient !== void 0 ? customCardClient : new
|
|
247
|
+
_this.cardClient = customCardClient !== null && customCardClient !== void 0 ? customCardClient : new _client.default(envKey, baseUrlOverride);
|
|
247
248
|
if (!customCardClient && product) {
|
|
248
249
|
_this.cardClient.setProduct(product);
|
|
249
250
|
}
|
|
@@ -270,7 +271,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
270
271
|
var key = this.nodeDataKey(jsonNode);
|
|
271
272
|
var details = this.smartCardLocalCacheClient.getItem(key);
|
|
272
273
|
// NAVX-4712: Handle responses with non-resolved statuses that were previously cached
|
|
273
|
-
var isResolvedCachedResponse = details && details.meta && (0,
|
|
274
|
+
var isResolvedCachedResponse = details && details.meta && (0, _getStatus.getStatus)(details) === 'resolved';
|
|
274
275
|
if (isResolvedCachedResponse) {
|
|
275
276
|
callback({
|
|
276
277
|
data: details
|
|
@@ -287,7 +288,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
287
288
|
this.getDataAsync(node, function (payload) {
|
|
288
289
|
var response = payload.data;
|
|
289
290
|
if (!payload.error && response !== null && response !== void 0 && response.meta) {
|
|
290
|
-
var status = (0,
|
|
291
|
+
var status = (0, _getStatus.getStatus)(response);
|
|
291
292
|
if (status === 'resolved') {
|
|
292
293
|
_this2.smartCardLocalCacheClient.setItem(key, response);
|
|
293
294
|
}
|
|
@@ -364,7 +365,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
364
365
|
return this.fetchData(resourceUrl);
|
|
365
366
|
case 1:
|
|
366
367
|
response = _context2.sent;
|
|
367
|
-
if (!((0,
|
|
368
|
+
if (!((0, _getStatus.getStatus)(response) !== 'not_found')) {
|
|
368
369
|
_context2.next = 2;
|
|
369
370
|
break;
|
|
370
371
|
}
|
|
@@ -400,7 +401,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
400
401
|
return this.fetchData(resourceUrl);
|
|
401
402
|
case 1:
|
|
402
403
|
response = _context3.sent;
|
|
403
|
-
if (!((0,
|
|
404
|
+
if (!((0, _getStatus.getStatus)(response) !== 'not_found')) {
|
|
404
405
|
_context3.next = 2;
|
|
405
406
|
break;
|
|
406
407
|
}
|
|
@@ -722,7 +723,7 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
722
723
|
}
|
|
723
724
|
return _context1.abrupt("return", false);
|
|
724
725
|
case 2:
|
|
725
|
-
if (!((0,
|
|
726
|
+
if (!((0, _getStatus.getStatus)(details) !== 'resolved')) {
|
|
726
727
|
_context1.next = 3;
|
|
727
728
|
break;
|
|
728
729
|
}
|
package/dist/es2019/provider.js
CHANGED
|
@@ -4,11 +4,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import { extractSmartLinkEmbed } from '@atlaskit/link-extractors/extract-smart-link-embed';
|
|
5
5
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
|
|
6
6
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
7
|
-
import { getStatus
|
|
7
|
+
import { getStatus } from '@atlaskit/linking-common/utils/get-status';
|
|
8
|
+
import { getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
|
|
8
9
|
import DataLoader from 'dataloader';
|
|
9
10
|
import { Transformer } from './transformer';
|
|
10
11
|
import { isConfluenceSlideUrl } from './url-checkers';
|
|
11
|
-
import
|
|
12
|
+
import CardClient from '@atlaskit/link-provider/client';
|
|
12
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
13
14
|
import { request } from './api';
|
|
14
15
|
import { SmartCardLocalCacheClient } from './smart-card-local-cache-client';
|
package/dist/esm/provider.js
CHANGED
|
@@ -17,11 +17,12 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new B
|
|
|
17
17
|
import { extractSmartLinkEmbed } from '@atlaskit/link-extractors/extract-smart-link-embed';
|
|
18
18
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
|
|
19
19
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
20
|
-
import { getStatus
|
|
20
|
+
import { getStatus } from '@atlaskit/linking-common/utils/get-status';
|
|
21
|
+
import { getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
|
|
21
22
|
import DataLoader from 'dataloader';
|
|
22
23
|
import { Transformer } from './transformer';
|
|
23
24
|
import { isConfluenceSlideUrl } from './url-checkers';
|
|
24
|
-
import
|
|
25
|
+
import CardClient from '@atlaskit/link-provider/client';
|
|
25
26
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
26
27
|
import { request } from './api';
|
|
27
28
|
import { SmartCardLocalCacheClient } from './smart-card-local-cache-client';
|
package/dist/types/provider.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import type { JSONNode } from '@atlaskit/editor-json-transformer/types';
|
|
|
2
2
|
import type { CallbackPayload } from '@atlaskit/node-data-provider';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
5
|
-
import type { BlockCardAdf, EmbedCardAdf, CardAdf, InlineCardAdf, CardAppearance, DatasourceAdf, ProductType, EnvironmentsKeys } from '@atlaskit/linking-common';
|
|
5
|
+
import type { BlockCardAdf, EmbedCardAdf, CardAdf, InlineCardAdf, CardAppearance, DatasourceAdf, ProductType, EnvironmentsKeys } from '@atlaskit/linking-common/types';
|
|
6
6
|
import type { CardProvider } from './types';
|
|
7
|
-
import
|
|
7
|
+
import CardClient from '@atlaskit/link-provider/client';
|
|
8
8
|
import type { JsonLd } from '@atlaskit/json-ld-types/jsonld';
|
|
9
9
|
type UrlChecker = (url: string) => RegExpMatchArray | null;
|
|
10
10
|
export declare const isJiraWorkItem: (url: string) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardAppearance, CardAdf, DatasourceAdf, Datasource } from '@atlaskit/linking-common';
|
|
1
|
+
import type { CardAppearance, CardAdf, DatasourceAdf, Datasource } from '@atlaskit/linking-common/types';
|
|
2
2
|
export declare class Transformer {
|
|
3
3
|
private buildInlineAdf;
|
|
4
4
|
private buildBlockAdf;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CardAppearance } from '@atlaskit/linking-common';
|
|
1
|
+
import type { CardAppearance } from '@atlaskit/linking-common/types';
|
|
2
2
|
export interface CardProvider {
|
|
3
3
|
resolve: (url: string, appearance: CardAppearance, shouldForceAppearance?: boolean, isEmbedFriendlyLocation?: boolean) => Promise<any>;
|
|
4
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-card-provider",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.21",
|
|
4
4
|
"description": "Contains the EditorCardProvider, for determining smart card behaviour in the editor.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@atlaskit/link-extractors": "^4.2.0",
|
|
31
31
|
"@atlaskit/linking-common": "^12.1.0",
|
|
32
32
|
"@atlaskit/linking-types": "^15.3.0",
|
|
33
|
-
"@atlaskit/node-data-provider": "^
|
|
33
|
+
"@atlaskit/node-data-provider": "^19.0.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
35
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
35
|
+
"@atlaskit/tmp-editor-statsig": "^188.0.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"dataloader": "^2.1.0"
|
|
38
38
|
},
|