@atlaskit/editor-card-provider 7.0.5 → 7.0.6

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,13 @@
1
1
  # @atlaskit/editor-card-provider
2
2
 
3
+ ## 7.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8e5e159447746`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e5e159447746) -
8
+ Clean up prefer static regex violations
9
+ - Updated dependencies
10
+
3
11
  ## 7.0.5
4
12
 
5
13
  ### Patch Changes
@@ -38,114 +38,128 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new B
38
38
  var BATCH_WAIT_TIME = 50;
39
39
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
40
40
  // NOT to be confused with JSM timeline
41
+ var JIRA_ROADMAP_OR_TIMELINE_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/;
42
+ var POLARIS_VIEW_REGEX = /^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/;
43
+ var JWM_VIEW_REGEX = /^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/;
44
+ var JIRA_LIST_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/;
45
+ var GIPHY_MEDIA_REGEX = /^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//;
46
+ var PROFORMA_VIEW_REGEX = /^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/;
47
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
48
+ var CONFLUENCE_WHITEBOARD_DECIMAL_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
49
+ resourceId: 1
50
+ });
51
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
52
+ var CONFLUENCE_WHITEBOARD_UUID_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/, {
53
+ resourceId: 1
54
+ });
55
+ var CONFLUENCE_DATABASE_REGEX = /\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/;
56
+ var YOUTUBE_VIDEO_REGEX = /^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/;
57
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
58
+ var LOOM_VIDEO_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
59
+ videoId: 5
60
+ });
61
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
62
+ var LOOM_SCREENSHOT_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
63
+ id: 2
64
+ });
65
+ var JIRA_DASHBOARD_REGEX = /^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/;
66
+ var JIRA_BACKLOG_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/;
67
+ var JIRA_BOARD_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/;
68
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
69
+ var JIRA_PLAN_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
70
+ resourceId: 1
71
+ });
72
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
73
+ var JIRA_PLAN_WITH_SCENARIO_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
74
+ resourceId: 1,
75
+ resourceContext: 2
76
+ });
77
+ var JIRA_VERSION_REGEX = /https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/;
78
+ var JIRA_FORM_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/;
79
+ var JIRA_SUMMARY_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/;
80
+ var ROVO_AGENT_PROFILE_PAGE_REGEX = /^https:\/\/.*?\/people\/agent\/.+$/;
81
+ var CUSTOMER_360_LANDING_PAGE_REGEX = /^https:\/\/customer\.atlassian\.com\/.*$/;
82
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
83
+ var CONFLUENCE_TEAM_CALENDARS_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
84
+ resourceContext: 1,
85
+ resourceId: 2
86
+ });
87
+ var JIRA_ISSUE_NAVIGATOR_REGEX = /^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/;
88
+ var AVP_VISUALIZATION_VIEW_REGEX = /^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/;
89
+ var JIRA_WORK_ITEM_REGEX = /\/browse\/((?:\w+)-(?:\d+))/i;
90
+ var DOES_URL_MATCH_PATH_START_REGEX = /^[a-zA-Z0-9]/;
91
+ var DOES_URL_MATCH_PATH_END_REGEX = /[a-zA-Z0-9]$/;
41
92
  var isJiraRoadmapOrTimeline = function isJiraRoadmapOrTimeline(url) {
42
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
93
+ return url.match(JIRA_ROADMAP_OR_TIMELINE_REGEX);
43
94
  };
44
95
  var isPolarisView = function isPolarisView(url) {
45
- return url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/);
96
+ return url.match(POLARIS_VIEW_REGEX);
46
97
  };
47
98
  var isJwmView = function isJwmView(url) {
48
- return url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
99
+ return url.match(JWM_VIEW_REGEX);
49
100
  };
50
101
  var isJiraList = function isJiraList(url) {
51
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/);
102
+ return url.match(JIRA_LIST_REGEX);
52
103
  };
53
104
  var isGiphyMedia = function isGiphyMedia(url) {
54
- return url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
105
+ return url.match(GIPHY_MEDIA_REGEX);
55
106
  };
