@atlaskit/editor-card-provider 3.0.2 → 3.0.3

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f10ed88032c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f10ed88032c) - With the renaming of Jira Roadmaps to Timeline, we are updating the regex rules to match timeline in conjunction to roadmaps
8
+ - Updated dependencies
9
+
3
10
  ## 3.0.2
4
11
 
5
12
  ### Patch Changes
@@ -25,8 +25,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
25
25
  // @see https://github.com/graphql/dataloader/issues/249
26
26
 
27
27
  var BATCH_WAIT_TIME = 50;
28
- var isJiraRoadMap = function isJiraRoadMap(url) {
29
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/roadmap\/?/);
28
+
29
+ // Check if it is matching a Jira Roadmaps or Jira Timeline url
30
+ // NOT to be confused with JSM timeline
31
+ var isJiraRoadmapOrTimeline = function isJiraRoadmapOrTimeline(url) {
32
+ return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
30
33
  };
31
34
  var isPolarisView = function isPolarisView(url) {
32
35
  return url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+/);
@@ -309,7 +312,7 @@ var EditorCardProvider = /*#__PURE__*/function () {
309
312
  }, {
310
313
  key: "getHardCodedAppearance",
311
314
  value: function getHardCodedAppearance(url) {
312
- if (isJiraRoadMap(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url)) {
315
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url)) {
313
316
  return 'embed';
314
317
  }
315
318
  }
@@ -414,7 +417,7 @@ var EditorCardProvider = /*#__PURE__*/function () {
414
417
  // if user's default choice is NOT "inline" (so, block or embed at this point, url was dealt with above)
415
418
  userPreference ||
416
419
  // If user's default choice is "inline" or user hasn't specified preferences at all,
417
- // we check whatever one of the hardcoded providers match url (jira roadmap, polaris, etc)
420
+ // we check whatever one of the hardcoded providers match url (jira /timeline, polaris, etc)
418
421
  hardCodedAppearance ||
419
422
  // If non match, we see if this provider has default appearance for this particular regexp
420
423
  providerDefaultAppearance ||
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -9,7 +9,10 @@ import { getStatus } from './utils';
9
9
  import { CardClient } from '@atlaskit/link-provider';
10
10
  import * as api from './api';
11
11
  const BATCH_WAIT_TIME = 50;
12
- const isJiraRoadMap = url => url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/roadmap\/?/);
12
+
13
+ // Check if it is matching a Jira Roadmaps or Jira Timeline url
14
+ // NOT to be confused with JSM timeline
15
+ const isJiraRoadmapOrTimeline = url => url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
13
16
  const isPolarisView = url => url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+/);
14
17
  const isJwmView = url => url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
15
18
  const isGiphyMedia = url => url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
@@ -105,7 +108,7 @@ export class EditorCardProvider {
105
108
  return (_this$providersData2 = this.providersData) === null || _this$providersData2 === void 0 ? void 0 : _this$providersData2.patterns.find(pattern => url.match(pattern.source));
106
109
  }
107
110
  getHardCodedAppearance(url) {
108
- if (isJiraRoadMap(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url)) {
111
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url)) {
109
112
  return 'embed';
110
113
  }
111
114
  }
@@ -158,7 +161,7 @@ export class EditorCardProvider {
158
161
  // if user's default choice is NOT "inline" (so, block or embed at this point, url was dealt with above)
159
162
  userPreference ||
160
163
  // If user's default choice is "inline" or user hasn't specified preferences at all,
161
- // we check whatever one of the hardcoded providers match url (jira roadmap, polaris, etc)
164
+ // we check whatever one of the hardcoded providers match url (jira /timeline, polaris, etc)
162
165
  hardCodedAppearance ||
163
166
  // If non match, we see if this provider has default appearance for this particular regexp
164
167
  providerDefaultAppearance ||
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -14,8 +14,11 @@ import { getStatus } from './utils';
14
14
  import { CardClient } from '@atlaskit/link-provider';
15
15
  import * as api from './api';
16
16
  var BATCH_WAIT_TIME = 50;
17
- var isJiraRoadMap = function isJiraRoadMap(url) {
18
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/roadmap\/?/);
17
+
18
+ // Check if it is matching a Jira Roadmaps or Jira Timeline url
19
+ // NOT to be confused with JSM timeline
20
+ var isJiraRoadmapOrTimeline = function isJiraRoadmapOrTimeline(url) {
21
+ return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
19
22
  };
20
23
  var isPolarisView = function isPolarisView(url) {
21
24
  return url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+/);
@@ -298,7 +301,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
298
301
  }, {
299
302
  key: "getHardCodedAppearance",
300
303
  value: function getHardCodedAppearance(url) {
301
- if (isJiraRoadMap(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url)) {
304
+ if (isJiraRoadmapOrTimeline(url) || isPolarisView(url) || isJwmView(url) || isGiphyMedia(url) || isProformaView(url)) {
302
305
  return 'embed';
303
306
  }
304
307
  }
@@ -403,7 +406,7 @@ export var EditorCardProvider = /*#__PURE__*/function () {
403
406
  // if user's default choice is NOT "inline" (so, block or embed at this point, url was dealt with above)
404
407
  userPreference ||
405
408
  // If user's default choice is "inline" or user hasn't specified preferences at all,
406
- // we check whatever one of the hardcoded providers match url (jira roadmap, polaris, etc)
409
+ // we check whatever one of the hardcoded providers match url (jira /timeline, polaris, etc)
407
410
  hardCodedAppearance ||
408
411
  // If non match, we see if this provider has default appearance for this particular regexp
409
412
  providerDefaultAppearance ||
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
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,14 +34,14 @@
34
34
  ".": "./src/index.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@atlaskit/linking-common": "^2.10.0",
37
+ "@atlaskit/linking-common": "^2.12.0",
38
38
  "@babel/runtime": "^7.0.0",
39
39
  "dataloader": "^2.0.0",
40
40
  "json-ld-types": "3.7.0",
41
41
  "setimmediate": "^1.0.5"
42
42
  },
43
43
  "peerDependencies": {
44
- "@atlaskit/link-provider": "^1.6.2",
44
+ "@atlaskit/link-provider": "^1.6.3",
45
45
  "react": "^16.8.0"
46
46
  },
47
47
  "devDependencies": {
package/report.api.md CHANGED
@@ -69,7 +69,7 @@ type EnvironmentsKeys = keyof typeof BaseUrls;
69
69
 
70
70
  ```json
71
71
  {
72
- "@atlaskit/link-provider": "^1.6.2",
72
+ "@atlaskit/link-provider": "^1.6.3",
73
73
  "react": "^16.8.0"
74
74
  }
75
75
  ```