@atlaskit/editor-card-provider 6.8.12 → 6.8.13
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 +15 -0
- package/dist/cjs/provider.js +9 -4
- package/dist/es2019/provider.js +9 -4
- package/dist/esm/provider.js +9 -4
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-card-provider
|
|
2
2
|
|
|
3
|
+
## 6.8.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fdea0f8bc06c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fdea0f8bc06c4) -
|
|
8
|
+
Thread appearance parameter through provider to support ORS optimized response payloads for smart
|
|
9
|
+
card inline resolve optimization.
|
|
10
|
+
- [`fdea0f8bc06c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fdea0f8bc06c4) -
|
|
11
|
+
Gate the appearance argument in fetchNodesData behind the
|
|
12
|
+
platform_smartlink_inline_resolve_optimization flag. Previously, appearance was unconditionally
|
|
13
|
+
passed to cardClient.fetchData, causing shouldUseParentFetchData to always be true via this path
|
|
14
|
+
and bypassing the editorCardProvider SSR cache and Confluence-specific optimizations when the flag
|
|
15
|
+
was off.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 6.8.12
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/provider.js
CHANGED
|
@@ -195,6 +195,9 @@ function isInternalUrl(url) {
|
|
|
195
195
|
function isExternalUrl(url) {
|
|
196
196
|
return !isInternalUrl(url);
|
|
197
197
|
}
|
|
198
|
+
function getAppearanceForNode(node) {
|
|
199
|
+
return node.type === 'blockCard' ? 'block' : node.type === 'embedCard' ? 'embed' : 'inline';
|
|
200
|
+
}
|
|
198
201
|
function isCardNode(node) {
|
|
199
202
|
return ['inlineCard', 'blockCard', 'embedCard'].includes(node.type) && !!node.attrs && 'url' in node.attrs && typeof node.attrs.url === 'string';
|
|
200
203
|
}
|
|
@@ -279,9 +282,10 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
279
282
|
}, {
|
|
280
283
|
key: "nodeDataKey",
|
|
281
284
|
value: function nodeDataKey(node) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
if (!(0, _platformFeatureFlags.fg)('platform_smartlink_inline_resolve_optimization')) {
|
|
286
|
+
return node.attrs.url;
|
|
287
|
+
}
|
|
288
|
+
return "".concat(node.attrs.url, "|").concat(getAppearanceForNode(node));
|
|
285
289
|
}
|
|
286
290
|
}, {
|
|
287
291
|
key: "fetchNodesData",
|
|
@@ -289,7 +293,8 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
|
|
|
289
293
|
var _this3 = this;
|
|
290
294
|
var promises = nodes.map(function (node) {
|
|
291
295
|
var url = node.attrs.url;
|
|
292
|
-
|
|
296
|
+
var appearance = (0, _platformFeatureFlags.fg)('platform_smartlink_inline_resolve_optimization') ? getAppearanceForNode(node) : undefined;
|
|
297
|
+
return _this3.cardClient.fetchData(url, false, appearance);
|
|
293
298
|
});
|
|
294
299
|
return Promise.all(promises);
|
|
295
300
|
}
|
package/dist/es2019/provider.js
CHANGED
|
@@ -118,6 +118,9 @@ export function isInternalUrl(url) {
|
|
|
118
118
|
export function isExternalUrl(url) {
|
|
119
119
|
return !isInternalUrl(url);
|
|
120
120
|
}
|
|
121
|
+
function getAppearanceForNode(node) {
|
|
122
|
+
return node.type === 'blockCard' ? 'block' : node.type === 'embedCard' ? 'embed' : 'inline';
|
|
123
|
+
}
|
|
121
124
|
function isCardNode(node) {
|
|
122
125
|
return ['inlineCard', 'blockCard', 'embedCard'].includes(node.type) && !!node.attrs && 'url' in node.attrs && typeof node.attrs.url === 'string';
|
|
123
126
|
}
|
|
@@ -187,14 +190,16 @@ export class EditorCardProvider extends NodeDataProvider {
|
|
|
187
190
|
});
|
|
188
191
|
}
|
|
189
192
|
nodeDataKey(node) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
if (!fg('platform_smartlink_inline_resolve_optimization')) {
|
|
194
|
+
return node.attrs.url;
|
|
195
|
+
}
|
|
196
|
+
return `${node.attrs.url}|${getAppearanceForNode(node)}`;
|
|
193
197
|
}
|
|
194
198
|
fetchNodesData(nodes) {
|
|
195
199
|
const promises = nodes.map(node => {
|
|
196
200
|
const url = node.attrs.url;
|
|
197
|
-
|
|
201
|
+
const appearance = fg('platform_smartlink_inline_resolve_optimization') ? getAppearanceForNode(node) : undefined;
|
|
202
|
+
return this.cardClient.fetchData(url, false, appearance);
|
|
198
203
|
});
|
|
199
204
|
return Promise.all(promises);
|
|
200
205
|
}
|
package/dist/esm/provider.js
CHANGED
|
@@ -187,6 +187,9 @@ export function isInternalUrl(url) {
|
|
|
187
187
|
export function isExternalUrl(url) {
|
|
188
188
|
return !isInternalUrl(url);
|
|
189
189
|
}
|
|
190
|
+
function getAppearanceForNode(node) {
|
|
191
|
+
return node.type === 'blockCard' ? 'block' : node.type === 'embedCard' ? 'embed' : 'inline';
|
|
192
|
+
}
|
|
190
193
|
function isCardNode(node) {
|
|
191
194
|
return ['inlineCard', 'blockCard', 'embedCard'].includes(node.type) && !!node.attrs && 'url' in node.attrs && typeof node.attrs.url === 'string';
|
|
192
195
|
}
|
|
@@ -271,9 +274,10 @@ export var EditorCardProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
|
271
274
|
}, {
|
|
272
275
|
key: "nodeDataKey",
|
|
273
276
|
value: function nodeDataKey(node) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
if (!fg('platform_smartlink_inline_resolve_optimization')) {
|
|
278
|
+
return node.attrs.url;
|
|
279
|
+
}
|
|
280
|
+
return "".concat(node.attrs.url, "|").concat(getAppearanceForNode(node));
|
|
277
281
|
}
|
|
278
282
|
}, {
|
|
279
283
|
key: "fetchNodesData",
|
|
@@ -281,7 +285,8 @@ export var EditorCardProvider = /*#__PURE__*/function (_NodeDataProvider) {
|
|
|
281
285
|
var _this3 = this;
|
|
282
286
|
var promises = nodes.map(function (node) {
|
|
283
287
|
var url = node.attrs.url;
|
|
284
|
-
|
|
288
|
+
var appearance = fg('platform_smartlink_inline_resolve_optimization') ? getAppearanceForNode(node) : undefined;
|
|
289
|
+
return _this3.cardClient.fetchData(url, false, appearance);
|
|
285
290
|
});
|
|
286
291
|
return Promise.all(promises);
|
|
287
292
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-card-provider",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.13",
|
|
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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dataloader": "^2.1.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/link-provider": "^4.
|
|
47
|
+
"@atlaskit/link-provider": "^4.7.0",
|
|
48
48
|
"react": "^18.2.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
"avp_unfurl_shared_charts_embed_by_default_2": {
|
|
62
62
|
"type": "boolean"
|
|
63
63
|
},
|
|
64
|
+
"platform_smartlink_inline_resolve_optimization": {
|
|
65
|
+
"type": "boolean"
|
|
66
|
+
},
|
|
64
67
|
"loom-support-screenshot-sl-resolution": {
|
|
65
68
|
"type": "boolean"
|
|
66
69
|
}
|