56
107
  var isProformaView = function isProformaView(url) {
57
- return url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
108
+ return url.match(PROFORMA_VIEW_REGEX);
58
109
  };
59
110
  var isConfluenceWhiteboard = function isConfluenceWhiteboard(url) {
60
- return (
61
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
62
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
63
- resourceId: 1
64
- })) || url.match(
65
- /*#__PURE__*/
66
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
67
- _wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/, {
68
- resourceId: 1
69
- }))
70
- );
111
+ return url.match(CONFLUENCE_WHITEBOARD_DECIMAL_REGEX) || url.match(CONFLUENCE_WHITEBOARD_UUID_REGEX);
71
112
  };
72
113
  var isConfluenceDatabase = function isConfluenceDatabase(url) {
73
- return url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/);
114
+ return url.match(CONFLUENCE_DATABASE_REGEX);
74
115
  };
75
116
  var isYoutubeVideo = function isYoutubeVideo(url) {
76
- return url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
117
+ return url.match(YOUTUBE_VIDEO_REGEX);
77
118
  };
78
119
  var isLoomVideoUrl = function isLoomVideoUrl(url) {
79
- return url.match(
80
- /*#__PURE__*/
81
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
82
- _wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
83
- videoId: 5
84
- }));
120
+ return url.match(LOOM_VIDEO_URL_REGEX);
85
121
  };
86
122
  var isLoomScreenshotUrl = function isLoomScreenshotUrl(url) {
87
- return url.match(
88
- /*#__PURE__*/
89
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
90
- _wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
91
- id: 2
92
- }));
123
+ return url.match(LOOM_SCREENSHOT_URL_REGEX);
93
124
  };
94
125
  var isJiraDashboard = function isJiraDashboard(url) {
95
- return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
126
+ return url.match(JIRA_DASHBOARD_REGEX);
96
127
  };
97
128
  var isJiraBacklog = function isJiraBacklog(url) {
98
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/);
129
+ return url.match(JIRA_BACKLOG_REGEX);
99
130
  };
100
131
  var isJiraBoard = function isJiraBoard(url) {
101
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
132
+ return url.match(JIRA_BOARD_REGEX);
102
133
  };
103
134
  var isJiraPlan = function isJiraPlan(url) {
104
- return (
105
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
106
- url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
107
- resourceId: 1
108
- })) || url.match(
109
- /*#__PURE__*/
110
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
111
- _wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
112
- resourceId: 1,
113
- resourceContext: 2
114
- }))
115
- );
135
+ return url.match(JIRA_PLAN_REGEX) || url.match(JIRA_PLAN_WITH_SCENARIO_REGEX);
116
136
  };
117
137
  var isJiraVersion = function isJiraVersion(url) {
118
- return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
138
+ return url.match(JIRA_VERSION_REGEX);
119
139
  };
120
140
  var isJiraForm = function isJiraForm(url) {
121
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/);
141
+ return url.match(JIRA_FORM_REGEX);
122
142
  };
123
143
  var isJiraSummary = function isJiraSummary(url) {
124
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/);
144
+ return url.match(JIRA_SUMMARY_REGEX);
125
145
  };
126
146
  var isRovoAgentProfilePage = function isRovoAgentProfilePage(url) {
127
- return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
147
+ return url.match(ROVO_AGENT_PROFILE_PAGE_REGEX);
128
148
  };
129
149
  var isCustomer360LandingPage = function isCustomer360LandingPage(url) {
130
- return url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
150
+ return url.match(CUSTOMER_360_LANDING_PAGE_REGEX);
131
151
  };
132
152
  var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
133
- return (
134
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
135
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
136
- resourceContext: 1,
137
- resourceId: 2
138
- }))
139
- );
153
+ return url.match(CONFLUENCE_TEAM_CALENDARS_REGEX);
140
154
  };
141
155
  var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
