@atlaskit/editor-card-provider 3.10.8 → 3.11.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 +14 -0
- package/dist/cjs/provider.js +18 -5
- package/dist/es2019/provider.js +19 -6
- package/dist/esm/provider.js +19 -6
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-card-provider
|
|
2
2
|
|
|
3
|
+
## 3.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.11.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#166667](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/166667)
|
|
14
|
+
[`821e294042f28`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/821e294042f28) -
|
|
15
|
+
[ux] Update editor card provider to return embed card for Jira version links
|
|
16
|
+
|
|
3
17
|
## 3.10.8
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/provider.js
CHANGED
|
@@ -13,13 +13,13 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
13
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
15
|
var _setPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/setPrototypeOf"));
|
|
16
|
-
var _dataloader = _interopRequireDefault(require("dataloader"));
|
|
17
|
-
var _linkingCommon = require("@atlaskit/linking-common");
|
|
18
16
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
17
|
+
var _linkingCommon = require("@atlaskit/linking-common");
|
|
18
|
+
var _dataloader = _interopRequireDefault(require("dataloader"));
|
|
19
19
|
var _transformer = require("./transformer");
|
|
20
20
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
21
|
-
var api = _interopRequireWildcard(require("./api"));
|
|
22
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
+
var api = _interopRequireWildcard(require("./api"));
|
|
23
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
25
|
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), (0, _setPrototypeOf2.default)(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return (0, _inherits2.default)(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
@@ -78,6 +78,15 @@ var isJiraPlan = function isJiraPlan(url) {
|
|
|
78
78
|
resourceContext: 2
|
|
79
79
|
}));
|
|
80
80
|
};
|
|
81
|
+
var isJiraVersion = function isJiraVersion(url) {
|
|
82
|
+
return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
|
|
83
|
+
};
|
|
84
|
+
var isRovoAgentProfilePage = function isRovoAgentProfilePage(url) {
|
|
85
|
+
if ((0, _platformFeatureFlags.fg)('rovo_agent_profile_page_default_embed')) {
|
|
86
|
+
return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
};
|
|
81
90
|
var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
|
|
82
91
|
function EditorCardProvider(envKey, baseUrlOverride, product) {
|
|
83
92
|
var _this = this;
|
|
@@ -361,10 +370,14 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function () {
|
|
|
361
370
|
value: function getHardCodedAppearance(url) {
|
|
362
371
|
// Replace directly with isJiraPlan(url) on cleanup
|
|
363
372
|
var isJiraPlanEvaluated;
|
|
364
|
-
if ((0, _platformFeatureFlags.fg)('
|
|
373
|
+
if ((0, _platformFeatureFlags.fg)('smart_links_for_plans_platform')) {
|
|
365
374
|
isJiraPlanEvaluated = isJiraPlan(url);
|
|
366
375
|
}
|
|
367
|
-
|
|
376
|
+
var isJiraVersionEvaluated;
|
|
377
|
+
if ((0, _platformFeatureFlags.fg)('smartlink_jira_releases')) {
|
|
378
|
+
isJiraVersionEvaluated = isJiraVersion(url);
|
|
379
|
+
}
|
|
380
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraPlanEvaluated || isJiraVersionEvaluated) {
|
|
368
381
|
return 'embed';
|
|
369
382
|
}
|
|
370
383
|
}
|
package/dist/es2019/provider.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import DataLoader from 'dataloader';
|
|
2
|
-
import { getStatus } from '@atlaskit/linking-common';
|
|
3
1
|
import { extractPreview } from '@atlaskit/link-extractors';
|
|
2
|
+
import { getStatus } from '@atlaskit/linking-common';
|
|
3
|
+
import DataLoader from 'dataloader';
|
|
4
4
|
import { Transformer } from './transformer';
|
|
5
|
-
import { getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
|
|
6
5
|
import { CardClient } from '@atlaskit/link-provider';
|
|
7
|
-
import
|
|
6
|
+
import { getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import * as api from './api';
|
|
9
9
|
const BATCH_WAIT_TIME = 50;
|
|
10
10
|
|
|
11
11
|
// Check if it is matching a Jira Roadmaps or Jira Timeline url
|
|
@@ -34,6 +34,15 @@ const isJiraBoard = url => {
|
|
|
34
34
|
const isJiraPlan = url => {
|
|
35
35
|
return url.match(/https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/);
|
|
36
36
|
};
|
|
37
|
+
const isJiraVersion = url => {
|
|
38
|
+
return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
|
|
39
|
+
};
|
|
40
|
+
const isRovoAgentProfilePage = url => {
|
|
41
|
+
if (fg('rovo_agent_profile_page_default_embed')) {
|
|
42
|
+
return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
37
46
|
export class EditorCardProvider {
|
|
38
47
|
constructor(envKey, baseUrlOverride, product) {
|
|
39
48
|
this.baseUrl = baseUrlOverride || getBaseUrl(envKey);
|
|
@@ -140,10 +149,14 @@ export class EditorCardProvider {
|
|
|
140
149
|
getHardCodedAppearance(url) {
|
|
141
150
|
// Replace directly with isJiraPlan(url) on cleanup
|
|
142
151
|
let isJiraPlanEvaluated;
|
|
143
|
-
if (fg('
|
|
152
|
+
if (fg('smart_links_for_plans_platform')) {
|
|
144
153
|
isJiraPlanEvaluated = isJiraPlan(url);
|
|
145
154
|
}
|
|
146
|
-
|
|
155
|
+
let isJiraVersionEvaluated;
|
|
156
|
+
if (fg('smartlink_jira_releases')) {
|
|
157
|
+
isJiraVersionEvaluated = isJiraVersion(url);
|
|
158
|
+
}
|
|
159
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraPlanEvaluated || isJiraVersionEvaluated) {
|
|
147
160
|
return 'embed';
|
|
148
161
|
}
|
|
149
162
|
}
|
package/dist/esm/provider.js
CHANGED
|
@@ -7,14 +7,14 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
10
|
-
import DataLoader from 'dataloader';
|
|
11
|
-
import { getStatus } from '@atlaskit/linking-common';
|
|
12
10
|
import { extractPreview } from '@atlaskit/link-extractors';
|
|
11
|
+
import { getStatus } from '@atlaskit/linking-common';
|
|
12
|
+
import DataLoader from 'dataloader';
|
|
13
13
|
import { Transformer } from './transformer';
|
|
14
|
-
import { getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
|
|
15
14
|
import { CardClient } from '@atlaskit/link-provider';
|
|
16
|
-
import
|
|
15
|
+
import { getBaseUrl, getResolverUrl } from '@atlaskit/linking-common';
|
|
17
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import * as api from './api';
|
|
18
18
|
var BATCH_WAIT_TIME = 50;
|
|
19
19
|
|
|
20
20
|
// Check if it is matching a Jira Roadmaps or Jira Timeline url
|
|
@@ -70,6 +70,15 @@ var isJiraPlan = function isJiraPlan(url) {
|
|
|
70
70
|
resourceContext: 2
|
|
71
71
|
}));
|
|
72
72
|
};
|
|
73
|
+
var isJiraVersion = function isJiraVersion(url) {
|
|
74
|
+
return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
|
|
75
|
+
};
|
|
76
|
+
var isRovoAgentProfilePage = function isRovoAgentProfilePage(url) {
|
|
77
|
+
if (fg('rovo_agent_profile_page_default_embed')) {
|
|
78
|
+
return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
};
|
|
73
82
|
export var EditorCardProvider = /*#__PURE__*/function () {
|
|
74
83
|
function EditorCardProvider(envKey, baseUrlOverride, product) {
|
|
75
84
|
var _this = this;
|
|
@@ -353,10 +362,14 @@ export var EditorCardProvider = /*#__PURE__*/function () {
|
|
|
353
362
|
value: function getHardCodedAppearance(url) {
|
|
354
363
|
// Replace directly with isJiraPlan(url) on cleanup
|
|
355
364
|
var isJiraPlanEvaluated;
|
|
356
|
-
if (fg('
|
|
365
|
+
if (fg('smart_links_for_plans_platform')) {
|
|
357
366
|
isJiraPlanEvaluated = isJiraPlan(url);
|
|
358
367
|
}
|
|
359
|
-
|
|
368
|
+
var isJiraVersionEvaluated;
|
|
369
|
+
if (fg('smartlink_jira_releases')) {
|
|
370
|
+
isJiraVersionEvaluated = isJiraVersion(url);
|
|
371
|
+
}
|
|
372
|
+
if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isJiraList(url) || isGiphyMedia(url) || isProformaView(url) || isConfluenceWhiteboard(url) || isConfluenceDatabase(url) || isYoutubeVideo(url) || isLoomUrl(url) || isJiraDashboard(url) || isJiraBacklog(url) || isJiraBoard(url) || isRovoAgentProfilePage(url) || isJiraPlanEvaluated || isJiraVersionEvaluated) {
|
|
360
373
|
return 'embed';
|
|
361
374
|
}
|
|
362
375
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-card-provider",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.1",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/eslint-plugin-platform": "0.12.0",
|
|
37
|
-
"@atlaskit/link-client-extension": "^
|
|
37
|
+
"@atlaskit/link-client-extension": "^3.0.0",
|
|
38
38
|
"@atlaskit/link-extractors": "^1.9.0",
|
|
39
39
|
"@atlaskit/linking-common": "^6.0.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
@@ -43,14 +43,20 @@
|
|
|
43
43
|
"json-ld-types": "^4.1.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@atlaskit/link-provider": "^1.
|
|
46
|
+
"@atlaskit/link-provider": "^1.17.0",
|
|
47
47
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"typescript": "~5.4.2"
|
|
51
51
|
},
|
|
52
52
|
"platform-feature-flags": {
|
|
53
|
-
"
|
|
53
|
+
"smart_links_for_plans_platform": {
|
|
54
|
+
"type": "boolean"
|
|
55
|
+
},
|
|
56
|
+
"smartlink_jira_releases": {
|
|
57
|
+
"type": "boolean"
|
|
58
|
+
},
|
|
59
|
+
"rovo_agent_profile_page_default_embed": {
|
|
54
60
|
"type": "boolean"
|
|
55
61
|
}
|
|
56
62
|
}
|