142
- return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
156
+ return url.match(JIRA_ISSUE_NAVIGATOR_REGEX);
143
157
  };
144
158
  var isAvpVisualizationView = function isAvpVisualizationView(url) {
145
- return url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
159
+ return url.match(AVP_VISUALIZATION_VIEW_REGEX);
146
160
  };
147
161
  var isJiraWorkItem = exports.isJiraWorkItem = function isJiraWorkItem(url) {
148
- return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
162
+ return JIRA_WORK_ITEM_REGEX.test(url);
149
163
  };
150
164
 
151
165
  // Local UrlChecker-compatible wrapper around the boolean-returning
@@ -515,8 +529,8 @@ var EditorCardProvider = exports.EditorCardProvider = /*#__PURE__*/function (_No
515
529
  key: "doesUrlMatchPath",
516
530
  value: function doesUrlMatchPath(path, url) {
517
531
  // Using [a-zA-Z0-9] here instead of \w since that includes underscores
518
- var startingRegex = new RegExp(/^[a-zA-Z0-9]/).test(path) ? '(^|[^a-zA-Z0-9])' : '';
519
- var endingRegex = new RegExp(/[a-zA-Z0-9]$/).test(path) ? '($|[^a-zA-Z0-9])' : '';
532
+ var startingRegex = DOES_URL_MATCH_PATH_START_REGEX.test(path) ? '(^|[^a-zA-Z0-9])' : '';
533
+ var endingRegex = DOES_URL_MATCH_PATH_END_REGEX.test(path) ? '($|[^a-zA-Z0-9])' : '';
520
534
  var escapedPath = path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
521
535
  var regexPattern = new RegExp("".concat(startingRegex).concat(escapedPath).concat(endingRegex));
522
536
  return regexPattern.test(url);
@@ -15,65 +15,85 @@ import { SmartCardLocalCacheClient } from './smart-card-local-cache-client';
15
15
  const BATCH_WAIT_TIME = 50;
16
16
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
17
17
  // NOT to be confused with JSM timeline
18
- const isJiraRoadmapOrTimeline = url => url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
19
- const isPolarisView = url => url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/);
20
- const isJwmView = url => url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
21
- const isJiraList = url => url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/);
22
- const isGiphyMedia = url => url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
23
- const isProformaView = url => url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
24
- const isConfluenceWhiteboard = url =>
18
+ const JIRA_ROADMAP_OR_TIMELINE_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/;
19
+ const POLARIS_VIEW_REGEX = /^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/;
20
+ const JWM_VIEW_REGEX = /^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/;
21
+ const JIRA_LIST_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/;
22
+ const GIPHY_MEDIA_REGEX = /^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//;
23
+ const PROFORMA_VIEW_REGEX = /^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/;
25
24
  // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
26
- url.match(/\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>\d+)(\?\/)?/) || url.match(
25
+ const CONFLUENCE_WHITEBOARD_DECIMAL_REGEX = /\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>\d+)(\?\/)?/;
27
26
  // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
28
- /\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/);
29
- const isConfluenceDatabase = url => url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/);
30
- const isYoutubeVideo = url => url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
27
+ const CONFLUENCE_WHITEBOARD_UUID_REGEX = /\/wiki\/spaces\/?.*\/whiteboard\/(?<resourceId>[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/;
28
+ const CONFLUENCE_DATABASE_REGEX = /\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/;
29
+ const YOUTUBE_VIDEO_REGEX = /^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/;
30
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
31
+ const LOOM_VIDEO_URL_REGEX = /^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?(?<videoId>[a-f0-9]{32})/;
32
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
33
+ const LOOM_SCREENSHOT_URL_REGEX = /^https:\/\/(.*?\.)?loom\..*?\/i\/(?<id>[a-f0-9]{32})/;
34
+ const JIRA_DASHBOARD_REGEX = /^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/;
35
+ const JIRA_BACKLOG_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/;
36
+ const JIRA_BOARD_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/;
37
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
38
+ const JIRA_PLAN_REGEX = /https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)/;
39
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
40
+ const JIRA_PLAN_WITH_SCENARIO_REGEX = /https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/;
41
+ const JIRA_VERSION_REGEX = /https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/;
42
+ const JIRA_FORM_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/;
43
+ const JIRA_SUMMARY_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/;
44
+ const ROVO_AGENT_PROFILE_PAGE_REGEX = /^https:\/\/.*?\/people\/agent\/.+$/;
45
+ const CUSTOMER_360_LANDING_PAGE_REGEX = /^https:\/\/customer\.atlassian\.com\/.*$/;
46
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
47
+ const CONFLUENCE_TEAM_CALENDARS_REGEX = /\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>[a-zA-Z0-9-]+)/;
48
+ const JIRA_ISSUE_NAVIGATOR_REGEX = /^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/;
49
+ const AVP_VISUALIZATION_VIEW_REGEX = /^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/;
50
+ const JIRA_WORK_ITEM_REGEX = /\/browse\/((?:\w+)-(?:\d+))/i;
51
+ const DOES_URL_MATCH_PATH_START_REGEX = /^[a-zA-Z0-9]/;
52
+ const DOES_URL_MATCH_PATH_END_REGEX = /[a-zA-Z0-9]$/;
53
+ const isJiraRoadmapOrTimeline = url => url.match(JIRA_ROADMAP_OR_TIMELINE_REGEX);
54
+ const isPolarisView = url => url.match(POLARIS_VIEW_REGEX);
55
+ const isJwmView = url => url.match(JWM_VIEW_REGEX);
56
+ const isJiraList = url => url.match(JIRA_LIST_REGEX);
57
+ const isGiphyMedia = url => url.match(GIPHY_MEDIA_REGEX);
58
+ const isProformaView = url => url.match(PROFORMA_VIEW_REGEX);
59
+ const isConfluenceWhiteboard = url => url.match(CONFLUENCE_WHITEBOARD_DECIMAL_REGEX) || url.match(CONFLUENCE_WHITEBOARD_UUID_REGEX);
60
+ const isConfluenceDatabase = url => url.match(CONFLUENCE_DATABASE_REGEX);
61
+ const isYoutubeVideo = url => url.match(YOUTUBE_VIDEO_REGEX);
31
62
  const isLoomVideoUrl = url => {
32
- return url.match(
33
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
34
- /^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?(?<videoId>[a-f0-9]{32})/);
63
+ return url.match(LOOM_VIDEO_URL_REGEX);
35
64
  };
36
65
  const isLoomScreenshotUrl = url => {
37
- return url.match(
38
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
39
- /^https:\/\/(.*?\.)?loom\..*?\/i\/(?<id>[a-f0-9]{32})/);
66
+ return url.match(LOOM_SCREENSHOT_URL_REGEX);
40
67
  };
41
68
  const isJiraDashboard = url => {
42
- return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
69
+ return url.match(JIRA_DASHBOARD_REGEX);
43
70
  };
44
71
  const isJiraBacklog = url => {
45
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/);
72
+ return url.match(JIRA_BACKLOG_REGEX);
46
73
  };
47
74
  const isJiraBoard = url => {
48
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
75
+ return url.match(JIRA_BOARD_REGEX);
49
76
  };
50
77
  const isJiraPlan = url => {
51
- return (
52
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
53
- url.match(/https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)/) || url.match(
54
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
55
- /https:\/\/.*?\/jira\/plans\/(?<resourceId>\d+)\/scenarios\/(?<resourceContext>\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/)
56
- );
78
+ return url.match(JIRA_PLAN_REGEX) || url.match(JIRA_PLAN_WITH_SCENARIO_REGEX);
57
79
  };
58
80
  const isJiraVersion = url => {
59
- return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
81
+ return url.match(JIRA_VERSION_REGEX);
60
82
  };
61
83
  const isJiraForm = url => {
62
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/);
84
+ return url.match(JIRA_FORM_REGEX);
63
85
  };
64
86
  const isJiraSummary = url => {
65
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/);
87
+ return url.match(JIRA_SUMMARY_REGEX);
66
88
  };
67
89
  const isRovoAgentProfilePage = url => {
68
- return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
90
+ return url.match(ROVO_AGENT_PROFILE_PAGE_REGEX);
69
91
  };
70
- const isCustomer360LandingPage = url => url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
71
- const isConfluenceTeamCalendars = url =>
72
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
73
- url.match(/\/wiki\/spaces\/(?<resourceContext>[^\/]+)\/calendars\/(?<resourceId>[a-zA-Z0-9-]+)/);
74
- const isJiraIssueNavigator = url => url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
75
- const isAvpVisualizationView = url => url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
76
- export const isJiraWorkItem = url => /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
92
+ const isCustomer360LandingPage = url => url.match(CUSTOMER_360_LANDING_PAGE_REGEX);
93
+ const isConfluenceTeamCalendars = url => url.match(CONFLUENCE_TEAM_CALENDARS_REGEX);
94
+ const isJiraIssueNavigator = url => url.match(JIRA_ISSUE_NAVIGATOR_REGEX);
95
+ const isAvpVisualizationView = url => url.match(AVP_VISUALIZATION_VIEW_REGEX);
96
+ export const isJiraWorkItem = url => JIRA_WORK_ITEM_REGEX.test(url);
77
97
 
78
98
  // Local UrlChecker-compatible wrapper around the boolean-returning
79
99
  // `isConfluenceSlideUrl` from `./url-checkers` (the single source of truth for
@@ -269,8 +289,8 @@ export class EditorCardProvider extends NodeDataProvider {
269
289
  }
270
290
  doesUrlMatchPath(path, url) {
271
291
  // Using [a-zA-Z0-9] here instead of \w since that includes underscores
272
- const startingRegex = new RegExp(/^[a-zA-Z0-9]/).test(path) ? '(^|[^a-zA-Z0-9])' : '';
273
- const endingRegex = new RegExp(/[a-zA-Z0-9]$/).test(path) ? '($|[^a-zA-Z0-9])' : '';
292
+ const startingRegex = DOES_URL_MATCH_PATH_START_REGEX.test(path) ? '(^|[^a-zA-Z0-9])' : '';
293
+ const endingRegex = DOES_URL_MATCH_PATH_END_REGEX.test(path) ? '($|[^a-zA-Z0-9])' : '';
274
294
  const escapedPath = path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
275
295
  const regexPattern = new RegExp(`${startingRegex}${escapedPath}${endingRegex}`);
276
296
  return regexPattern.test(url);
@@ -30,114 +30,128 @@ import { SmartCardLocalCacheClient } from './smart-card-local-cache-client';
30
30
  var BATCH_WAIT_TIME = 50;
31
31
  // Check if it is matching a Jira Roadmaps or Jira Timeline url
32
32
  // NOT to be confused with JSM timeline
33
+ var JIRA_ROADMAP_OR_TIMELINE_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/;
34
+ var POLARIS_VIEW_REGEX = /^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/;
35
+ var JWM_VIEW_REGEX = /^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/;
36
+ var JIRA_LIST_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/;
37
+ var GIPHY_MEDIA_REGEX = /^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//;
38
+ var PROFORMA_VIEW_REGEX = /^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/;
39
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
40
+ var CONFLUENCE_WHITEBOARD_DECIMAL_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
41
+ resourceId: 1
42
+ });
43
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
44
+ var CONFLUENCE_WHITEBOARD_UUID_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/, {
45
+ resourceId: 1
46
+ });
47
+ var CONFLUENCE_DATABASE_REGEX = /\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/;
48
+ var YOUTUBE_VIDEO_REGEX = /^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/;
49
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
50
+ var LOOM_VIDEO_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
51
+ videoId: 5
52
+ });
53
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
54
+ var LOOM_SCREENSHOT_URL_REGEX = /*#__PURE__*/_wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
55
+ id: 2
56
+ });
57
+ var JIRA_DASHBOARD_REGEX = /^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/;
58
+ var JIRA_BACKLOG_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/;
59
+ var JIRA_BOARD_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/;
60
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
61
+ var JIRA_PLAN_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
62
+ resourceId: 1
63
+ });
64
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
65
+ var JIRA_PLAN_WITH_SCENARIO_REGEX = /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
66
+ resourceId: 1,
67
+ resourceContext: 2
68
+ });
69
+ var JIRA_VERSION_REGEX = /https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/;
70
+ var JIRA_FORM_REGEX = /https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/;
71
+ var JIRA_SUMMARY_REGEX = /^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/;
72
+ var ROVO_AGENT_PROFILE_PAGE_REGEX = /^https:\/\/.*?\/people\/agent\/.+$/;
73
+ var CUSTOMER_360_LANDING_PAGE_REGEX = /^https:\/\/customer\.atlassian\.com\/.*$/;
74
+ // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
75
+ var CONFLUENCE_TEAM_CALENDARS_REGEX = /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
76
+ resourceContext: 1,
77
+ resourceId: 2
78
+ });
79
+ var JIRA_ISSUE_NAVIGATOR_REGEX = /^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/;
80
+ var AVP_VISUALIZATION_VIEW_REGEX = /^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/;
81
+ var JIRA_WORK_ITEM_REGEX = /\/browse\/((?:\w+)-(?:\d+))/i;
82
+ var DOES_URL_MATCH_PATH_START_REGEX = /^[a-zA-Z0-9]/;
83
+ var DOES_URL_MATCH_PATH_END_REGEX = /[a-zA-Z0-9]$/;
33
84
  var isJiraRoadmapOrTimeline = function isJiraRoadmapOrTimeline(url) {
34
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/.*?\/(timeline|roadmap)\/?/);
85
+ return url.match(JIRA_ROADMAP_OR_TIMELINE_REGEX);
35
86
  };
36
87
  var isPolarisView = function isPolarisView(url) {
37
- return url.match(/^https:\/\/.*?\/jira\/polaris\/projects\/[^\/]+?\/ideas\/view\/\d+$|^https:\/\/.*?\/secure\/JiraProductDiscoveryAnonymous\.jspa\?hash=\w+|^https:\/\/.*?\/jira\/polaris\/share\/\w+|^https:\/\/.*?\/jira\/discovery\/share\/views\/[\w-]+(\?selectedIssue=[\w-]+&issueViewLayout=sidebar&issueViewSection=[\w-]+)?$/);
88
+ return url.match(POLARIS_VIEW_REGEX);
38
89
  };
39
90
  var isJwmView = function isJwmView(url) {
40
- return url.match(/^https:\/\/.*?\/jira\/core\/projects\/[^\/]+?\/(timeline|calendar|list|board|summary|(form\/[^\/]+?))\/?/);
91
+ return url.match(JWM_VIEW_REGEX);
41
92
  };
42
93
  var isJiraList = function isJiraList(url) {
43
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/list\/?/);
94
+ return url.match(JIRA_LIST_REGEX);
44
95
  };
45
96
  var isGiphyMedia = function isGiphyMedia(url) {
46
- return url.match(/^https:\/\/(.*?\.)?giphy\.com\/(gifs|media|clips)\//);
97
+ return url.match(GIPHY_MEDIA_REGEX);
47
98
  };
48
99
  var isProformaView = function isProformaView(url) {
49
- return url.match(/^https:\/\/[^/]+\/jira\/(core|software(\/c)?|servicedesk)\/projects\/\w+\/forms\/form\/direct\/\d+\/\d+.*$/);
100
+ return url.match(PROFORMA_VIEW_REGEX);
50
101
  };
51
102
  var isConfluenceWhiteboard = function isConfluenceWhiteboard(url) {
52
- return (
53
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
54
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/(\d+)(\?\/)?/, {
55
- resourceId: 1
56
- })) || url.match(
57
- /*#__PURE__*/
58
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
59
- _wrapRegExp(/\/wiki\/spaces\/?.*\/whiteboard\/([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})(\?\/)?/, {
60
- resourceId: 1
61
- }))
62
- );
103
+ return url.match(CONFLUENCE_WHITEBOARD_DECIMAL_REGEX) || url.match(CONFLUENCE_WHITEBOARD_UUID_REGEX);
63
104
  };
64
105
  var isConfluenceDatabase = function isConfluenceDatabase(url) {
65
- return url.match(/\/wiki\/spaces\/~?[\d\w]+\/database\/\d+(\?.*)?$/);
106
+ return url.match(CONFLUENCE_DATABASE_REGEX);
66
107
  };
67
108
  var isYoutubeVideo = function isYoutubeVideo(url) {
68
- return url.match(/^https:\/\/(.*?\.)?(youtube\..*?\/(watch\?|v\/|shorts\/)|youtu\.be)/);
109
+ return url.match(YOUTUBE_VIDEO_REGEX);
69
110
  };
70
111
  var isLoomVideoUrl = function isLoomVideoUrl(url) {
71
- return url.match(
72
- /*#__PURE__*/
73
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
74
- _wrapRegExp(/^https:\/\/(.*?\.)?(loom\..*?\/(share|embed))\/([a-zA-Z0-9-]*-)?([a-f0-9]{32})/, {
75
- videoId: 5
76
- }));
112
+ return url.match(LOOM_VIDEO_URL_REGEX);
77
113
  };
78
114
  var isLoomScreenshotUrl = function isLoomScreenshotUrl(url) {
79
- return url.match(
80
- /*#__PURE__*/
81
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
82
- _wrapRegExp(/^https:\/\/(.*?\.)?loom\..*?\/i\/([a-f0-9]{32})/, {
83
- id: 2
84
- }));
115
+ return url.match(LOOM_SCREENSHOT_URL_REGEX);
85
116
  };
86
117
  var isJiraDashboard = function isJiraDashboard(url) {
87
- return url.match(/^https:\/\/.*?\/jira\/dashboards\/[0-9]+.*/);
118
+ return url.match(JIRA_DASHBOARD_REGEX);
88
119
  };
89
120
  var isJiraBacklog = function isJiraBacklog(url) {
90
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\/backlog\??.*/);
121
+ return url.match(JIRA_BACKLOG_REGEX);
91
122
  };
92
123
  var isJiraBoard = function isJiraBoard(url) {
93
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/boards\/\d\??.*/);
124
+ return url.match(JIRA_BOARD_REGEX);
94
125
  };
95
126
  var isJiraPlan = function isJiraPlan(url) {
96
- return (
97
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
98
- url.match( /*#__PURE__*/_wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)/, {
99
- resourceId: 1
100
- })) || url.match(
101
- /*#__PURE__*/
102
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
103
- _wrapRegExp(/https:\/\/.*?\/jira\/plans\/(\d+)\/scenarios\/(\d+)\/(timeline|summary|calendar|program\/\d+|dependencies)\/?/, {
104
- resourceId: 1,
105
- resourceContext: 2
106
- }))
107
- );
127
+ return url.match(JIRA_PLAN_REGEX) || url.match(JIRA_PLAN_WITH_SCENARIO_REGEX);
108
128
  };
109
129
  var isJiraVersion = function isJiraVersion(url) {
110
- return url.match(/https:\/\/.*?\/projects\/[^\/]+?\/versions\/\d+\/tab\/release-report-all-issues/);
130
+ return url.match(JIRA_VERSION_REGEX);
111
131
  };
112
132
  var isJiraForm = function isJiraForm(url) {
113
- return url.match(/https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/form\/\d\??.*/);
133
+ return url.match(JIRA_FORM_REGEX);
114
134
  };
115
135
  var isJiraSummary = function isJiraSummary(url) {
116
- return url.match(/^https:\/\/.*?\/jira\/software\/(c\/)?projects\/[^\/]+?\/summary/);
136
+ return url.match(JIRA_SUMMARY_REGEX);
117
137
  };
118
138
  var isRovoAgentProfilePage = function isRovoAgentProfilePage(url) {
119
- return url.match(/^https:\/\/.*?\/people\/agent\/.+$/);
139
+ return url.match(ROVO_AGENT_PROFILE_PAGE_REGEX);
120
140
  };
121
141
  var isCustomer360LandingPage = function isCustomer360LandingPage(url) {
122
- return url.match(/^https:\/\/customer\.atlassian\.com\/.*$/);
142
+ return url.match(CUSTOMER_360_LANDING_PAGE_REGEX);
123
143
  };
124
144
  var isConfluenceTeamCalendars = function isConfluenceTeamCalendars(url) {
125
- return (
126
- // @ts-ignore - TS1503 TypeScript 5.9.2 upgrade
127
- url.match( /*#__PURE__*/_wrapRegExp(/\/wiki\/spaces\/([^\/]+)\/calendars\/([a-zA-Z0-9-]+)/, {
128
- resourceContext: 1,
129
- resourceId: 2
130
- }))
131
- );
145
+ return url.match(CONFLUENCE_TEAM_CALENDARS_REGEX);
132
146
  };
133
147
  var isJiraIssueNavigator = function isJiraIssueNavigator(url) {
134
- return url.match(/^https:\/\/.*?\/jira\/software|core\/(c\/)?projects\/[^\/]+?\/issues\/?/);
148
+ return url.match(JIRA_ISSUE_NAVIGATOR_REGEX);
135
149
  };
136
150
  var isAvpVisualizationView = function isAvpVisualizationView(url) {
137
- return url.match(/^https:\/\/.*?\/avpviz\/c\/[^\/]+.*/);
151
+ return url.match(AVP_VISUALIZATION_VIEW_REGEX);
138
152
  };
139
153
  export var isJiraWorkItem = function isJiraWorkItem(url) {
140
- return /\/browse\/((?:\w+)-(?:\d+))/i.test(url);
154
+ return JIRA_WORK_ITEM_REGEX.test(url);
141
155
  };
142
156
 
143
157
  // Local UrlChecker-compatible wrapper around the boolean-returning
@@ -507,8 +521,8 @@ export var EditorCardProvider = /*#__PURE__*/function (_NodeDataProvider) {
507
521
  key: "doesUrlMatchPath",
508
522
  value: function doesUrlMatchPath(path, url) {
509
523
  // Using [a-zA-Z0-9] here instead of \w since that includes underscores
510
- var startingRegex = new RegExp(/^[a-zA-Z0-9]/).test(path) ? '(^|[^a-zA-Z0-9])' : '';
511
- var endingRegex = new RegExp(/[a-zA-Z0-9]$/).test(path) ? '($|[^a-zA-Z0-9])' : '';
524
+ var startingRegex = DOES_URL_MATCH_PATH_START_REGEX.test(path) ? '(^|[^a-zA-Z0-9])' : '';
525
+ var endingRegex = DOES_URL_MATCH_PATH_END_REGEX.test(path) ? '($|[^a-zA-Z0-9])' : '';
512
526
  var escapedPath = path.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
513
527
  var regexPattern = new RegExp("".concat(startingRegex).concat(escapedPath).concat(endingRegex));
514
528
  return regexPattern.test(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-card-provider",
3
- "version": "7.0.5",
3
+ "version": "7.0.6",
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",
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/linking-types": "^15.0.0",
32
32
  "@atlaskit/node-data-provider": "^13.0.0",
33
33
  "@atlaskit/platform-feature-flags": "^2.0.0",
34
- "@atlaskit/tmp-editor-statsig": "^109.0.0",
34
+ "@atlaskit/tmp-editor-statsig": "^109.1.0",
35
35
  "@babel/runtime": "^7.0.0",
36
36
  "dataloader": "^2.1.0"
37
37
  },